kimi-k3 sglang: disable CUDA graph capture (fix deep-context MoE corruption) - #95
Merged
Merged
Conversation
…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.
martin-cala1
requested review from
chinmaybaikar,
datadoc24,
smazigh and
youngjeong46
as code owners
August 19, 2026 04:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 dropAITER_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).