sgl-project/sglang · critical · ValueError
Kimi expert-pack index is truncated
Error message
Kimi expert-pack index is truncated
What it means
While iterating the index entries (index_count of them from the header), a read of GGML_PACK_ENTRY.size bytes came back short — the index region is truncated relative to the declared entry count. The file ends before the full index.
Source
Thrown at python/sglang/srt/layers/moe/expert_pack.py:817
if len(raw_header) != GGML_PACK_HEADER.size:
raise ValueError("Kimi expert-pack header is truncated")
index_digest.update(raw_header)
magic, version, header_size, index_count, data_start = (
GGML_PACK_HEADER.unpack(raw_header)
)
if (
magic != GGML_PACK_MAGIC
or version != 1
or header_size != GGML_PACK_HEADER.size
or index_count != expected_entry_count
or data_start != int(pack_manifest["data_start"])
):
raise ValueError("Kimi expert-pack header does not match its manifest")
for index in range(index_count):
raw_entry = stream.read(GGML_PACK_ENTRY.size)
if len(raw_entry) != GGML_PACK_ENTRY.size:
raise ValueError("Kimi expert-pack index is truncated")
index_digest.update(raw_entry)
name_raw, expert, reserved, offset, nbytes = GGML_PACK_ENTRY.unpack(
raw_entry
)
object_index, physical_role_id = divmod(index, len(KIMI_PHYSICAL_ROLES))
layer_index, expected_expert = divmod(object_index, expected_experts)
layer = active_layers[layer_index]
physical_role = KIMI_PHYSICAL_ROLES[physical_role_id]
name = _fixed_string(name_raw)
match = KIMI_EXPERT_RE.fullmatch(name)
if (
match is None
or int(match.group("layer")) != layer
or match.group("role") != physical_role
or expert != expected_expert
or reserved != 0
):
raise ValueError(View on GitHub (pinned to 0132848349)
Solutions
- Re-download/rebuild the pack; verify full file size and SHA-256 against the manifest before loading
- If self-produced, re-run packing ensuring all 92 layers x experts x roles entries were written
Defensive patterns
Strategy: validation
Validate before calling
min_size = data_start + index_count * ENTRY_SIZE assert pack_path.stat().st_size >= min_size, 'index region truncated'
Prevention
- Validate total file size covers header + index + payload before loading
When it happens
Trigger: File truncated mid-index (partial download), or header index_count inflated relative to actual entries; also follows from a data_start/size mismatch upstream.
Common situations: See trigger scenarios.
Related errors
- Kimi active routed MoE layers must be exactly 1..92
- Kimi manifest expert-pack path does not match pack_path
- Kimi expert-pack size does not match its manifest
- Kimi expert-pack physical role order is unsupported
- Kimi expert-pack role sizes do not match object bytes
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/795f16e6bc5ddb94.
Report an issue: GitHub.