config: a parallel leaf with no live counterpart is read bare - #36620
Merged
Merged
Conversation
ch-wan
requested review from
Fridge003,
HaiShaw,
Jiminator,
JustinTong0323,
Qiaolin-Yu,
ShangmingCai,
Ying1123,
alexnails,
alphabetc1,
b8zhong,
fzyzcjy,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
jybsuper,
kpham-sgl,
lifuhuang,
liusy58,
merrymercy,
mickqian,
mmangkad,
pyc96,
xiezhq-hermann,
yctseng0211,
yhyang201,
yizhang2077,
yuan-luo and
yushengsu-thu
as code owners
August 27, 2026 05:08
This was referenced Aug 27, 2026
Closed
Collaborator
Author
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
ch-wan
requested review from
iforgetmyname,
ping1jing2 and
whybeyoung
as code owners
August 27, 2026 09:07
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
5 tasks
saturn-acc
pushed a commit
to saturn-acc/sglang
that referenced
this pull request
Aug 31, 2026
…oject#36620) Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
nzr-niu
pushed a commit
to nzr-niu/sglang
that referenced
this pull request
Sep 1, 2026
…oject#36620) Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.
Motivation
PR 3 of a five-PR series on top of the raw-input
ServerArgswork (#36250–#36255), based onf775db03aaa. Each builds on the previous one; review them in order.cheng/gc-p1— config: resolution declares, and nothing writes a fieldcheng/gc-p2— config: every handler declares its cuda-graph decisionscheng/gc-p3— config: a parallel leaf with no live counterpart is read bare ← this PRcheng/gc-p4— config: a parallel size has one spelling; a patched scope declares its owncheng/gc-p5— config: the record is not an object that gets passed aroundThey are grouped by how they have to be read, not by topic: PR 3 is 118 files of one mechanical rewrite, reviewed by checking the rule and sampling; PR 4 is the design change that rewrite made possible, and its production files each need reading.
CI for the whole series runs on a separate vehicle PR, whose branch sits one placeholder commit above PR 5: #36623.
Two commits' worth of work, squashed: one enabling change in
runtime_context.py, and the sweep it makes possible.get_parallel()served the live process groups; the resolved parallelconfiguration was one hop away under
.config. Of the 40 leaves in theparallelnamespace, 35 have no live counterpart at all —dp_size,ep_size,nnodes,enable_dp_attentionand so on are config-only. For thosethe hop disambiguates nothing: there is no live value they could be confused
with, and every reader paid for a distinction that does not exist.
Modifications
``d276ba7e211
· 125 files (118 production, 7 test) · **118 of them are oneThe enabling change (read this one closely)
ParallelContext.__getattr__was error-only: it raised, naming.config. Itnow returns the leaf.
Three behaviours it has to keep, pinned in
test_launch_path_reads_configured_sizes.py(#36621 deletes that file once thelive tier is gone and re-homes these three into
test_runtime_context.py):resolution_result, not against the bag, so the two sides are different datapaths);
ValueError("config namespace 'parallel' not published")— not a misleadingAttributeError, which is what a naivefall-through gives. The leaf set is derived from the field metadata, since the
bag is exactly what does not exist yet;
AttributeError.Dynamo: gate helpers read parallel leaves inside compiled forwards, and
object.__getattribute__graph-breaks. Measured before writing anything: bareaccess through
__getattr__traces undertorch.compile(fullgraph=True). Thereis a regression test for the
.configspelling already; the bare spelling is nowcovered the same way.
The sweep
301 sites in 118 files:
get_parallel().config.<leaf>→get_parallel().<leaf>— 296 spelled out in full, 5 read through a local alias (whose binding is
rewritten with them). Driven by AST — the receiver is resolved to
get_parallel()or a local bound to it, and only leaves in the config-only setare rewritten. The five shadowed sizes are untouched here; #36621 collapses them.
One thing the sweep got wrong, and how it was caught
The rewrite turned an assertion in the launch-path guard into
bare == bare— a tautology, in the very test that was supposed to pin thebehaviour. It now compares against
resolution_result. Worth knowing becausethe same hazard applies to any mechanical sweep over a test that spells the
thing it is testing.
Accuracy Tests
No model-output change: this series moves where a configuration value is read
from, not what resolution decides. The equivalent check for that claim is a
resolution dump — every field's resolved value for 24 launch shapes (plain, tp2,
tp4_pp2, dp2, EAGLE, NEXTN, page32, page64_chunk2k, cuda-graph knobs,
disaggregation, deterministic, hierarchical cache, symmetric memory, …) — taken
in both trees and compared field by field:
0 differences across 24 shapes × 478 shared fields, against
f775db03aaa.The one field the series has and the base does not is
grpc_worker_threads: onmain it is a public non-field slot assigned in
_handle_deprecated_args, andthis series makes it a declared field. Its value is 4 on both sides.
Every guard also runs at each commit of the series, not only at the head — a
PR that is green only on top of its successors is not reviewable on its own. The
set is the config guards plus every registered test the series touches, ~33 files
per boundary, all green.
No GPU accuracy run. Everything above is CPU-side: resolution, projection and the
guards. A launch-path change that only shows up with real process groups is not
covered by any of it.
Speed Tests and Profiling
No benchmark run, and none is expected to move: nothing here changes a kernel, a
schedule, or the shape of any batch. What changes is the source of a
configuration read — a published dataclass attribute instead of a process-group
getter or an accessor hop.
The one place that could have mattered is
torch.compile: gate helpers readparallel leaves inside compiled forwards, and
object.__getattribute__graph-breaks. That was measured rather than assumed — the reads this series
introduces trace under
torch.compile(fullgraph=True), which is pinned by aregression test.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci🤖 Generated with Claude Code
CI States
Latest PR Test (Base): 🚫 Run #33110833966
Latest PR Test (Extra): 🚫 Run #33110833766
Latest PR Test (AMD ROCm 7.2): ❌ Run #33110833733