[PR #5326] [Engine] compare the PLE shard by file identity, not by path string #5386

Open
opened 2026-11-07 16:34:48 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/5326
Author: @GuideboardLabs
Created: 11/5/2026
Status: 🔄 Open

Base: main ← Head: pr-ple-shard-identity


📝 Commits (1)

  • 7be7ab6 [Engine] compare the PLE shard by file identity, not by path string

📊 Changes

1 file changed (+14 additions, -2 deletions)

View changed files

📝 src/program/generate.cpp (+14 -2)

📄 Description

A model whose PLE table is kept outside the model directory fails to load with native dense: duplicate split shard number, even though the shard list holds no duplicate file.

generate.cpp appends --ple-gguf to the native dense shard list when its path string is not already in that list. The list is first filled with every shard found beside --native by split name. A 28.8 GB PLE table is normally kept on a larger disk, and the model directory then carries a symlink (or a bind mount, or a second mount point) to it, so the same file is discovered under one path and appended again under another. It is admitted twice, and NativeDense::load refuses the model on the repeated split.no.

Problem: --ple-gguf naming the PLE shard by a second path to a file that is also present beside --native makes the model unloadable.

Environment: Strata 0.1.54, local gfx1010 build of 870aedd9, Ubuntu 24.04, RX 5700 XT 8 GB, RAM 31 GiB. Model unsloth/Qwen3.8-Flash-Next-GGUF, UD-IQ1_S (37.6 GB transformer in shard 2, 28.8 GB PLE table in shard 3). Flags: --pack <pack> --native <shard 2> --ple-gguf <same shard 3, other disk> --resident-experts --max-context 32768 --kv int8.

Reproduce:

  1. Keep shard 3 on another disk, and symlink it into the model directory under its split name so the filename pattern -0000N-of-0000M.gguf matches beside --native.
  2. Pass --ple-gguf as the other disk path, not the symlinked path.

Expected: the file is one file, so it enters the native dense shard list once and the model loads.

Actual:

strata generate: native dense projections: native dense: duplicate split shard number

exit status 1, before any weights are uploaded.

Evidence: the same model with the same pack loads normally when --ple-gguf names the path the discovery already found. That isolates the cause to the string comparison rather than to the shard contents, the split metadata or the pack.

Reproduction status: reproduced locally, twice, on the hardware above.

Why this approach: compare with std::filesystem::equivalent, which resolves symlinks and mount points to the same file. The alternative of deduplicating by split.no inside NativeDense::load would also silence the check that exists to catch a genuinely wrong shard in a split family, so the comparison belongs at the point where the list is built.

Compatibility: no behaviour change when the two paths are different files. equivalent reports false through an error_code when either path cannot be stat-ed, so an unreadable path is still appended and fails later exactly as it does today.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/5326 **Author:** [@GuideboardLabs](https://github.com/GuideboardLabs) **Created:** 11/5/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr-ple-shard-identity` --- ### 📝 Commits (1) - [`7be7ab6`](https://github.com/Niko1221/Strata/commit/7be7ab6ba33519de76845eb901b2cc0de1a4ce1a) [Engine] compare the PLE shard by file identity, not by path string ### 📊 Changes **1 file changed** (+14 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/program/generate.cpp` (+14 -2) </details> ### 📄 Description A model whose PLE table is kept outside the model directory fails to load with `native dense: duplicate split shard number`, even though the shard list holds no duplicate file. `generate.cpp` appends `--ple-gguf` to the native dense shard list when its **path string** is not already in that list. The list is first filled with every shard found beside `--native` by split name. A 28.8 GB PLE table is normally kept on a larger disk, and the model directory then carries a symlink (or a bind mount, or a second mount point) to it, so the same file is discovered under one path and appended again under another. It is admitted twice, and `NativeDense::load` refuses the model on the repeated `split.no`. Problem: `--ple-gguf` naming the PLE shard by a second path to a file that is also present beside `--native` makes the model unloadable. Environment: Strata 0.1.54, local gfx1010 build of 870aedd9, Ubuntu 24.04, RX 5700 XT 8 GB, RAM 31 GiB. Model `unsloth/Qwen3.8-Flash-Next-GGUF`, `UD-IQ1_S` (37.6 GB transformer in shard 2, 28.8 GB PLE table in shard 3). Flags: `--pack <pack> --native <shard 2> --ple-gguf <same shard 3, other disk> --resident-experts --max-context 32768 --kv int8`. Reproduce: 1. Keep shard 3 on another disk, and symlink it into the model directory under its split name so the filename pattern `-0000N-of-0000M.gguf` matches beside `--native`. 2. Pass `--ple-gguf` as the other disk path, not the symlinked path. Expected: the file is one file, so it enters the native dense shard list once and the model loads. Actual: ``` strata generate: native dense projections: native dense: duplicate split shard number ``` exit status 1, before any weights are uploaded. Evidence: the same model with the same pack loads normally when `--ple-gguf` names the path the discovery already found. That isolates the cause to the string comparison rather than to the shard contents, the split metadata or the pack. Reproduction status: reproduced locally, twice, on the hardware above. Why this approach: compare with `std::filesystem::equivalent`, which resolves symlinks and mount points to the same file. The alternative of deduplicating by `split.no` inside `NativeDense::load` would also silence the check that exists to catch a genuinely wrong shard in a split family, so the comparison belongs at the point where the list is built. Compatibility: no behaviour change when the two paths are different files. `equivalent` reports false through an `error_code` when either path cannot be stat-ed, so an unreadable path is still appended and fails later exactly as it does today. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5386
No description provided.