refactor: eliminate DisaggPDChunkedPrefillScheduler. - #2017
Open
weizhehuang0827 wants to merge 1 commit into
Open
refactor: eliminate DisaggPDChunkedPrefillScheduler.#2017weizhehuang0827 wants to merge 1 commit into
weizhehuang0827 wants to merge 1 commit into
Conversation
weizhehuang0827
requested review from
Clement-Wang26,
DongheJin,
DragonFive,
JimHsiung,
Kang-Meng,
RobbieLeung,
XuZhang99,
liujinguang0125,
liutongxuan,
walsonyang,
xiao-yu-chen,
yingxudeng,
yq33victor and
zhang-minchao
as code owners
July 23, 2026 11:10
JimHsiung
previously approved these changes
Jul 23, 2026
PD + chunked_prefill now goes through DisaggPDScheduler → ContinuousScheduler::prepare_batch() → PrefillFirstPolicy, which schedules chunk_queue (in-flight) before prefill_queue (fresh). This naturally prevents the hold-and-wait deadlock that the deleted class's pd_prefill_footprint_fits gate was designed to solve. - Delete DisaggPDChunkedPrefillScheduler class and all helper functions - Delete DisaggPDScheduler::prepare_batch() override (base handles it) - Update drain_request_queue to skip expand_sequences for PD PREFILL (best_of_n expansion deferred to DECODE instance) - Remove DISAGG_PD_CHUNKED_PREFILL from SchedulerKind enum - Update scheduler_factory to route PD+chunked to DisaggPDScheduler
weizhehuang0827
force-pushed
the
feat/eliminate-pd-chunked-scheduler
branch
from
July 27, 2026 03:05
d96164d to
e9d24d7
Compare
JimHsiung
approved these changes
Jul 27, 2026
phantomlei3
approved these changes
Jul 27, 2026
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
DisaggPDChunkedPrefillSchedulerclass entirelyDisaggPDScheduler→ContinuousScheduler::prepare_batch()→PrefillFirstPolicyMotivation
After #1992 unified scheduling logic into
SchedulerPolicy,DisaggPDChunkedPrefillSchedulerduplicated the same scheduling work in its ownprepare_batch(). The key insight is thatPrefillFirstPolicyalready scheduleschunk_queue(in-flight) beforeprefill_queue(fresh), which naturally prevents the hold-and-wait deadlock that the old class was designed to solve.Changes
disagg_pd_chunked_prefill_scheduler.cpp/.hand its testDisaggPDScheduler::prepare_batch()override — defer toContinuousScheduler::prepare_batch()+ policyDISAGG_PD_CHUNKED_PREFILLfromSchedulerKindenum and factoryschedule_prefill_from_queue: fresh requests check if their total block footprint fits before admission (defense-in-depth against deadlock)resolve_batch_mode(enable_mix_batch = false)expand_sequencesfor PD PREFILL indrain_request_queue(best_of_n deferred to decode)deallocate—allocate()internally handles cleanup on failureTest Plan
FullFootprintAdmissionGateandFullFootprintAdmitsBothWhenFits)Change Type
Reviewer Notes
The prefix cache + PD crash (
batch_input_builder.cpp:269: remote block coverage shortage) is a pre-existing bug that also reproduces onca6a5fd7e(before the scheduler refactor). Fix submitted separately in #2040.