sgl-project/sglang · error · ValueError
invalid compressor checkpoint name: {checkpoint_name}
Error message
invalid compressor checkpoint name: {checkpoint_name} What it means
_fused_compressor_name expects a compressor checkpoint name containing '.wkv.weight' or '.wgate.weight' and rewrites it to the fused '.wkv_gate.weight' parameter. If neither substring is present the name is unchanged and ValueError is raised, meaning the caller passed a tensor name that isn't a recognized compressor KV/gate weight.
Source
Thrown at python/sglang/srt/model_loader/expert_pack_loader.py:69
if raw.dtype != np.uint8 or raw.shape[-1] % 2:
raise ValueError("GGUF BF16 payload does not have a byte-pair layout")
values = raw.view(np.uint16).reshape(*raw.shape[:-1], raw.shape[-1] // 2)
return torch.from_numpy(values.copy()).view(torch.bfloat16)
def _compressor_component(source_name: str) -> str | None:
if "_compressor_kv.weight" in source_name:
return "kv"
if "_compressor_gate.weight" in source_name:
return "gate"
return None
def _fused_compressor_name(checkpoint_name: str) -> str:
result = checkpoint_name.replace(".wkv.weight", ".wkv_gate.weight")
result = result.replace(".wgate.weight", ".wkv_gate.weight")
if result == checkpoint_name:
raise ValueError(f"invalid compressor checkpoint name: {checkpoint_name}")
return result
def deepseek4_nonexpert_weights_iterator(
source_path: str | os.PathLike[str],
num_layers: int,
) -> Generator[Tuple[str, torch.Tensor], None, None]:
"""Yield exact non-routed tensors without materializing routed experts."""
import gguf
reader = gguf.GGUFReader(str(source_path), mode="r")
names = [tensor.name for tensor in reader.tensors]
mapping = build_deepseek4_checkpoint_name_map(gguf, names, num_layers)
tensors = {tensor.name: tensor for tensor in reader.tensors}
# GGUF quant methods must know the type before the raw qweight arrives.
for tensor in reader.tensors:View on GitHub (pinned to 0132848349)
Solutions
- Inspect the failing checkpoint_name in the message and compare with the expected compressor naming (model.layers.N....wkv.weight / .wgate.weight)
- Align gguf package and sglang versions so the name map yields expected suffixes
- If loading a quantized compressor variant, use a loader path that supports it or dequantize first
- Re-convert the GGUF with a compatible converter so names keep the .wkv/.wgate convention
Defensive patterns
Strategy: validation
Validate before calling
def is_compressor_checkpoint_name(name: str) -> bool:
return '.wkv.weight' in name or '.wgate.weight' in name
assert is_compressor_checkpoint_name(mapped_name), f'unexpected compressor name: {mapped_name}' Type guard
def is_fusable_compressor_name(name: str) -> bool:
return '.wkv.weight' in name or '.wgate.weight' in name Prevention
- Pin compatible gguf/sglang version pairs
- Inspect mapped names in a dry-run pass before load_model
- Re-convert GGUF with official scripts to preserve naming conventions
When it happens
Trigger: deepseek4_nonexpert_weights_iterator processing a tensor whose source name matched the compressor-kv detector (contains '_compressor_kv.weight') but whose mapped checkpoint name contains neither .wkv.weight nor .wgate.weight — e.g. due to name map drift or unexpected quantized suffixes like .wkv.qweight.
Common situations: gguf name-map version skew producing unexpected checkpoint names, quantized GGUF variants with altered suffixes (qweight/weight_format), or model conversions that rename compressor weights.
Related errors
- gguf package does not provide the DeepSeek name map
- DeepSeek-V4 GGUF mapping collision: {other!r} and {tensor_na
- No DeepSeek-V4 checkpoint mapping for {len(missing)} GGUF te
- quantized tensor maps to a non-weight parameter: {tensor.nam
- sparse_attn_v4_paged_decode expects fp16/bf16 q, got {q.dtyp
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/393f8cc48a6f77f5.
Report an issue: GitHub.