{"record":{"id":"3fa9044171df46fc","repo":"sgl-project/sglang","slug":"quantized-tensor-maps-to-a-non-weight-parameter","errorCode":null,"errorMessage":"quantized tensor maps to a non-weight parameter: {tensor.name}","messagePattern":"quantized tensor maps to a non-weight parameter: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/model_loader/expert_pack_loader.py","lineNumber":101,"sourceCode":"    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:\n        if routed_expert_tensor(tensor.name) is not None:\n            continue\n        weight_type = tensor.tensor_type\n        if weight_type.name == \"Q8_0\":\n            component = _compressor_component(tensor.name)\n            if component == \"gate\":\n                continue\n            checkpoint_name = (\n                _fused_compressor_name(mapping[tensor.name])\n                if component == \"kv\"\n                else mapping[tensor.name]\n            )\n            if not checkpoint_name.endswith(\".weight\"):\n                raise ValueError(\n                    f\"quantized tensor maps to a non-weight parameter: {tensor.name}\"\n                )\n            yield (\n                checkpoint_name.removesuffix(\"weight\") + \"qweight_type\",\n                torch.tensor(int(weight_type), dtype=torch.uint8),\n            )\n\n    for tensor in reader.tensors:\n        if routed_expert_tensor(tensor.name) is not None:\n            continue\n        checkpoint_name = mapping[tensor.name]\n        weight_type = tensor.tensor_type\n        if weight_type.name == \"Q8_0\":\n            component = _compressor_component(tensor.name)\n            if component == \"gate\":\n                continue\n            if component == \"kv\":\n                gate_name = tensor.name.replace(\"_compressor_kv\", \"_compressor_gate\")","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/model_loader/expert_pack_loader.py#L83-L119","documentation":"While yielding quantized weight metadata for DeepSeek GGUF expert-pack loading, a GGUF tensor mapped to a checkpoint name that doesn't end in '.weight'. Since only real weight parameters should carry a qweight_type entry, the loader raises ValueError to flag a mis-mapped tensor (e.g. mapped onto a bias, norm, or malformed name).","triggerScenarios":"Calling load_model via deepseek4_nonexpert_weights_iterator where a quantized tensor's resolved checkpoint_name lacks the '.weight' suffix — usually because the name map returned a '.bias'/'.norm' style name or a truncated/renamed key.","commonSituations":"GGUF name map drift across gguf package versions, quantized GGUF conversions with suffixed names (.weight_scale_and_zero, .qweight), or an alias collision in the mapping.","solutions":["Log/inspect tensor.name and its mapped checkpoint_name to see what it resolved to","Pin the gguf package version compatible with this sglang release","Re-convert weights to GGUF using a converter matched to your sglang version","Upgrade sglang if newer GGUF quantized naming schemes are supported"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"assert checkpoint_name.endswith('.weight'), (\n    f'quantized tensor maps to non-weight param: {checkpoint_name}')","typeGuard":"def is_weight_param_name(name: str) -> bool:\n    return name.endswith('.weight')","tryCatchPattern":null,"preventionTips":["Dry-run the GGUF->checkpoint mapping and assert all quantized tensors map to .weight names","Pin gguf package version; re-convert quantized GGUF with supported tools","Upgrade sglang before loading newly released quantized GGUF variants"],"tags":["gguf","deepseek","quantization","weight-mapping"],"backgroundTag":"unexpected-checkpoint-name","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}