[PD] Re-add early _engine_paused gate before decode_queue / pop_boots… - #24908
Closed
Zhichenzzz wants to merge 42 commits into
Closed
[PD] Re-add early _engine_paused gate before decode_queue / pop_boots…#24908Zhichenzzz wants to merge 42 commits into
Zhichenzzz wants to merge 42 commits into
Conversation
…alistic perf and auto-discover ut (sgl-project#22086) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Baizhou Zhang <sobereddiezhang@gmail.com>
…gl-project#21649) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Baizhou Zhang <sobereddiezhang@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Letian Ruan <ruanlt420@gmail.com>
…ng (sgl-project#22754) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Byron Hsu <byron+per@periodiclabs.ai>
Co-authored-by: Kurt Shuster <kurt@thinkingmachines.ai> Co-authored-by: satyamk7054 <43010011+satyamk7054@users.noreply.github.com> Co-authored-by: Satyam Kumar <satyamk@linkedin.com>
…y arch name DeepseekV3ForCausalLM models on sm100 (B200) were unconditionally defaulted to fp8 quantization. This breaks BF16 models that share the same architecture (e.g. Moonlight-16B-A3B) because they lack FP8 scale tensors, causing AssertionError in the flashinfer_trtllm MoE runner. Instead of assuming FP8 by architecture name, read the safetensors file header to check if expert weights are actually stored as F8_E4M3. This correctly distinguishes DeepSeek V3/R1 (native FP8 experts) from Moonlight (BF16). Made-with: Cursor
…RCE_STREAM_INTERVAL (sgl-project#23215)
…follow-up to sgl-project#23731) (sgl-project#23734) Co-authored-by: Byron Hsu <byron@periodiclabs.ai> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
yueming-yuan
requested review from
AniZpZ,
BBuf,
DarkSharpness,
Edwardf0t1,
FlamingoPg,
Fridge003,
HaiShaw,
HydraQYH,
JustinTong0323,
Kangyan-Zhou,
Qiaolin-Yu,
Ying1123,
b8zhong,
bingxche,
celve,
ch-wan,
fzyzcjy,
hebiao064,
ispobock,
lifuhuang,
liusy58,
merrymercy,
mickqian,
ping1jing2,
xiezhq-hermann,
yhyang201,
yizhang2077,
yuan-luo and
yushengsu-thu
as code owners
May 22, 2026 22:22
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.
Summary
To fix this issue radixark/miles#1085, Re-add the early
_engine_pausedgate beforeprocess_decode_queue()(decode.py) andpop_bootstrapped()(prefill.py) in the PD-disaggregated event loops, fixing a regression introduced by #23887.Background
if self._engine_paused: continuebeforeprocess_decode_queue()/pop_bootstrapped(), gating new KV polling and new bootstrap pop duringpause_generation.For plain PD-disagg the order swap is benign, but for PD + R3 (hierarchical cache) it re-opens a race window: once
pause_generation(mode="in_place")flips_engine_paused = True, the loop still runs one moreprocess_decode_queue()(decode side) / one morepop_bootstrapped()+ scheduling lookahead (prefill side) before honoring the pause. Under concurrent KV transfer load with hicache, this is enough to corrupt the in-flight NIXLKVReceiverstate, producing the symptoms originally reported inradixark/miles#1085:Change
Add
if self._engine_paused: continueimmediately afterprocess_input_requests(recv_reqs)in all four disagg event loops:event_loop_normal_disagg_decodeevent_loop_overlap_disagg_decodeevent_loop_normal_disagg_prefillevent_loop_overlap_disagg_prefillThe existing post-call gate from #23887 is kept so a pause that arrives mid-iteration is still caught before the next batch runs.
Net diff: 2 files, +14 / -0.
Test plan
Validated against Qwen3.5-35B-A3B FP8 on H200, 1P1D layout, EP=4 DP=4 TP=1,
--sglang-disaggregation-transfer-backend nixl,--sglang-enable-hierarchical-cache,pause_generation_mode=in_place,RANDOM_ASYNC_CONCURRENCY_PER_GPU=96, using theexamples/random_async/run_random_async_3node.pyagent loop from radixark/miles#1062:update_weights_implementationR3 prefix cache hit rate ~84 % across both runs. Each run completes two full pause / weight-transfer / continue cycles without any decode-side NIXL
KVReceiverfailures.Motivation
Modifications
Accuracy Tests
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci