Skip to content

config: the dead record parameters go - #36974

Merged
ch-wan merged 1 commit into
mainfrom
cheng/gc-r4d-dead-params
Aug 29, 2026
Merged

config: the dead record parameters go#36974
ch-wan merged 1 commit into
mainfrom
cheng/gc-r4d-dead-params

Conversation

@ch-wan

@ch-wan ch-wan commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

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.

  1. #36896 — the resolution pipeline's dispatcher leaves the record
  2. #36972 — the callbacks into the record go to zero
  3. #36973 — six more runtime readers ask the bags
  4. #36974 — the dead record parameters go ← you are here
  5. #36975 — the lazy imports that buy nothing become eager
  • #36925 — CI vehicle — runs the whole series against main, not for merge

Motivation

Once a function stops reading the record, the parameter it was handed is dead weight — and a dead
server_args parameter is worse than noise, because the next reader assumes the function consults
the configuration when it does not.

Modifications

A census of the tree finds 256 functions that take a server_args they never read. Most are not
dead
, and the distinction matters:

  • 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.
    component_uses is 16 to 29, create_pipeline_stages 13 to 31.
  • The same holds for SRTPlatform.apply_server_args_defaults (implemented in other
    distributions), 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 helper that fed a dropped parameter goes too: _validate_ib_devices in the CPU backend test
still 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 earlier
round of this series with a baseline of zero — caught two functions this PR created:
attach_hybrid_minimax_sparse_pool_to_hiradix_cache and its DSA sibling only carried a record to
pass along to the build_*_stack functions above, so they became dead the moment those did. The
removal 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_args reached the record through server_args.get_hf_config(), a
method ServerArgs does not have and never had, under a bare except Exception: pass. The call
raised AttributeError every time, num_layers was always None, and the branch that stops the
model'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 five test_fp8_blockwise_linear_backends
failures 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_for override helpers
(_gemma2_gemma3_overrides, _exaone_overrides) still take an unused record because that is their
registration 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T06:37:18.886883Z 7425957 New commits
ℹ️ 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" or "@codex security review".

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
ch-wan force-pushed the cheng/gc-r4d-dead-params branch from 7e2ab7b to 7425957 Compare August 29, 2026 06:35
@ch-wan
ch-wan force-pushed the cheng/gc-r4c-bag-readers branch from 53692cd to 8320872 Compare August 29, 2026 07:14
@ch-wan
ch-wan force-pushed the cheng/gc-r4d-dead-params branch from 7425957 to 5a127e6 Compare August 29, 2026 07:14
@ch-wan
ch-wan force-pushed the cheng/gc-r4c-bag-readers branch from 8320872 to dacb593 Compare August 29, 2026 07:37
@ch-wan
ch-wan force-pushed the cheng/gc-r4d-dead-params branch from 5a127e6 to 22962c3 Compare August 29, 2026 07:37
@ch-wan
ch-wan force-pushed the cheng/gc-r4c-bag-readers branch from dacb593 to 9842ba2 Compare August 29, 2026 08:11
@ch-wan
ch-wan force-pushed the cheng/gc-r4d-dead-params branch from 22962c3 to 64840a1 Compare August 29, 2026 08:11
@ch-wan
ch-wan force-pushed the cheng/gc-r4c-bag-readers branch from 9842ba2 to e714b72 Compare August 29, 2026 08:32
@ch-wan
ch-wan force-pushed the cheng/gc-r4d-dead-params branch from 64840a1 to 639f853 Compare August 29, 2026 08:32
@ch-wan
ch-wan force-pushed the cheng/gc-r4c-bag-readers branch from e714b72 to dd4bc95 Compare August 29, 2026 08:50
@ch-wan
ch-wan force-pushed the cheng/gc-r4d-dead-params branch from 639f853 to 6da72b0 Compare August 29, 2026 08:50
@ch-wan
ch-wan force-pushed the cheng/gc-r4c-bag-readers branch from dd4bc95 to 22f94e0 Compare August 29, 2026 11:18
Base automatically changed from cheng/gc-r4c-bag-readers to main August 29, 2026 11:19
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
ch-wan force-pushed the cheng/gc-r4d-dead-params branch from 6da72b0 to ca3b805 Compare August 29, 2026 11:20
@ch-wan
ch-wan merged commit f0d621c into main Aug 29, 2026
19 of 23 checks passed
@ch-wan
ch-wan deleted the cheng/gc-r4d-dead-params branch August 29, 2026 11:20
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hicache Hierarchical Caching for SGLang unified-radix-cache

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant