mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4449] [Engine] A Qwen3.8-Flash-Next GGUF with its NextN (MTP) block inside (block_count 49, nextn_predict_layers 1) doesn't load: iq_pack writes layer 48, the engine wants 48 layers #1985
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#1985
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 @talisp on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4449
In short: a Qwen3.8-Flash-Next fine-tune published as one GGUF with its MTP layer inside (the way llama.cpp writes NextN models) doesn't start on 0.2.7. The pack tool writes that layer as a 49th expert layer, and the engine wants exactly 48 layers in the header and in two per-layer lists. With a copy whose header leaves the MTP layer out (the weights untouched), it runs at 133-136 tok/s here, like Unsloth's files. Its own MTP layer drafts better than the base model's (79.5% vs 71.5% accepted), so it would be nice if Strata could use it from the file.
Area:
[Engine](andtools/iq_pack.py)Desktop app, Terminal or source? Release 0.2.7 (control 0.1.52, engine 0.1.52 for CUDA 12), started from the terminal (
serve/server.py --engine strata)Reproduction status: Reproduced locally, every start
Strata version: 0.2.7 (
strata --version: 0.1.52)Graphics card, memory and system: 1× NVIDIA L40S-48Q (vGPU, 48 GB, sm_89), Xeon Platinum 8580 VM (32 vCPUs), ~504 GB RAM, Ubuntu 22.04, Linux 6.8.
Model:
CYBER-FROST-3.8-PS-GUFF-Q5_K_M.gguf(peasantsmith/CYBER-FROST-3.8-PS-GUFF @32867bb, 112.5 GB, one file), a cybersecurity fine-tune of Qwen3.8-Flash-Next. Architectureqwen4exp, like Unsloth's GGUFs, but it keeps the NextN/MTP block in the file, the way llama.cpp writes one:Unsloth's
Qwen3.8-Flash-Next-UD-Q4_K_XL(which runs fine here: ~134 tok/s decode) hasblock_count 48, nonextn_predict_layersand 48compress_ratios.What happens
Three stops, one after the other, as we worked around each:
tools/iq_pack.py --gguf <file> --out <pack> --compat-bf16finishes (rc 0), but writes a line for layer 48 intonative_experts.txt(v3 header), and the engine refuses it:block_count 48,nextn_predict_layers 0and has noblk.48.*entries (tensor data byte-identical, offsets unchanged), it stops at the per-layer list:blk.48) instead of the base model's, drafts are accepted more often (79.5% against 71.5%), though decode stays about the same.--mtpof the 0.1.45 setup (base Qwen)The header-only copy we used:
block_count48,nextn_predict_layers0,compress_ratiosandrecurrent_layerscut to their first 48 entries, the 32blk.48.*tensor entries dropped from the table (their bytes stay in the file, unreferenced). Every other tensor's bytes checked identical to the original's.What we'd suggest
nextn_predict_layersand takeblock_count - nextn_predict_layersas the layer count (and the first that many entries of the per-layer lists), as llama.cpp does for its NextN models.iq_pack.py, skip the layers at and aboveblock_count - nextn_predict_layersinnative_experts.txt(or write them where--mtpcould use them: the fine-tune's own NextN would draft better than the base model's, which--mtpneeds today).For reference, Project Maya (a sibling project whose Qwen engine grew from Strata's code) loads this file as is: its pack writes no expert line for layer 48 and its MTP extractor takes the draft layer out of
blk.48(maya mtp: draft layer loaded, 1097 MiB of VRAM (experts 675, dense 109)). On the same file and box it decodes slower than Strata (69-84 tok/s; its Qwen engine is older), but it does start.We searched the issues for
nextn,block_count,native_expertsand the model name, and found nothing on this.Command line
env
STRATA_ROUTE_TAIL_SKIP=0. The same flags with the Unsloth UD-Q4_K_XL pack run normally.@otaliptus commented on GitHub (Oct 28, 2026):
Same file shape, a second model, another backend: bottlecapai/ThinkingCap-Qwen3.8-Flash-Next-GGUF (IQ4_XS, 8 shards, 90 GB; the file #3890 asks for), on the SYCL engine (Intel Arc Pro B70, built from source). It stops on v0.1.45 (2026-10-23) and on v0.2.7.1 / engine 0.1.53 (re-run today). What this adds to the report above:
The file.
qwen4exp.block_count 49,nextn_predict_layers 1, 32blk.48.*tensors spread over shards 3-7, 49-entryattention.compress_ratiosandrecurrent_layers. Unlike the all-zero list above, this one is a real layer split withcompress_ratios[48] = 4(the head is a full-attention block), so the engine stops one check earlier. The three stops, in order, as each was worked around:Line 1 is the packer's 49th row (as above). Line 2 is what the engine says to the original shards once the pack is right (0.1.45 and 0.1.53 both). Line 3 is a third stop the report above did not reach, because its header copy also dropped the
blk.48.*entries from the tensor table: with the header trimmed to 48 layers but the tensor entries kept, the native-dense loader's layer filter has no upper bound by default (layer_hi = -1,native_dense.hpp:26,native_dense.cpp:268) and looks the head's quantized tensors up in the canonical table.Where it sits in v0.2.7.1, from reading the code (I have not built a fix):
include/strata/core/family_layout.hpp:64:num("nextn_predict_layers", g.n_mtp_layers)is read only insideif (family == Qwen35Moe). Forqwen4exp,n_mtp_layersstays 0 and line 73'sg.n_layers = block_count - g.n_mtp_layersgives 49. The rest follows: the per-layer array check ininclude/strata/artifact/gguf_reader.hpp(thecompress_ratiosblock, about line 768) runs over 49 entries, and the compiled-geometry comparison (family_layout.hpp, thefieldstable) sees 49 against 48. The canonical-layout loop at line 270 already runs ton_layers + n_mtp_layersand thenextn.*names exist (lines 212-215) for qwen35moe.nextn_predict_layersfor qwen4exp too; let the per-layer arrays carryn_layersorn_layers + n_mtp_layersentries and check the trunk; bound the dense loader's filter byn_layers(or skipblk.<l>withl >= n_layers). The{"the in-file MTP layers", g.n_mtp_layers, c.n_mtp_layers}comparison would then have to allow 1 for qwen4exp while--mtpkeeps supplying the draft layer from outside, as today.Packer. The
iq_pack.pychange I have run from 0.1.45 through 0.2.7.1 (the packer's unit tests pass):model_layers() = block_count - nextn_predict_layers, the head's block left out ofnative_experts.txtand of the dense index: patch. Writing the head where--mtpcould use it, as suggested above, would be the better form of it.Workaround without touching the engine: a script that rewrites the shards as the 48-layer trunk (headers fixed,
split.tensors.countcorrected, the 32 head tensors dropped, every kept tensor sha256-verified; 5 minutes for 90 GiB), packed with--compat-bf16and served with the base model's--mtpruntime (the vendor card says the head is the base model's, unchanged). On the B70 that loads and runs: 35 tok/s decode with IQ4_XS experts and 35 GiB of them mirrored in RAM, 47 of 87 drafts accepted on a short answer. Measurements against the base model are in our notes; the three stops are written up in docs/07.Hardware: Intel Arc Pro B70 32 GB · 62 GB RAM · Debian 13 · engine built from source in the strata-sycl-dev image; the config
setup_intel.pywrites for the IQ3_S base, with the pack and the shards swapped.@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.