Skip to content

kimi-k3 sglang: disable CUDA graph capture (fix deep-context MoE corruption) - #95

Merged
youngjeong46 merged 1 commit into
mainfrom
fix-sglang-moe-capture-corruption
Aug 19, 2026
Merged

kimi-k3 sglang: disable CUDA graph capture (fix deep-context MoE corruption)#95
youngjeong46 merged 1 commit into
mainfrom
fix-sglang-moe-capture-corruption

Conversation

@martin-cala1

Copy link
Copy Markdown
Collaborator

Fixes a silent output-corruption bug on the Kimi K3 SGLang recipe.

Symptom: in long warm-cache sessions (300k+ ctx, hundreds of turns) the model silently produces repeated words, control-token leakage (<|close|>…<|sep|>), and ASCII→CJK character substitution — well-formed text with wrong content. Confirmed on a production endpoint (~25%, Fisher p=3.3e-7). Not reproducible with cold one-shot probes, which is why it evaded earlier validation.

Root cause: the MXFP4 MoE path is unsafe under CUDA graph capture on this day-0 SGLang/ROCm stack — ROCm/aiter#3632 (MXFP4 MoE unsafe under capture), sglang#18002 (capture changes results, 0.10→0.97 with capture off), sglang#27194 (flydsl MoE reduce reads uninitialized memory). Non-deterministic across pod restarts.

Fix: ship --disable-cuda-graph (eager decode) and drop AITER_FLYDSL_FORCE. Keep fp8 KV (not implicated; bf16 would halve the KV pool / long-context depth). Documented in the manifest + README with a bold deep-context-corruption gotcha.

Trade-off: eager decode is slower than graph-replayed decode. Re-enable graph capture once an upstream-fixed image is available, and re-validate under a deep multi-turn workload (cold probes don't catch this).

…rruption

The MXFP4 MoE path corrupts under CUDA graph capture on this day-0 SGLang/ROCm
stack — silent output corruption (repeated words, control-token leakage, char
substitution) in long warm-cache sessions (300k+ ctx). Not visible in cold
probes. Ship --disable-cuda-graph (eager) and drop AITER_FLYDSL_FORCE
(uninitialized-memory MoE reduce). Refs ROCm/aiter#3632, sglang#18002, #27194.
Trade: slower decode; re-enable once an upstream-fixed image lands.

@youngjeong46 youngjeong46 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@youngjeong46
youngjeong46 merged commit ea1839b into main Aug 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants