Skip to content

config: borrowed-record reads follow the config bags - #35908

Merged
ch-wan merged 6 commits into
mainfrom
cheng/gc-pr4-borrowed-record-reads
Aug 23, 2026
Merged

ch-wan merged 6 commits into
mainfrom
cheng/gc-pr4-borrowed-record-reads

Conversation

@ch-wan

@ch-wan ch-wan commented Aug 21, 2026 •

Copy link
Copy Markdown
Collaborator

Stack

Part of a series that moves ServerArgs from "mutate the record at construction" to "resolve once, publish into config bags". Each PR stands alone (builds, passes its own tests); review bottom-up.

# PR base
0 #35904 main
1 #35905 #35904
2 #35906 #35905
3 #35907 #35906
4 #35908 #35907
5 #35909 #35908
6 #35910 #35909

Whole-series CI vehicle (not for merge): #35917

Motivation

Components reached the startup record through whatever object happened to hold it — model_runner.server_args.field, self.scheduler.server_args.field. A reference lifted off another object carries no contract, and no read census counted that spelling: it had grown to 105 reads across 36 files unnoticed. Once the record stays at the user's raw input, these reads answer with the CLI default.

Modifications

  • Every borrowed-record chain read of a resolution-written field moves to the config bags (weight loading, graph capture, pool configurator, forward-batch construction, KV pool runtime, disaggregation and elastic-EP paths, HTTP/gRPC surfaces, attention backends).
  • Reads that follow the configured topology rather than live process groups use the configured_*() accessors (a draft runner shares the target's process groups, so the live property would answer for the wrong runner).
  • Reads of raw input (host, ports, paths the caller chose) stay on the record — that is what the record is for.
  • The chain-read ratchet pins the converted set at zero: the written-field set is derived from four channels (handler keywords, the live override registries, post-process pass returns, late resolution), so a field that stops being resolution-written drops out of scope instead of pinning a stale name.

Verification

  • Chain-read ratchet: zero borrowed chain reads of resolution-written fields at this commit (105/36 on base, same scanner).
  • Guard suite and lint green at this boundary; every touched test file re-run per-file in isolation.
  • A/B: resolved end-state identical to base across the 11-configuration matrix.

Checklist

🤖 Generated with Claude Code


CI States

Latest PR Test (Base): 🚫 Run #32627950438
Latest PR Test (Extra): 🚫 Run #32627950285
Latest PR Test (AMD ROCm 7.2): 🚫 Run #32627950435

@ch-wan
ch-wan force-pushed the cheng/gc-pr4-borrowed-record-reads branch from 4ec6b36 to f39d2af Compare August 21, 2026 23:34
@ch-wan ch-wan added run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci) and removed run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci) labels Aug 22, 2026
@ch-wan
ch-wan force-pushed the cheng/gc-pr3-resolution-gate branch from 6a7f8fb to 0ae528a Compare August 22, 2026 00:48
@ch-wan
ch-wan force-pushed the cheng/gc-pr4-borrowed-record-reads branch from f39d2af to 15c3f11 Compare August 22, 2026 00:48
@ch-wan
ch-wan force-pushed the cheng/gc-pr3-resolution-gate branch from 0ae528a to 3f2e968 Compare August 22, 2026 05:58
@ch-wan
ch-wan force-pushed the cheng/gc-pr4-borrowed-record-reads branch from 15c3f11 to 902f0f8 Compare August 22, 2026 05:58
@ch-wan
ch-wan force-pushed the cheng/gc-pr3-resolution-gate branch from 3f2e968 to 515bb51 Compare August 22, 2026 07:28
@ch-wan
ch-wan requested a review from liusy58 as a August 22, 2026 07:28
@ch-wan
ch-wan force-pushed the cheng/gc-pr4-borrowed-record-reads branch from 902f0f8 to d9d3103 Compare August 22, 2026 07:28
@ch-wan
ch-wan force-pushed the cheng/gc-pr3-resolution-gate branch from 515bb51 to f94bc8b Compare August 22, 2026 07:32
@ch-wan
ch-wan force-pushed the cheng/gc-pr4-borrowed-record-reads branch from d9d3103 to 8ab79d3 Compare August 22, 2026 07:32
@ch-wan
ch-wan force-pushed the cheng/gc-pr3-resolution-gate branch from f94bc8b to 2ceb518 Compare August 22, 2026 09:38
@ch-wan
ch-wan force-pushed the cheng/gc-pr4-borrowed-record-reads branch from 8ab79d3 to 0170ec4 Compare August 22, 2026 09:38
@ch-wan
ch-wan force-pushed the cheng/gc-pr3-resolution-gate branch from 2ceb518 to 48b2540 Compare August 22, 2026 10:48
@ch-wan
ch-wan force-pushed the cheng/gc-pr4-borrowed-record-reads branch from 0170ec4 to ed1bccc Compare August 22, 2026 10:48
@ch-wan
ch-wan force-pushed the cheng/gc-pr3-resolution-gate branch from 48b2540 to 50a4032 Compare August 22, 2026 17:43
@ch-wan
ch-wan force-pushed the cheng/gc-pr4-borrowed-record-reads branch from ed1bccc to cf351f7 Compare August 22, 2026 17:43
@ch-wan
ch-wan force-pushed the cheng/gc-pr3-resolution-gate branch from 50a4032 to 206c8a1 Compare August 22, 2026 18:25
ch-wan and others added 6 commits August 23, 2026 08:19
Weight loading, graph capture, the pool configurator, the forward-batch
construction and the KV pool runtime reached the startup record through the
runner they were handed -- `model_runner.server_args.field`. That spelling is
the one no read census counts: a parameter read at least carries the
supplied-instance contract, while a reference lifted off another object
carries nothing, and once the record stays at the user's raw input these reads
answer with the CLI default.

