mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5479] [Engine] allow reusing standalone PLE n-gram shards across different quant splits #5454
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5454
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/5479
Author: @code-martin
Created: 11/7/2026
Status: 🔄 Open
Base:
main← Head:feature/reuse-ple-shards📝 Commits (1)
59f6da5fix(model): allow reusing standalone PLE n-gram shards across different quant splits📊 Changes
3 files changed (+13 additions, -4 deletions)
View changed files
📝
include/strata/artifact/gguf_reader.hpp(+4 -0)📝
src/core/native_dense.cpp(+7 -4)📝
tools/iq_pack.py(+2 -0)📄 Description
Problem and result
The 28.8 GB IQ4_NL n-gram embedding table (
per_layer_token_embd.weight) in Qwen3.8-Flash-Next is mathematically identical across the entire model family:Q2_0,IQ2_XS,IQ3_XXS,IQ3_S: shard 2)UD-IQ1_M,UD-Q2_0,UD-IQ2_XS: shard 3)UD-Q2_K_XL,UD-IQ3_XXS,UD-Q3_K_XL,UD-IQ4_XS-v31: shard 4)They differ solely in the GGUF split header metadata (
split.countandsplit.no).Before this change, attempting to hardlink or share an existing 28.8 GB PLE shard across different split layouts (for instance, reusing an ISTA-DASLab shard 2 for any Unsloth 3- or 4-shard quant) caused
GgufModel::validate_split,NativeDense::load, andtools/iq_pack.pyto abort with split validation errors:GGUF: <shard> does not declare itself shard K of N of this model (split.count / split.no / split.tensors.count)or
native dense: additional shard must match the architecture-validated first shard's split metadata.Users testing different quantization levels had to either re-download the identical 28.8 GB file for each model or clone 28.8 GB on disk to run binary header-patching scripts (
set_split.py).After this change, any standalone PLE shard can be shared or hardlinked across all 2-, 3-, and 4-shard variants, saving 28.8 GB of bandwidth and disk space per tested model.
Related discussion
None.
Approach
Exempt shards containing solely
per_layer_token_embd.weightfrom strictsplit.countandsplit.noequality checks across the stack:include/strata/artifact/gguf_reader.hpp(GgufModel::validate_split): bypass split counter validation when the shard holds exactly one tensor namedper_layer_token_embd.weight.src/core/native_dense.cpp(NativeDense::load): bypass split metadata validation and duplicate shard number rejection for standalone PLE shards.tools/iq_pack.py(check_split): ignore split count mismatch for single-tensor PLE shards during pack generation.All primary model shards (shard 1 with metadata, attention, SSM, and expert shards) remain strictly validated against each other.
Validation
Passed:
5de8b5dbf89409acc39468decafd4a4a95b13c29d88a14b0356107897829ec36).python tools/iq_pack.py --gguf ... --compat-bf16successfully prepares the pack when shard 4 is a hardlink to ISTA-DASLab shard 2 (split.count=2vssplit.count=4), exiting 0.Failed:
Not run:
--layer-split).Limits
Applies strictly to shards that contain only
per_layer_token_embd.weight. Shards carrying routed experts, attention projections, or any other tensors alongside PLE remain subject to exact split metadata alignment.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.