{"record":{"id":"393f8cc48a6f77f5","repo":"sgl-project/sglang","slug":"invalid-compressor-checkpoint-name-checkpoint-na","errorCode":null,"errorMessage":"invalid compressor checkpoint name: {checkpoint_name}","messagePattern":"invalid compressor checkpoint name: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/model_loader/expert_pack_loader.py","lineNumber":69,"sourceCode":"    if raw.dtype != np.uint8 or raw.shape[-1] % 2:\n        raise ValueError(\"GGUF BF16 payload does not have a byte-pair layout\")\n    values = raw.view(np.uint16).reshape(*raw.shape[:-1], raw.shape[-1] // 2)\n    return torch.from_numpy(values.copy()).view(torch.bfloat16)\n\n\ndef _compressor_component(source_name: str) -> str | None:\n    if \"_compressor_kv.weight\" in source_name:\n        return \"kv\"\n    if \"_compressor_gate.weight\" in source_name:\n        return \"gate\"\n    return None\n\n\ndef _fused_compressor_name(checkpoint_name: str) -> str:\n    result = checkpoint_name.replace(\".wkv.weight\", \".wkv_gate.weight\")\n    result = result.replace(\".wgate.weight\", \".wkv_gate.weight\")\n    if result == checkpoint_name:\n        raise ValueError(f\"invalid compressor checkpoint name: {checkpoint_name}\")\n    return result\n\n\ndef deepseek4_nonexpert_weights_iterator(\n    source_path: str | os.PathLike[str],\n    num_layers: int,\n) -> Generator[Tuple[str, torch.Tensor], None, None]:\n    \"\"\"Yield exact non-routed tensors without materializing routed experts.\"\"\"\n\n    import gguf\n\n    reader = gguf.GGUFReader(str(source_path), mode=\"r\")\n    names = [tensor.name for tensor in reader.tensors]\n    mapping = build_deepseek4_checkpoint_name_map(gguf, names, num_layers)\n    tensors = {tensor.name: tensor for tensor in reader.tensors}\n\n    # GGUF quant methods must know the type before the raw qweight arrives.\n    for tensor in reader.tensors:","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/model_loader/expert_pack_loader.py#L51-L87","documentation":"_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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"def is_compressor_checkpoint_name(name: str) -> bool:\n    return '.wkv.weight' in name or '.wgate.weight' in name\nassert is_compressor_checkpoint_name(mapped_name), f'unexpected compressor name: {mapped_name}'","typeGuard":"def is_fusable_compressor_name(name: str) -> bool:\n    return '.wkv.weight' in name or '.wgate.weight' in name","tryCatchPattern":null,"preventionTips":["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"],"tags":["gguf","deepseek","compressor","name-mapping"],"backgroundTag":"unexpected-checkpoint-name","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}