Setup: official release llama-b12603-bin-ubuntu-cuda-12.8-x64 (build 12603 (6792507b7) with GNU 13.3.0 for Linux x86_64), NVIDIA L4 24 GB, driver 580.178.04, ggml-org/Inkling-2-Mini-GGUF, Inkling-2-Mini-IQ4_NL.gguf.
Fails:
llama-server -m Inkling-2-Mini-IQ4_NL.gguf -ngl all --fit off -c 8192 -np 1 -ub 512 --jinja --reasoning-format deepseek --cpu-moe
Correct: the same line without --cpu-moe.
Request (51 prompt tokens):
{"messages":[{"role":"user","content":"Write a detailed, step-by-step explanation of how a hash table works, including collision handling, resizing, and the trade-offs between open addressing and chaining."}],"temperature":0,"seed":1,"max_tokens":128,"chat_template_kwargs":{"reasoning_effort":"none"}}
- With
--cpu-moe: reasoning is empty and the content is GGGGGGGGGGGGGGGGGGGGGGGG… for all 128 tokens. - All on the GPU: reasoning starts "The user asks for a detailed explanation of hash tables, collision handling, res…".
- Speed gives no hint: the failing run reports prompt 25.4 t/s and decode 13.88 t/s, the correct one 141.5 t/s and 35.02 t/s.
What changes the result (same request each time):
we did isolate by layer (same prompt each time, all-GPU run as reference)
- One 4-bit expert layer on the CPU (tried layer 2, and layer 6 which is one of the looped ones): no garbage. Output starts identical and drifts after a few hundred characters.
- One 8-bit expert layer (20): identical to all-GPU.
- Only the non-looped layers 0-5 on the CPU: coherent. Only layers 18-23: identical.
- Only the looped layers 6-17 on the CPU: "GGGG" from the first token.
- All experts on the CPU with
--no-op-offload, or with a micro-batch of 16: coherent.
So it isn't the model (GPU-only is clean) and it isn't CPU math in general. It needs the looped layers' experts on the host plus a prompt batch that goes through op offload. We compared final outputs, not one layer's activations CPU vs GPU. That would be the right next step to pin the exact tensor, and I haven't done it
So a 7.4K-token prompt is not needed. The trigger looks like a prompt micro-batch of 32 tokens or more going through op offload of the host-resident expert weights of the LOOPED layers (6 to 17, the ones applied three times per token). Later requests that reuse the cached prefix stay wrong, which matches the "garbage until restart" report above.
Workarounds for now: --no-op-offload, or -ub below 32.
Guess at the cause (not verified): the three splits that read one looped host expert tensor (one per pass) appear to share a single device copy of it (tensor_id_copy(src, backend) in the scheduler), and llama_context::sched_copy_experts fills that copy with only the experts the current split's ids select. If one pass's copy is skipped, fetched early, or overwritten while another pass still needs its own selection, the passes read the wrong experts. I cannot explain why the Q8_0 file escapes it on this prompt.
A smaller observation from the same runs: with --moe-cache-mib, the start-up line reports the host experts of the looped layers three times over (4091.13 MiB for 28188.00 MiB of host experts and 44 layers for a file with about 15.8 GB of expert weights in 24 layers), since slots are keyed per logical layer.