Repository navigation
[Fix] scheduler: Tell a step's middle chunk from the batch's chunked request, not a per-request counter - #43906
Conversation
57dba20 to
1c5efb2
Compare
53b6bfd to
965b933
Compare
df458f8 to
1eeb89a
Compare
965b933 to
f0bab9a
Compare
378a21e to
03c4332
Compare
f0bab9a to
c9817c8
Compare
…st counter; read in-flight work from inflight_steps
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
/tag-and-rerun-ci |
|
/rerun-test test_disaggregation_optimistic_prefill.py test_prefill_complete_allocation.py test_scripted_swa_1gpu.py test_scripted_core_1gpu.py test_pp_single_node_extra.py registered/disaggregation/test_disaggregation_pp.py test_retract_decode.py test_dp_spec_prefill_coordination_mixed.py test_disaggregation_hisparse.py test_disaggregation_unified_memory.py |
|
🚀 🚀 🚀 🚀 🚀 🚀 |
…t-free-pool Resolve test conflicts and adapt held-row test to sgl-project#43906 (inflight_middle_chunks removed) and IndexedReqList waiting_queue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…request, not a per-request counter (sgl-project#43906)
Facts about work in flight now come from what each step recorded when it was built or launched, instead of a per-request counter or a batch snapshot. This fixes a miscount of chunked prefill on main.
The fix
Req.inflight_middle_chunkswas raised whenever a chunked request existed after an admission pass that admitted something, even when the chunked request got no chunk in that pass. Under the hybrid-SWA joint prefill budget, a chunk whose remaining prompt does not fit with its new-token headroom is parked, while a smaller waiting request can still be admitted in the same pass. The counter then never came back down, and the request's final chunk was processed as a middle chunk: its first token was not committed (PD prefill: it was requeued as if it had yielded).The same state made
contains_last_prefill_chunkFalse for a batch whose only row ran a final prefill, so pipeline parallelism withSGLANG_PP_SKIP_PURE_CHUNKED_OUTPUT_COMMskipped its output exchange.A pause that retracts under pipeline parallelism reset the counter while other micro-batches still carried the request, so their results could be labelled wrongly too; each step's own record labels it by itself.
Changes
chunked_req, which the batch already records at build: the request that runs a chunk in this batch and is still chunked after it. A parked request is named there too but is not a row, so it is never asked about.copy()now carrieschunked_req, since overlap processes the copy. The counter, its resets and the never-read dLLM increments are removed.contains_last_prefill_chunkcounts the chunked request only when it is admitted in this pass.Req.inflight_steps): at once at the yield, otherwise when its last step in flight is processed. This replaces the overlap flag and theextend_endinference; both rules agree wherever the yield can happen (optimistic prefill is off with pipeline parallelism, and a request otherwise has at most one step in flight)._reqs_finishing_inflightfinds running requests whose queued result finishes them byinflight_steps > 0instead of reading the queued batch copy, and drops the one-batch assert. Same result: only the overlap loop enables it, and there the queued step is the only step in flight.Behavior changes: only the parked-chunk and pipeline-parallel retract states above.
Test plan
test_chunked_prefill_does_not_yield_for_decode_admissioncovers a yield with and without a step in flight.test/registered/unit/managers/,test/registered/unit/disaggregation/andtest/registered/unit/dllm/pass locally withSGLANG_IS_IN_CI=1, apart from failures main has too.CI States
Latest PR Test (Base): 🚫 Run #41560652630
Latest PR Test (Extra): ❌ Run #41560652511
Latest PR Test (AMD ROCm 10): 🚫 Run #41560652473
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: