{"record":{"id":"8815faa89f1151f9","repo":"sgl-project/sglang","slug":"no-deepseek-v4-checkpoint-mapping-for-len-missing","errorCode":null,"errorMessage":"No DeepSeek-V4 checkpoint mapping for {len(missing)} GGUF tensors: {preview}","messagePattern":"No DeepSeek-V4 checkpoint mapping for (.+?) GGUF tensors: (.+?)","errorType":"panic","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/model_loader/deepseek4_gguf.py","lineNumber":177,"sourceCode":"                checkpoint_name = alias\n                if suffix and not alias.endswith(f\".{suffix}\"):\n                    checkpoint_name += f\".{suffix}\"\n\n        if checkpoint_name is None:\n            missing.append(tensor_name)\n            continue\n        if checkpoint_name in reverse:\n            other = reverse[checkpoint_name]\n            raise RuntimeError(\n                \"DeepSeek-V4 GGUF mapping collision: \"\n                f\"{other!r} and {tensor_name!r} -> {checkpoint_name!r}\"\n            )\n        result[tensor_name] = checkpoint_name\n        reverse[checkpoint_name] = tensor_name\n\n    if missing:\n        preview = \", \".join(repr(name) for name in missing[:8])\n        raise RuntimeError(\n            f\"No DeepSeek-V4 checkpoint mapping for {len(missing)} GGUF tensors: \"\n            f\"{preview}\"\n        )\n    return result\n","sourceCodeStart":159,"sourceCodeEnd":182,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/model_loader/deepseek4_gguf.py#L159-L182","documentation":"After mapping GGUF tensors to checkpoint names, some GGUF tensors had no checkpoint counterpart and are listed (up to 8) in this RuntimeError. The DeepSeek-V4 GGUF loader requires a complete, exhaustive mapping, so unmapped tensors — typically new/renamed tensor types in a newer GGUF conversion — abort loading.","triggerScenarios":"Calling deepseek4_nonexpert_weights_iterator on a GGUF file containing tensor names (e.g. new layer types or renamed keys) that gguf.get_tensor_name_map for DEEPSEEK2 does not map for the given num_layers; the missing list is non-empty.","commonSituations":"GGUF converted by newer llama.cpp with extra tensors (e.g. new norm/attention keys) not in the installed gguf name map, num_layers mismatch with the file, or a gguf package version skew.","solutions":["Match versions: use the gguf package / llama.cpp conversion tool version compatible with this sglang release","Check the preview list of missing tensor names — if they are unused extras, convert the GGUF with flags that omit them or re-convert with the standard script","Verify num_layers passed in matches the GGUF's count.header (llama.cpp inspect) and the model config","Upgrade sglang — newer releases may add mappings for recently added GGUF tensor types"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import gguf\nname_map = gguf.get_tensor_name_map(gguf.MODEL_ARCH.DEEPSEEK2, num_layers)\nreader = gguf.GGUFReader(path)\nunmapped = [t.name for t in reader.tensors if not any(\n    name_map.mapping.get(a) and name_map.mapping[a].name for a in [t.name])]\nif unmapped:\n    print('unmapped tensors present:', unmapped[:8])","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use gguf conversion and reader from the same llama.cpp/gguf version pair","Verify num_layers matches the GGUF header before loading","Test-load each new GGUF file once in a scratch job before deployment"],"tags":["gguf","deepseek","unmapped-tensors","weight-mapping"],"backgroundTag":"unsupported-tensor-names","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}