mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5248] [Other] Accept Unsloth's swap-in engram tables (BF16/Q8_0/Q5_1/IQ4_NL) instead of only the bundled one #3122
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#3122
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?
Originally created by @simlu on GitHub (Nov 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5248
Area
[Other] (anything else, including setup and installation)
What do you want to do?
Unsloth now publishes the Qwen3.8-Flash-Next n-gram / PLE table as standalone GGUFs
(https://huggingface.co/unsloth/Qwen3.8-Flash-Next-GGUF/tree/main/engram), so a quant can be
run with a different table than the one it ships with ("Mix N Match Engrams":
https://unsloth.ai/docs/models/qwen3.8-next#mix-n-match-engrams). The docs page even names the
combinations:
UD-Q4_K_XLwith the Q8_0 table, and — the case I need —Q8_0/UD-Q5_K_XL/UD-Q6_K_XLwith the BF16 table. I want Strata to support picking that table as a first-classoption instead of only the table the chosen quant bundles.
Who needs it and why:
Q8_0(orUD-Q5_K_XL/UD-Q6_K_XL) who wants the lossless n-gram table.Those three sets all bundle the Q8_0 table (setup.py's pins show shard
...-00003-of-00006is the same bytes, size 54,400,261,312 and SHA-256 34efd79a..., in all three). Unsloth's
engram/README measures that table at relative RMSE 0.0053 vs the checkpoint; BF16 is 0 (the
checkpoint's own table). The only file that ships the BF16 table today is the full BF16 model
(355 GB) — a table swap gets it on a 236 GB file set instead.
shard — Unsloth's own example). The table slot per quant is fixed (engram README): 3 of 6 for
UD-Q5_K_XL/UD-Q6_K_XL/Q8_0, 4 of 4 for UD-Q2_K_XL/UD-IQ3_XXS/UD-Q3_K_XL/UD-IQ4_XS/UD-Q4_K_XL,
3 of 3 for UD-IQ1_S/UD-IQ1_M/UD-Q2_0/UD-IQ2_XS, 3 of 8 for BF16.
The good news: nothing on the engine side is missing.
src/kernels/ngram.cpp'skPleFormatsalready reads BF16 ("the checkpoint's own table at full precision, 320-byte rows; self-describing"),
Q8_0, Q5_1, Q5_0, Q4_0 and IQ4_NL, and
ple_format_for_type()picks the format from the tabletensor's GGUF type. With a native multi-shard set the engine finds the table shard itself by tensor
name (
per_layer_token_embd.weight,src/program/generate.cpp, "--ple-gguf defaults to the shardthat holds the PLE table"). I verified this at tag v0.2.9 (docker image
0.2.9-cuda13, engine0.1.55) and it is unchanged on main apart from the #4671 memlock fix.
What is missing is the installer/pinning layer around it. Proposal (opt-in per CONTRIBUTING;
nothing on the default path changes):
strata launch(and a docker env, e.g.PLE_TABLE: bf16|q8_0|q5_1|iq4_nl,default = the quant's bundled table). When a non-default table is chosen, setup fetches the
matching
engram/Qwen3.8-Flash-Next-engram-<TYPE>.gguf_filefromunsloth/Qwen3.8-Flash-Next-GGUF, verifies it against pinned size + SHA-256, stampssplit.no/split.countfor the chosen quant's slot (exactly the two uint16 header valuesengram/set_split.pyrewrites; without the stamp the loader refuses withinvalid split file idx), names it as the quant's table shard, and keeps it as that set's table from then on.Suggested pins from the Hub's LFS pointers (fetched 2026-11-04):
(and in the finish-mark line next to
sha256 ...), so "Check Files" and the step-5 verificationcheck the table against the chosen pin instead of the bundled quant's pin — today the only
way a swapped shard passes is
verify_sha256(..., own=True)'s generic "may be another versionor a fine-tune, so check a few answers" warning, which reads like a suspected broken file.
download_gb(MODELS["Q8_0"] = 188.2 -> 236.2 with BF16), the free-diskestimate in step 5, and the automatic
--ple-io ramrule (ram >= MODELS[model].ram_gb + table_gb + 16) should use the chosen table's size. The engine part already reads the real file;the setup-side numbers do not follow a swap. A one-line plan/launch note like "n-gram table:
BF16 (102.4 GB), read from SSD" would make the RAM consequence visible before the first start.
--model-path/ "files already here" half: when a shard that holdsper_layer_token_embd.weightparses as a whole GGUF but its tensor type is one of
kPleFormats(and the size matchesrows x row-bytes for that type), say "n-gram table: BF16 (not this quant's bundled Q8_0 table)"
instead of the generic wrong-SHA warning, and let a finish mark stick for it — today that path
writes no mark, so a
--gguf-dirtable with its own digest is re-hashed on every launch(102 GB each time), while a stale
.donecarrying the old bundled hash is trusted forever.Docs: a short section in docs/QUANTS.md (or the engram equivalent) + the
PLE_TABLErow indocs/DOCKER.md's env table.
Trade-offs I see: one extra pinned artifact per table type (4 files, same repo, LFS oids above);
a table mismatch can no longer be caught by SHA alone, so the type/rows/size pre-check matters;
and the
--ple-io ramheadroom question for BF16 on 256 GB PCs (136 + 102.4 + 16 GB threshold —right at the edge), which setup already decides per machine, so no new default is proposed.
Alternative if a full option is out of scope: officially document the manual swap (stamped file
renamed into the set +
--model-path) as supported in DOCKER.md/QUANTS.md, and fix the two roughedges above (the "possibly damaged" wording for a recognized table type, and the missing finish
mark that causes the 102 GB re-hash on every launch).
What do you do today instead?
I assemble the mixed set by hand, exactly as Unsloth's engram/README prescribes, and hand it to
Strata through
--model-path/ dockerMODEL_PATH:then point the container at the folder (
MODEL_PATH=/data/models/qwen38/...,MODEL: Q8_0,FAMILY: unsloth). Per the source (see above),check_shards' exact-single-tensor-length rulepasses for the standalone table (self-consistent: 192 B header + 320,001,536 x 320 B =
102,400,491,712), and the table format is read from the tensor type at load.
Three rough edges on the installer side:
.donemark of the bundled shard: its pinned-hash early-return makes setuptrust the swapped 102 GB file forever (no hash, no warning — but "Check Files" is then blind to
the real table file).
verify_sha256(own=True)'s warning path on every container start:"...is not the published file (SHA-256 fd191d..., expected 34efd7...) but it is a complete GGUF
file, so Strata uses it as it is" plus a full 102 GB re-hash on every launch, because that path
never writes a finish mark (a
:romodel folder makes it worse; Control 0.2.10 keeps marks forread-only model folders outside the folder —
b3c39091— but the current 0.2.9-cuda13 imagepredates it).
--ple-io ramauto-decision silently flips on the swap: the Q8_0 table needs136 + 54.4 + 16 = 206.4 GB MemTotal (inside this box's budget -> table pinned in RAM), the
BF16 table needs 136 + 102.4 + 16 = 254.4 GB (above it -> streamed from NVMe), with no plan
line saying the table changed residence.
Reproduction / verification status, per CONTRIBUTING: the engine-reads-BF16 and installer-behavior
claims above are verified by reading the source at tag v0.2.9 and origin/main
(
src/kernels/ngram.cppkPleFormats+ple_format_for_type;src/program/generate.cppPLE-sharddiscovery;
setup.pyverify_sha256own path,check_shards#657,--ple-io ramrule,MODELS["Q8_0"]pins;docker/entrypoint.shMODEL_PATH->--model-path). The runtime boot ofthis mix on my rig (docker
ghcr.io/niko1221/strata:0.2.9-cuda13, engine 0.1.55, Linux,4x RTX 3090 24 GB, 256 GB RAM,
Q8_0+ BF16 table,CONTEXT=262144,KV=fp16,VISION=on) isnot run yet — I will attach the first-boot log and the exact setup warning lines to this issue
when I do.
@github-actions[bot] commented on GitHub (Nov 4, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Nov 4, 2026):
Thanks, this follows the format now.