[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

Closed
opened 2026-11-04 01:45:22 +07:00 by bsakaguchi · 3 comments
Owner

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), generate and --serve on 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, with STRATA_MMVQ_IL=0 or unset. The same GGUF runs fine with the bundled llama.cpp (third_party/llama.cpp, CPU build) — coherent output, both English and Chinese.

Environment

  • 4× NVIDIA GeForce RTX 4090 (24 GB, sm_89), EPYC 9274F, 566 GB RAM, Ubuntu 24.04
  • Driver: kernel module 580.173.02, user space matched to 580.173.02 (the 580.178 update is loaded but the module cannot be reloaded without a reboot; libcuda/libnvidia-ml are aligned to 580.173.02 for all runs below)
  • CUDA toolkits: /usr/local/cuda 12.2 and 12.8
  • Strata: git main at fb58e0d (0.1.41), ./setup.sh --yes --family qwen --model IQ3_XXS --vision gpu --gpus 0,1,2,3 --data-dir ... --no-start --source modelscope
  • Engine compiled locally, CMAKE_CUDA_ARCHITECTURES=89

What happens

$ engine/strata --gpu 0 --pack .../packs/iq3_xxs --native .../IQ3_XXS-00001-of-00002.gguf \
    --ple-gguf .../IQ3_XXS-00002-of-00002.gguf --expert-profile data/expert-profile.bin \
    --expert-cache auto --prefill 2048 --spec 2 --max-context 4096 --kv int8 \
    --tokens "760,62865,1020,47358,284" --max-new 8
prompt  : 760 62865 1020 47358 284
output  : 0 0 0 0 0 0 0 0

--serve shows 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

  • GGUF data: sha256 of both shards matches Hugging Face exactly (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.)
  • Quantization declarations: the pack's native_experts.txt per-layer gu_type/d_type match 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).
  • Kernels: ctest 97/101 pass on this machine, including mmvq_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.
  • Layer split: single GPU (--gpu 0) reproduces it; so does 4-GPU split [12,24,36].
  • MMVQ IL path: STRATA_MMVQ_IL=0 — unchanged.
  • Upstream: local HEAD is the current main tip (fb58e0d), nothing to pull.

The suspicious lead: the native head's type

Single-GPU runs print:

strata generate: experimental native Q5_K head, 437043200 bytes, in 0.1 s

But this GGUF's output.weight is 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.

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), `generate` and `--serve` on 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, with `STRATA_MMVQ_IL=0` or unset. The **same GGUF runs fine with the bundled llama.cpp** (third_party/llama.cpp, CPU build) — coherent output, both English and Chinese. ### Environment - 4× NVIDIA GeForce RTX 4090 (24 GB, sm_89), EPYC 9274F, 566 GB RAM, Ubuntu 24.04 - Driver: kernel module 580.173.02, user space matched to 580.173.02 (the 580.178 update is loaded but the module cannot be reloaded without a reboot; libcuda/libnvidia-ml are aligned to 580.173.02 for all runs below) - CUDA toolkits: /usr/local/cuda 12.2 and 12.8 - Strata: git main at fb58e0d (0.1.41), `./setup.sh --yes --family qwen --model IQ3_XXS --vision gpu --gpus 0,1,2,3 --data-dir ... --no-start --source modelscope` - Engine compiled locally, `CMAKE_CUDA_ARCHITECTURES=89` ### What happens ``` $ engine/strata --gpu 0 --pack .../packs/iq3_xxs --native .../IQ3_XXS-00001-of-00002.gguf \ --ple-gguf .../IQ3_XXS-00002-of-00002.gguf --expert-profile data/expert-profile.bin \ --expert-cache auto --prefill 2048 --spec 2 --max-context 4096 --kv int8 \ --tokens "760,62865,1020,47358,284" --max-new 8 prompt : 760 62865 1020 47358 284 output : 0 0 0 0 0 0 0 0 ``` `--serve` shows 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 - **GGUF data**: sha256 of both shards matches Hugging Face exactly (`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.) - **Quantization declarations**: the pack's `native_experts.txt` per-layer `gu_type/d_type` match 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). - **Kernels**: `ctest` 97/101 pass on this machine, including `mmvq_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. - **Layer split**: single GPU (`--gpu 0`) reproduces it; so does 4-GPU split `[12,24,36]`. - **MMVQ IL path**: `STRATA_MMVQ_IL=0` — unchanged. - **Upstream**: local HEAD is the current main tip (fb58e0d), nothing to pull. ### The suspicious lead: the native head's type Single-GPU runs print: ``` strata generate: experimental native Q5_K head, 437043200 bytes, in 0.1 s ``` But this GGUF's `output.weight` is **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.
Author
Owner

@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-residual on the same minimal run:

mixed dumped             /tmp/M.bin (n_embd 2560, rms 0, mean|.| 0)
residual dumped          /tmp/R.bin (4 x 2560, nonfinite 0, mean|.| 0, max|.| 0)

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):

run result
--gpu 0 (single) token 0
4-GPU split [12,24,36] token 0
STRATA_MMVQ_IL=0 token 0
--no-fused-gr hangs at the verify window (separate issue?)
--no-ple refused (native mode requires --ple-gguf)
--keep-canonical (single GPU) exits silently after the PCIe probe

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_embd mapped-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 reads token_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 fb58e0d with 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.

<!-- gh-comment-id:6097114814 --> @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-residual` on the same minimal run: ``` mixed dumped /tmp/M.bin (n_embd 2560, rms 0, mean|.| 0) residual dumped /tmp/R.bin (4 x 2560, nonfinite 0, mean|.| 0, max|.| 0) ``` 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): | run | result | | --- | --- | | `--gpu 0` (single) | token 0 | | 4-GPU split `[12,24,36]` | token 0 | | `STRATA_MMVQ_IL=0` | token 0 | | `--no-fused-gr` | **hangs** at the verify window (separate issue?) | | `--no-ple` | refused (native mode requires --ple-gguf) | | `--keep-canonical` (single GPU) | exits silently after the PCIe probe | 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_embd` mapped-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 reads `token_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 fb58e0d with 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.
Author
Owner

@wannagoxuf commented on GitHub (Oct 10, 2026):

Root cause found and fixed — the engine was innocent.

The pack's dense.bin was generated by tools/iq_pack.py from 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.weight has 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 lo at 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); R is 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.py could verify the source shard (size + sha256 from the HF etag) before converting, so a pack can never be minted from a partially-written shard.

<!-- gh-comment-id:6098289418 --> @wannagoxuf commented on GitHub (Oct 10, 2026): Root cause found and fixed — the engine was innocent. **The pack's `dense.bin` was generated by `tools/iq_pack.py` from 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.weight` has 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 `lo` at 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); `R` is 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.py` could verify the source shard (size + sha256 from the HF etag) before converting, so a pack can never be minted from a partially-written shard.
Author
Owner

@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.

<!-- gh-comment-id:6156228584 --> @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](https://github.com/Niko1221/Strata/releases/tag/v0.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.
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#725
No description provided.