Repository navigation
config: publish before the launcher reads effective configuration - #35910
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fcad1db787
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| self.soft_watchdog = Watchdog.create( | ||
| debug_name="DataParallelController", | ||
| watchdog_timeout=server_args.soft_watchdog_timeout, | ||
| watchdog_timeout=get_device().soft_watchdog_timeout, |
There was a problem hiding this comment.
Permit the DP controller's new namespace reads
When SGLANG_ROLE_NAMESPACES=enforce is enabled and a data-parallel controller starts, this unconditional get_device() call raises because publish(..., role="dp_controller") restricts that role to the exec namespace in ROLE_NAMESPACE_SETS. The new get_disagg() reads in the tracing branch are rejected for the same reason, so the role declaration must include both device and disagg (or these values must be obtained without crossing the enforced namespace boundary) to prevent DP startup from failing.
Useful? React with 👍 / 👎.
b5e39c5 to
fb0fd4f
Compare
fb0fd4f to
662d397
Compare
9f736ee to
926f5d6
Compare
The stack members #35904-#35910 share head SHAs with this branch's commits; GitHub dedupes check suites by SHA, so without a distinct tip this carrier PR would show the members' runs instead of running CI over the whole stack at once. Co-Authored-By: Claude Opus 5 <[email protected]>
662d397 to
a42a1db
Compare
926f5d6 to
8283034
Compare
a42a1db to
8791e5b
Compare
8283034 to
48b021f
Compare
8791e5b to
e4398b9
Compare
48b021f to
784fd6d
Compare
e4398b9 to
3c56ce7
Compare
The stack members #35904-#35910 share head SHAs with this branch's commits; GitHub dedupes check suites by SHA, so without a distinct tip this carrier PR would show the members' runs instead of running CI over the whole stack at once. Co-Authored-By: Claude Opus 5 <[email protected]>
784fd6d to
b589336
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b589336cec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| # resolution, which a published config refuses. Hence before publish. | ||
| server_args.check_server_args() | ||
|
|
||
| publish(server_args, role="tokenizer") |
There was a problem hiding this comment.
Clear the publication when pre-spawn setup fails
When a supplied ServerArgs instance uses LoRA and a later pre-spawn step fails (for example, PortArgs.init_new() detects a DP-attention port collision), this publication remains installed even though engine construction failed. Retrying with the same instance reaches check_server_args() before this line, where LoRA normalization calls declare_late_resolution() and now raises because that exact record is already published; previously these port failures occurred before publication and the instance remained retryable. Roll back the context on launch failure or defer publication until the remaining fallible setup has completed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2f7c53d0c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96b0148d64
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| value = getattr(_CONTEXT, name) | ||
| state[name] = list(value) if isinstance(value, list) else value |
There was a problem hiding this comment.
Preserve the previous capture flag during rollback
When a previously published context has a different enable_torch_compile value and the attempted launch later fails during port allocation, bootstrap setup, or daemon startup, this snapshot stores the existing Flags object by reference. publish() then mutates that same object through set_server_args(), so restore_context() reinstalls an already-mutated flag rather than the prior value. The caller is left with the old server args and bags but the failed launch's compile setting, which can incorrectly enable or disable compilation when the previous context is reused; snapshot this mutable flag state separately or restore its prior value explicitly.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d1452016b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d23c133c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| ) | ||
|
|
||
| # Needs a tokenizer and a chat template, so it cannot live in the | ||
| # pipeline; after the plugins, which may register the parser detected. | ||
| if ( | ||
| server_args.reasoning_parser == "auto" | ||
| or server_args.tool_call_parser == "auto" | ||
| ): | ||
| resolve_auto_parsers(server_args) |
There was a problem hiding this comment.
Defer auto-parser mutation until after port allocation
When a supplied ServerArgs uses either parser value "auto" and PortArgs.init_new() subsequently fails (for example, because of a DP-attention port collision), this call has already replaced the sentinel with a detected parser or None. Retrying with the same instance therefore skips detection—even if tokenizer/model loading failed transiently—despite the rollback explicitly preserving retryability. Although validation now precedes detection, the fresh ordering still invokes detection before the fallible port allocation; allocate ports first or restore the parser fields on failure.
Useful? React with 👍 / 👎.
The launcher published last, after validating, allocating ports and deciding whether to start the engine-info bootstrap server -- all of which read the effective configuration. So those reads had to come off the record, which is the thing the record is supposed to stop carrying. Publish moves up to just below validation, which is the earliest it can go. Two steps above it write to the record and a published record is read-only: the auto-parser detection is resolution that needs a tokenizer and a chat template, so it cannot live in the pipeline, and validation normalizes LoRA adapter paths and target modules through late resolution. Everything that was below publish is unchanged in order; it is now downstream of it, and the bootstrap decision reads its switch from the model bag. Validation stays above publish for that reason, and the invariant it carried is unchanged: it still throws before any subprocess spawns. The launcher creates them in three helpers -- the weight-cache daemons, the schedulers, the detokenizer and router -- and calls all three below both. The startup-failure test hands the launcher a real record instead of a namespace: the launcher publishes what it is given, and bags only project from a dataclass. Co-Authored-By: Claude Opus 5 <[email protected]>
The data-parallel controller publishes as the first thing its process does and
then lays out its schedulers, so everything it reads afterwards -- the load
balance method, the watchdog timeout, the disaggregation role for its thread
label, and the rank arithmetic over the stage, attention-CP and MoE-DP sizes --
comes from the bags. The rank arithmetic follows the configured sizes: it is
deciding what to spawn, so the groups it sizes for do not exist yet.
The HTTP lifespan's gRPC-mode branch runs after the launcher published, and
reads the same way.
The controller's publish role declares the namespaces it reads. Converting these
reads takes it past `{"exec"}`: the watchdog timeout is a `device` leaf and the
thread label reads the `disagg` mode, and `parallel` was already outside the
declared set before this series. Under `SGLANG_ROLE_NAMESPACES=enforce` a
too-narrow set fails the request rather than a test, so the set is widened to
what the module actually reads.
Co-Authored-By: Claude Opus 5 <[email protected]>
`_compute_parallelism_ranks` already read the DP topology out of the context; the attention-CP and MoE-DP factors it divided by still came off the record. It runs while the launcher is deciding what to spawn, so those are the configured sizes -- the process groups it is laying out do not exist yet -- and they come from the `configured_*` accessors like the rest of that arithmetic. The sizes are lifted into locals rather than read four times each, which is why the expressions get shorter rather than longer. Co-Authored-By: Claude Opus 5 <[email protected]>
The bags are projected from what resolution decides, so anything the pipeline calls has to read the resolving state instead. A bag read reached from resolution raises `config namespace ... not published` — and only on the branch that reaches it, which is why two of them were written, merged and stayed green for everything except the configuration that triggers them: the diffusion-LM page-size pass needed one model family, the Marlin LoRA validation needed one MoE runner backend. `test_publish_precedes_bag_reads.py` is the same worry from the other side, but it walks the process entries, so it cannot see a helper the pipeline calls; neither of those two appeared in it. This walks the other direction: from what resolution can reach -- the symbols `server_args.py` and the override module import, every pass and provider in the live resolution registries, and the passes named at a by-value call site -- to whether any of them reaches a bag accessor. Both known cases are caught by it, verified by putting each back. The registries rather than the decorators, because that is where the coverage was: most model-override providers register through a helper call, so keying on `@register_model_override` found 39 entries where the registries hold 65, and a bag read in any of the other 26 was invisible. Verified the same way -- a read put into one of them is reported now and was not before. What it cannot see is stated in the module: a read reached through a method rather than a module-level function, one behind an import the walk does not follow, and one in a callable no call site names. It is a ratchet, not a proof. Co-Authored-By: Claude Opus 5 <[email protected]>
Stack
Part of a series that moves
ServerArgsfrom "mutate the record at construction" to "resolve once, publish into config bags". Each PR stands alone (builds, passes its own tests); review bottom-up.mainWhole-series CI vehicle (not for merge): #35917
Motivation
The launcher published last — after validating, allocating ports, and deciding whether to start the engine-info bootstrap server — so all of those read effective configuration off the record, which is exactly what the record should stop carrying.
Modifications
inspect: a decorator-keyed scan saw 39 of 65 — most providers register through a helper. A source-order pin keeps the late resolvers above the publish.Verification
Checklist
🤖 Generated with Claude Code
CI States
Latest PR Test (Base): 🚫 Run #32627985884
Latest PR Test (Extra): ❌ Run #32627985753
Latest PR Test (AMD ROCm 7.2): 🚫 Run #32627985903