They are bag reads now, except five that follow the configured stage count
instead: the runner's layer window is arithmetic over configuration, and a
draft runner shares the target's process groups, so the live property would
answer for the wrong runner.

Three fixtures move with them. The graph-capture tests hung a fake
`cuda_graph_config` off a fake runner; the configuration is published now, and
the chunk-shape cases drive it by mutating the object they published -- which
is the same object the bag holds.

Co-Authored-By: Claude Opus 5 <[email protected]>
…bags

The same chain spelling, in the rest of the runtime: the Triton, AITER and DSA
backends and the attention registry reached the record through the runner; the
metrics reporter and the prefill/decode disaggregation loops reached it through
the scheduler; the EAGLE draft graph runner through the runner it wraps.

Two of them follow the configured stage count rather than the live group: the
reporter labels its metrics with what the launch configured, and a draft runner
shares the target's process groups, so the live property describes the wrong
runner.

Co-Authored-By: Claude Opus 5 <[email protected]>
The tail of the chain spelling: the FlashInfer, DeepSeek-V4, Wave, XPU, KDA and
hybrid attention backends, the DeepGEMM compile cache, the shared graph output,
the KV staging handler, the tree-cache registry, and three more draft graph
runners. Twenty reads, each one lifted off a runner or a manager that happened
to hold the record.

Three more are the draft window over the target's stages again and follow
the configured count.

One fixture moves with them: the linear-attn stamp test built a runner double
whose fake record carried the draft-token width, and the point of that test is
that the only AttributeError comes from the missing stamp -- so the width is
published now, and the double carries nothing that could answer for it.

Co-Authored-By: Claude Opus 5 <[email protected]>
The last of the chain spelling, in the entrypoints: the gRPC bridge and the
HTTP server reached the record through the tokenizer manager, and `/v1/loads`
computed its accelerator counts the same way.

These are readbacks, and which record answers depends on the question. "What
was asked for" stays on the raw record. "What will this server actually do" --
the tokenizer path a request will use, whether LoRA is available, the sampling
defaults a completion inherits, how many accelerators back each DP rank -- is
the resolved answer, so it comes from the bags.

The `/v1/loads` fixtures publish the shape under test rather than hanging it
off a fake manager; `tp_size` stays on the double, because raw input is exactly
what the record is for.

With this the chain spelling is out of the resolution-written surface
altogether: 105 reads across 36 files at the start of the sweep, none left.

Co-Authored-By: Claude Opus 5 <[email protected]>
Twenty-five reads where a function was handed the record and took a resolved
value off it: the rust server and the tokenizer control paths, the prefill
delayer, the KV cache configurator and builder, the disaggregation backend
selection, the KT EP wrapper, the unquantized linear's deterministic switch,
the Marlin LoRA placement check, the piecewise graph configuration, the CUDA
VMM transport and the model-file verifier.

Raw fields stay on the record. A callee reading `server_args.host` is reading
what the caller asked for, which is what the record is for; only the leaves
resolution fills in have to move, because those are the ones that answer with
a CLI default once the record stops carrying them.

`build_sidecar_endpoint` keeps its argument instead of half-reading one: it is
a string helper over a host and a port, so the caller passes the resolved port
rather than the helper reaching for it.

The Marlin LoRA validation is the exception that proves the rule: the pipeline
calls it, so the bags do not exist yet, and it already receives the resolving
view for the two other fields it checks. Its LoRA switch reads that view.

Co-Authored-By: Claude Opus 5 <[email protected]>
Setting up the process groups is the first thing a model runner does after it
publishes, so the switches it consults -- the NCCL pre-warm, the custom
all-reduce and symmetric-memory flags, the FlashInfer fusion backend, the MoE
all-to-all backend -- come from the bags rather than from the record it was
handed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apple-silicon deepseek diffusion SGLang Diffusion model-gateway Multi-modal multi-modal language model quant LLM Quantization ready-to-merge The PR is ready to merge after the CI is green. speculative-decoding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant