sgl-project/sglang · error · RuntimeError
DeepSeek-V4 GGUF mapping collision: {other!r} and {tensor_na
Error message
DeepSeek-V4 GGUF mapping collision: {other!r} and {tensor_name!r} -> {checkpoint_name!r} What it means
While building the GGUF->checkpoint tensor name map for DeepSeek-V4, two distinct GGUF tensor names resolved to the same checkpoint parameter name, so the mapping is ambiguous and would silently drop one tensor. The loader raises RuntimeError naming both colliding sources and the shared target rather than risk incorrect weight loading.
Source
Thrown at python/sglang/srt/model_loader/deepseek4_gguf.py:168
reverse: dict[str, str] = {}
missing: list[str] = []
for tensor_name in tensor_names:
checkpoint_name = _v4_checkpoint_name(tensor_name)
if checkpoint_name is None:
base, suffix = _split_suffix(tensor_name)
candidates = aliases_by_gguf_base.get(base, ())
if candidates:
alias = min(candidates, key=_candidate_score)
checkpoint_name = alias
if suffix and not alias.endswith(f".{suffix}"):
checkpoint_name += f".{suffix}"
if checkpoint_name is None:
missing.append(tensor_name)
continue
if checkpoint_name in reverse:
other = reverse[checkpoint_name]
raise RuntimeError(
"DeepSeek-V4 GGUF mapping collision: "
f"{other!r} and {tensor_name!r} -> {checkpoint_name!r}"
)
result[tensor_name] = checkpoint_name
reverse[checkpoint_name] = tensor_name
if missing:
preview = ", ".join(repr(name) for name in missing[:8])
raise RuntimeError(
f"No DeepSeek-V4 checkpoint mapping for {len(missing)} GGUF tensors: "
f"{preview}"
)
return result
View on GitHub (pinned to 0132848349)
Solutions
- Pin the gguf version known to work with this sglang release (check sglang's requirement pin)
- Upgrade (or downgrade) gguf to the version whose DEEPSEEK2 name map matches; inspect gguf.get_tensor_name_map output for the reported tensor names
- If using a custom-converted GGUF, re-convert with an official/compatible convert script
- Report the collision pair from the error message upstream with gguf and sglang versions
Defensive patterns
Strategy: validation
Validate before calling
import gguf
name_map = gguf.get_tensor_name_map(gguf.MODEL_ARCH.DEEPSEEK2, num_layers)
reverse = {}
for alias, m in name_map.mapping.items():
if m.name in reverse:
print('collision:', reverse[m.name], alias, '->', m.name)
reverse[m.name] = alias Prevention
- Pin the gguf version validated for your sglang release in requirements.txt
- Smoke-test GGUF loading on new model files before production
- Report name-map collisions with the exact tensor names to maintainers
When it happens
Trigger: Calling build_deepseek4_checkpoint_name_map (via deepseek4_nonexpert_weights_iterator) with a gguf package whose DeepSeek2 name map maps two GGUF tensor keys (e.g. two compressor/attention aliases) to the same checkpoint name for the given num_layers.
Common situations: A newer/older gguf release changed the DeepSeek name map (added aliases) so two entries now collide with sglang's expectations, or a nonstandard GGUF conversion produced duplicate-mapped tensors.
Related errors
- No DeepSeek-V4 checkpoint mapping for {len(missing)} GGUF te
- quantized tensor maps to a non-weight parameter: {tensor.nam
- GGUF tensors collide after parameter mapping at {alias!r}
- gguf package does not provide the DeepSeek name map
- invalid compressor checkpoint name: {checkpoint_name}
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/01cf206c544a7940.
Report an issue: GitHub.