sgl-project/sglang · critical · ValueError
Weight {name} not found in params_dict
Error message
Weight {name} not found in params_dict What it means
Identical guard to other multimodal loaders: while loading the vision tower of Step3p7, every vision checkpoint key must match a named parameter of the model or loading fails.
Source
Thrown at python/sglang/srt/models/step3p7.py:190
if "vision_model" in name or "vit_large_projector" in name:
# Strip leading "model." for vision weights (NVFP4 format)
if name.startswith("model."):
name = name[len("model.") :]
name = name.replace(r".attn.in_proj_weight", r".attn.qkv_proj.weight")
name = name.replace(r".attn.in_proj_bias", r".attn.qkv_proj.bias")
name = name.replace(r".attn.out_proj.bias", r".attn.proj.bias")
name = name.replace(r".attn.out_proj.weight", r".attn.proj.weight")
name = name.replace(".mlp.c_fc", ".mlp.fc1")
name = name.replace(".mlp.c_proj", ".mlp.fc2")
vision_weights.append((name, loaded_weight))
else:
language_weights.append((name, loaded_weight))
# Load vision tower weights
params_dict = dict(self.named_parameters(remove_duplicate=False))
for name, loaded_weight in vision_weights:
if name not in params_dict:
raise ValueError(f"Weight {name} not found in params_dict")
param = params_dict[name]
weight_loader = getattr(param, "weight_loader", default_weight_loader)
weight_loader(param, loaded_weight)
# Load language model weights
if language_weights:
self.language_model.load_weights(language_weights)
EntryClass = Step3p7ForConditionalGeneration
View on GitHub (pinned to 0132848349)
Solutions
- Diff checkpoint vision keys vs model named_parameters and fix naming/config
- Confirm vision_config in config.json matches the trained model
- Filter or remap known-renamed vision weights in load_weights
Example fix
# debug ck = set(n for n,_ in vision_weights) mp = set(dict(self.named_parameters(remove_duplicate=False))) print(sorted(ck - mp))
Defensive patterns
Strategy: validation
Validate before calling
missing = {n for n,_ in vision_weights} - set(dict(model.named_parameters(remove_duplicate=False)))
if missing: print('unmapped:', sorted(missing)[:10]) Prevention
- Key-diff checkpoint vs model before loading
- Keep vision_config aligned with trained tower
When it happens
Trigger: Step3p7 checkpoint vision keys that don't match model parameter names (renamed modules, different vision_config, extra keys).
Common situations: Checkpoint/model revision skew; vision config fields (hidden size, num heads) producing differently-named or absent modules.
Related errors
- Weight {name} not found in params_dict
- Incomplete Diffusers H3 fused parameters: {incomplete}
- qkv weight has incompatible output dim for grouped checkpoin
- Some weights are not initialized from checkpoints: {unloaded
- Only 1 nextn layer is supported for Step3p5 checkpoints.
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/f7892604b2070bea.
Report an issue: GitHub.