Q8_0 produces garbage output with llama.cpp — Q4_K_M works fine

#2
by SergeyLizin - opened

Q8_0 produces garbage output with llama.cpp (PR #25342, gigachat35 arch) — Q4_K_M works fine

Reporting a reproducible issue for anyone else trying to run GigaChat3.5-432B-A28B on llama.cpp.

Setup

  • llama.cpp built from PR #25342 (custom gigachat35 architecture; not yet in master)
  • CUDA build, multi-GPU (-sm layer -ts ...), -fa on --jinja, GGUF-embedded chat template
  • Same host, same binary, same launch flags for both quants

Symptom

  • Q4_K_M (~240 GB): works correctly — coherent generation, passes our eval suite.
  • Q8_0 (~460 GB): deterministic word-salad / incoherent token stream on every configuration we tried. Not a sampling issue — output is broken from the first token.

What we ruled out (Q8 still broke with each of these controlled):

  • Chat template — used the GGUF-embedded minja-compatible template via --jinja (the original repo chat_template.jinja is full Jinja2 and doesn't parse in minja, but that fails at startup, not silently; embedded template loads fine and Q4 uses the identical path).
  • KV-cache quantization — tested with f16 KV cache, same garbage.
  • tool_choice / structured-output path — garbage on plain completion too.
  • Multi-GPU tensor split / OOM — no OOM; layers split cleanly across GPUs, VRAM fits.
  • MTP speculative decoding — disabled it entirely (draft acceptance was 0% anyway); Q8 still produces garbage without MTP.

Because the only variable that changes the outcome is the quantization level (Q4 → coherent, Q8 → garbage) while binary, host, template, and flags are held constant, this points to either a bad Q8_0 quantization of these weights or the PR #25342 code path mishandling Q8_0 specifically for this MoE/MLA architecture.

Workaround: use Q4_K_M until the Q8_0 path is fixed. If anyone has run Q8_0 coherently on llama.cpp, we'd be glad to hear the exact build/flags.

Cause is a broken partial re-upload on main, not the quant or the PR.

The Jul-13 commit 4ab92df re-quantized Q8_0 but only replaced shards 00001-00006 and 00010 — shards 00007/00008/00009 are still the Jul-6 blobs (verified: identical oids, older shards untouched). So main mixes two different quantization runs - dequant reads the old shards wrong - deterministic word-salad. Q6_K shows the same pattern.

image

ai-sage org

@SergeyLizin Hi,
Please try to rebuild binary with latest changes (3edef37e8a9f0a9cb77232e283c2e9be0cb26d2d). There was change yesterday in norms, norms presented not in all gguf files

3edef37 ("fix scale") targets the new format, so it breaks the old be1eac4 quant (salad) and still can't fix main (mixed).

The Jul-13 4ab92df re-quant only replaced Q8_0 shards 00001-00006 and 00010 — shards 00007/00008/00009 are still the Jul-6 blobs (their LFS oids are byte-identical to revision be1eac4…). So main mixes two quantization runs, norm/scale tensors inconsistent across shards, deterministic word-salad. No build can reconcile old- and new-format shards.

Only working combo: revision be1eac4fd62a08abdc2d0d14c3fa3bf3c6ff865a + a pre-3edef37 binary.

@ai-sage — please re-upload the full Q8_0 / Q6_K in one consistent pass; the upload-large-folder run left shards 00007-00009 stale.

ai-sage org

@SergeyLizin
The upload isn't partial, shards 00007-00009 contain no norm tensors, so they legitimately weren't re-uploaded; there's nothing inconsistent about them. Every tensor the norm change touches lives in the shards that were replaced.
We ran the current main Q8_0 with a clean 3edef37 build on 8×H100 - it generates correctly (plain chat, math, tool calls). So main + 3edef37 is a valid, working pair. Problems comes from a weights/binary generation mismatch: the current weights fold the norm +1 into the tensors, so a pre-3edef37 (or stale incremental) build re-applies the old runtime +1 -> rms·(w+2) -> exactly this output. Please do a clean rebuild at 3edef37 (fresh build dir; confirm llama-server actually relinked) against the current revision and it'll be coherent. If it still isn't after a clean build, send your exact commit hash + build flags and we'll look

Thanks, that's a clear diagnosis and it matches the symptom exactly. You're right — I was wrong to read the untouched 00007–00009 shards as a partial upload; if they carry no norm tensors there's nothing to re-upload, and main is consistent.

My builds were incremental against an existing build dir, so the stale-binary / weights mismatch you describe (old runtime +1 re-applied on top of already-folded norms → rms·(w+2)) is almost certainly what produced the word-salad. That also explains why the only coherent combo I'd found was an older weights+binary pair.

I'll do a clean rebuild at 3edef37 — fresh build dir, --no-cache, and I'll confirm llama-server actually relinked — against the current revision, and report back. If it's still incoherent after that, I'll send the exact commit hash + full build flags.

Appreciate the help.

Sign up or log in to comment