config: the dead record parameters go - #36974
Merged
Merged
Conversation
ch-wan
requested review from
Ying1123,
alphabetc1,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
xiezhq-hermann and
yizhang2077
as code owners
August 29, 2026 06:21
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ch-wan
force-pushed
the
cheng/gc-r4c-bag-readers
branch
from
August 29, 2026 06:35
97f9b5b to
53692cd
Compare
ch-wan
requested review from
BBuf,
CatherineSue,
Edwardf0t1,
FlamingoPg,
Fridge003,
HaiShaw,
Qiaolin-Yu,
b8zhong,
fzyzcjy,
hebiao064,
iforgetmyname,
key4ng,
mmangkad,
ping1jing2,
slin1237 and
sufeng-buaa
as code owners
August 29, 2026 06:35
ch-wan
requested review from
JustinTong0323,
sogalin,
wisclmy0611,
xutizhou and
zijiexia
as code owners
August 29, 2026 06:35
ch-wan
force-pushed
the
cheng/gc-r4d-dead-params
branch
from
August 29, 2026 06:35
7e2ab7b to
7425957
Compare
This was referenced Aug 29, 2026
ch-wan
force-pushed
the
cheng/gc-r4c-bag-readers
branch
from
August 29, 2026 07:14
53692cd to
8320872
Compare
ch-wan
force-pushed
the
cheng/gc-r4d-dead-params
branch
from
August 29, 2026 07:14
7425957 to
5a127e6
Compare
ch-wan
force-pushed
the
cheng/gc-r4c-bag-readers
branch
from
August 29, 2026 07:37
8320872 to
dacb593
Compare
ch-wan
force-pushed
the
cheng/gc-r4d-dead-params
branch
from
August 29, 2026 07:37
5a127e6 to
22962c3
Compare
ch-wan
force-pushed
the
cheng/gc-r4c-bag-readers
branch
from
August 29, 2026 08:11
dacb593 to
9842ba2
Compare
ch-wan
force-pushed
the
cheng/gc-r4d-dead-params
branch
from
August 29, 2026 08:11
22962c3 to
64840a1
Compare
ch-wan
force-pushed
the
cheng/gc-r4c-bag-readers
branch
from
August 29, 2026 08:32
9842ba2 to
e714b72
Compare
ch-wan
force-pushed
the
cheng/gc-r4d-dead-params
branch
from
August 29, 2026 08:32
64840a1 to
639f853
Compare
ch-wan
force-pushed
the
cheng/gc-r4c-bag-readers
branch
from
August 29, 2026 08:50
e714b72 to
dd4bc95
Compare
ch-wan
force-pushed
the
cheng/gc-r4d-dead-params
branch
from
August 29, 2026 08:50
639f853 to
6da72b0
Compare
ch-wan
force-pushed
the
cheng/gc-r4c-bag-readers
branch
from
August 29, 2026 11:18
dd4bc95 to
22f94e0
Compare
A census of the tree finds 256 functions that take a `server_args` they never read. Most are not dead: `multimodal_gen`'s pipeline stages take it as an interface contract -- 72 implementations of `forward` use it and 33 do not, so the parameter belongs to the signature, not to the body. The same holds for `SRTPlatform.apply_server_args_defaults` (implemented out of tree), `CustomSpecAlgo.handle_server_args`, the model-override providers, and the `StackStrategy.build` family. Ten in `srt/` are genuinely dead -- free functions called by name, nothing polymorphic about them: generate_prefill_cuda_graph_batch_sizes validate_ib_devices validate_buckets_rule handle_hardware_runtime_validation build_kv_only_stack build_hybrid_swa_stack build_hybrid_mamba_stack build_hybrid_mamba_swa_stack build_anchor_sidecar_stack build_deepseek_v4_hicache_stack The parameter goes from each, and the argument from all eighteen call sites. The eleventh candidate was not dead, and it is #36921: `create_kt_config_from_server_args` reached the record through `server_args.get_hf_config()`, a method `ServerArgs` does not have, under a bare `except Exception: pass` -- so `num_layers` was always None and the last-layer branch never fired. That fix landed on its own; what is left here is its call site following `get_model_config` out of the record. The 62-shape resolution probe is byte-identical to the base commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ch-wan
force-pushed
the
cheng/gc-r4d-dead-params
branch
from
August 29, 2026 11:20
6da72b0 to
ca3b805
Compare
kediwu0331
pushed a commit
to Zhylkaaa/sglang
that referenced
this pull request
Aug 30, 2026
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
saturn-acc
pushed a commit
to saturn-acc/sglang
that referenced
this pull request
Aug 31, 2026
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
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.
The series
Stacked, each PR based on the one above it. Read them in order; every boundary is
self-sufficient and green on its own.
main, not for mergeMotivation
Once a function stops reading the record, the parameter it was handed is dead weight — and a dead
server_argsparameter is worse than noise, because the next reader assumes the function consultsthe configuration when it does not.
Modifications
A census of the tree finds 256 functions that take a
server_argsthey never read. Most are notdead, and the distinction matters:
multimodal_gen's pipeline stages take it as an interface contract — 72 implementations offorwarduse it and 33 do not, so the parameter belongs to the signature, not to the body.component_usesis 16 to 29,create_pipeline_stages13 to 31.SRTPlatform.apply_server_args_defaults(implemented in otherdistributions),
CustomSpecAlgo.handle_server_args, the model-override providers, and theStackStrategy.buildfamily.Ten in
srt/are genuinely dead — free functions called by name, nothing polymorphic about them:The parameter goes from each, and the argument from all eighteen call sites.
The helper that fed a dropped parameter goes too:
_validate_ib_devicesin the CPU backend teststill built a bare
ServerArgs.__new__(ServerArgs)for a call that stopped taking one.Removing one uncovers the next.
test_dead_server_args_parameter_ratchet— added by an earlierround of this series with a baseline of zero — caught two functions this PR created:
attach_hybrid_minimax_sparse_pool_to_hiradix_cacheand its DSA sibling only carried a record topass along to the
build_*_stackfunctions above, so they became dead the moment those did. Theremoval is iterated to a fixed point now, which is what the ratchet's own docstring asks for.
An eleventh candidate was not dead, and it became #36921 rather than part of this PR:
create_kt_config_from_server_argsreached the record throughserver_args.get_hf_config(), amethod
ServerArgsdoes not have and never had, under a bareexcept Exception: pass. The callraised
AttributeErrorevery time,num_layerswas alwaysNone, and the branch that stops themodel's last MoE layer from deferring experts had never fired.
Accuracy Tests
The 62-shape resolution probe is byte-identical to the base commit. The suites that cover the
touched files report the same failure set as
main— the fivetest_fp8_blockwise_linear_backendsfailures are a PyTorch interpreter assert present on both sides.
Speed Tests and Profiling
None.
Checklist
Review and Merge Process
Pure deletion; the only thing to check is the interface/free-function split above. On this tree
the ratchet's own scan reports 0 hits over 268 files, and the
@_register_foroverride helpers(
_gemma2_gemma3_overrides,_exaone_overrides) still take an unused record because that is theirregistration contract — the same reason the polymorphic surfaces are left alone.
CI States
Latest PR Test (Base): 🚫 Run #33249912287
Latest PR Test (Extra): ❌ Run #33249912199
Latest PR Test (AMD ROCm 7.2): 🚫 Run #33249912252