cleanup(models): remove dead code from the model definitions #2843
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.47) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 348 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.350
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #2843"
general
weight: 0.35
claude[bot]
Removes code in
python/tokenspeed/runtime/models/that nothing calls or reads: 27 files, +8 −550, no behavior change. Each item was checked by a repository-wide search (including string lookups) and by scanning every constructor,load_weightsandself.model(...)call site.| Removed | Why it is dead |
| --- | --- |
|
pad_input_idson 11 models (+ the imports it alone used) | no caller anywhere ||
Qwen3_5ForCausalLM.load_weights,Qwen3_5MoeModel.load_weights(~160 lines) | the loader calls only the top-level model; no wrapper or subclass delegates to them ||
default_bitsandbytes_target_modulesandbitsandbytes_stacked_params_mapping| no reader ||
fall_back_to_pt_during_load = False×6 | the loader reads it from the top-level model with defaultFalse||
model=,_model_overrideandresolve_modeloverrides (DeepSeek-V3, GLM-5, LongCat) | no caller passesmodel=; the overrides equalBaseCausalLM.resolve_model||
start_layerandend_layer(Kimi-K2.5, Qwen3-ASR) and thehasattr(self.model, "start_layer")filters in five loaders | no backbone definesstart_layer, so the filters never run || Kimi-K2.5
mm_projector,get_image_feature| no reader; its image encoder isvision.embed_media|| DeepSeek-V3
input_layer_norm_fn,cli_factor,padding_id(also GLM-5, LongCat) | no reader || GPT-OSS
_WeightCreator(+3maybe_materializecalls),get_attention_sliding_window_sizemethod,is_nextn| never instantiated, called, or passed || registry "failed to be inspected" raise,
\| strvalue type | unreachable: every listed architecture resolves first ||
FLASHForCausalLMalias | not inEntryClass, no reference ||
is_mtp, inner-NextNinput_embeds,vocab_size,vl_config,window_size,is_multimodal, pass-through__init__s,ExtensibleLM.step| never passed or never read |The 8 added lines are the collapses those removals leave behind (e.g. the NextN
if input_embeds is Nonebranch becomeshidden_states = self.embed_tokens(input_ids)). Kept on purpose: theQuantMixtralForCausalLMremap inmodel_loader/utils.py, since a plugin may register that architecture.Validation (GB200)
test_mla_lora_scale::test_runtime_scale_matches_the_folded_weights_up_to_bf16_rounding,test_k3_moe_tail_tier::test_model_prepares_routed_workspace_at_serving_limit,test_modelopt_mixed_config::test_attention_dp_lm_head_uses_mixed_quantization) are pre-existing. The Inkling engine tests failed on the base only because two runs launched engines on one node at once; run alone they pass on both (15 of 15).pre-commit run --all-filesclean.