mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1843] Engine outputs only token 0 on RTX 4090 (sm_89, locally built 0.1.41) with IQ3_XXS GSQ-RCO; bundled llama.cpp runs the same GGUF fine #725
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#725
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 @wannagoxuf on GitHub (Oct 10, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1843
Summary
On a locally built 0.1.41 engine (sm_89),
generateand--serveon Qwen3.8-Flash-Next IQ3_XXS (ISTA-DASLab GSQ-RCO) output only token id 0 for every position, on one GPU and on a 4-GPU layer split, withSTRATA_MMVQ_IL=0or unset. The same GGUF runs fine with the bundled llama.cpp (third_party/llama.cpp, CPU build) — coherent output, both English and Chinese.Environment
fb58e0d(0.1.41),./setup.sh --yes --family qwen --model IQ3_XXS --vision gpu --gpus 0,1,2,3 --data-dir ... --no-start --source modelscopeCMAKE_CUDA_ARCHITECTURES=89What happens
--serveshows the same through the API (every reply is!!!!…, i.e. token 0 repeated). Speeds are normal (prefill ~7-11k tok/s at 32K, decode ~200 tok/s single GPU).What I ruled out
219ea929…,316b46f3…). (The download was damaged in transit by CDN range-response mismatches; I verified and repaired every 512 MB segment against the origin, then re-verified the full-file hashes.)native_experts.txtper-layergu_type/d_typematch the GGUF tensor headers (the GSQ-RCO files use per-layer mixed types: IQ2_XS / IQ2_XXS / IQ4_NL / Q2_0 / IQ3_XXS / IQ3_S / Q5_K / Q4_K / IQ4_XS; e.g. layer 0: ffn_up/gate_exps IQ2_XS, ffn_down_exps IQ4_NL).ctest97/101 pass on this machine, includingmmvq_il_parity(bitwise, all cases),kv_stream_parity,qsa_*_parity,gdn_rec_parity,gemm_bf16_parity,dequant_s2_parity,iq_parity,ple_reader_selftest. The 4 failures are missing-test-data issues (ple_parity wants a Q2_0 shard 2; expert_parity/pool_test want pack/full/experts.bin; platform_memory_test is RAM-state dependent), not engine mismatches.--gpu 0) reproduces it; so does 4-GPU split[12,24,36].STRATA_MMVQ_IL=0— unchanged.fb58e0d), nothing to pull.The suspicious lead: the native head's type
Single-GPU runs print:
But this GGUF's
output.weightis BF16 (2560 × 248320 → ~1.27 GB as BF16; 437043200 bytes is the Q5_K layout size). I did not find a place where a BF16 output.weight should be loaded as a Q5_K-layout native head. In the 4-GPU case the head takes the canonical path and the output is still token 0, so this may be one of two independent problems — or a red herring for the split case.Side finding
--no-fused-gr(single GPU) hangs the generate run at the verify-window stage (no output, no exit; killed after 10 min). The fused path itself runs and completes.Request
Pointers on where to look next (or an existing known issue) would help. Happy to run additional diagnostics, A/B flags, or provide full logs — the machine is reproducible in minutes.
@wannagoxuf commented on GitHub (Oct 10, 2026):
Additional diagnostics that narrow this down considerably:
The residual stream is zero from the very beginning. With
--dump-mixed/--dump-residualon the same minimal run:M (post-attention residual, n_embd) is exactly 0.0 for every element; R (after all 48 layers) is all zeros plus two denormals. No NaNs anywhere. So the pipeline dies before/at the first attention: the embedding → PLE/layer-1 path produces an all-zero residual, then every layer propagates zeros, the head maps zeros to constant logits, and greedy argmax returns token 0 forever.
Compiler version is not the cause (unlike #892): rebuilding the engine with CUDA 12.2 (V12.8 was the original) reproduces the identical
output: 0 0 0 …on--gpu 0. The GPU itself is fine — the bundled llama.cpp with CUDA 12.8 runs this exact GGUF correctly on the same card, and my CPU llama.cpp build does too.Ablation matrix (all reproduce token-0 output unless noted):
--gpu 0(single)[12,24,36]STRATA_MMVQ_IL=0--no-fused-gr--no-ple--keep-canonical(single GPU)The fact that M is exactly zero (not NaN, not garbage) points at the embedding lookup or the initial-residual assembly reading zeros — e.g. the
token_embdmapped-host path (IQ3_S in mapped host memory (260 MiB)) or the hyper-connection stream setup — rather than a dequant error. The embedding itself is healthy: llama.cpp readstoken_embd.weight(IQ3_S) from the same shard correctly.Machine: 4× RTX 4090 (sm_89), EPYC 9274F, driver 580.173.02 (user space matched), CUDA toolkits 12.2/12.8. Engine built from
fb58e0dwith both 12.2 and 12.8 nvcc (-DCMAKE_CUDA_ARCHITECTURES=89 -DSTRATA_ENABLE_CUDA=ON -DCUDAToolkit_ROOT=... -DSTRATA_GGML_DIR=<bundled llama.cpp>), Setup ran with--source modelscope(HF unreachable from this network). Happy to test patches — the run takes ~30 s to reproduce.@wannagoxuf commented on GitHub (Oct 10, 2026):
Root cause found and fixed — the engine was innocent.
The pack's
dense.binwas generated bytools/iq_pack.pyfrom the corrupted shards before they were repaired (pack written 15:36, repaired shards 17:59/18:23). The BF16 tensors inside it contain thousands of garbage values — e.g.blk.0.hc_attn_down.weighthas 28357 NaNs and 188 Infs out of 3.3M elements (max |v| 3.4e38) — while the same file's F32 tensors were fine, and the two GGUF shards hashed clean against Hugging Face, which is why everything pointed away from the data.The failure path: poisoned hc_down weights → the hc-down GEMM emits all-NaN
loat layer 0 → the residual stream is NaN from layer 1 on → all-NaN logits → greedy argmax returns token 0 forever. Probed it step by step (embed gather → initial R → per-layer → per-op within layer 0);Ris healthy entering layer 0 (sum 10.6, zero NaNs) and NaN by layer 1.Regenerating the pack from the repaired shards fully resolves it: correct multi-lingual output, 6.8K tok/s prefill / 86-120 tok/s decode on the 4×4090 box.
Also ruled out along the way (may help others hitting this): driver mismatch (reproduces with a fully aligned 580.178 stack), CUDA toolkit version (identical with 12.2 and 12.8 builds, both vs. the 13.0-capable driver), H2D transfers (5000 randomized small-copy integrity checks clean), and the mapped-host-memory embedding read (sample reads bit-exact). llama.cpp ran the same GGUF correctly on the same card because it reads the original shards, not the derived pack.
Suggestion:
iq_pack.pycould verify the source shard (size + sha256 from the HF etag) before converting, so a pack can never be minted from a partially-written shard.@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.