Bundle Scheduler rank/size fields into a frozen ParallelState#25444
Merged
fzyzcjy merged 1 commit intoMay 16, 2026
Merged
Conversation
…lelState Introduce a frozen `@dataclass(frozen=True, slots=True, kw_only=True)` `ParallelState` value object that bundles the 17 rank/size fields historically scattered across Scheduler (`tp_rank`, `tp_size`, `pp_rank`, `pp_size`, `dp_rank`, `dp_size`, `attn_tp_*`, `attn_cp_*`, `attn_dp_*`, `moe_ep_*`, `moe_dp_*`, `gpu_id`). All consumers across scheduler / disaggregation / dp_attention / ray / observability paths now read these through `self.ps.<field>` instead of `self.<field>`, making it explicit that the rank/size tuple belongs together and never mutates independently after init. Also folds in the original `fix-disagg-prefill-rank` commit, which caught two stragglers in `SchedulerDisaggregationPrefillMixin` (`self.pp_rank` in a log message and `self.tp_rank` in an error message) that were missed in the first rename pass. Squashing the fix back into the parent keeps the chain identifier ↔ PR mapping clean (one commit = one logical refactor step = one PR in the eventual chain). Refactor chain ID: parallel-state
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
fzyzcjy
added a commit
to fzyzcjy/sglang
that referenced
this pull request
May 19, 2026
Upstream PR sgl-project#25444 moved Scheduler.pp_size onto a frozen ParallelState container (self.ps.pp_size). My branch's chunked-resume PP code still referenced the old direct attribute, causing AttributeError: 'Scheduler' object has no attribute 'pp_size' in _in_flight_other_mb_rids and abort_request.
5 tasks
Shunkangz
pushed a commit
to Shunkangz/sglang
that referenced
this pull request
May 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.
Introduce a frozen
@dataclass(frozen=True, slots=True, kw_only=True)ParallelStatevalue object that bundles the 17 rank/size fieldshistorically scattered across Scheduler (
tp_rank,tp_size,pp_rank,pp_size,dp_rank,dp_size,attn_tp_*,attn_cp_*,attn_dp_*,moe_ep_*,moe_dp_*,gpu_id). All consumers acrossscheduler / disaggregation / dp_attention / ray / observability paths
now read these through
self.ps.<field>instead ofself.<field>,making it explicit that the rank/size tuple belongs together and
never mutates independently after init.
Also folds in the original
fix-disagg-prefill-rankcommit, whichcaught two stragglers in
SchedulerDisaggregationPrefillMixin(
self.pp_rankin a log message andself.tp_rankin an errormessage) that were missed in the first rename pass. Squashing the fix
back into the parent keeps the chain identifier ↔ PR mapping clean
(one commit = one logical refactor step = one PR in the eventual
chain).
Refactor chain ID: parallel-state
CI States
Latest PR Test: ❌ Missing
run-cilabel — add it to run CI tests.Latest PR Test (Extra): ❌ Blocked —
run-ciis required first.