sgl-project/sglang · critical · ValueError
Kimi expert-pack role sizes do not match object bytes
Error message
Kimi expert-pack role sizes do not match object bytes
What it means
The sum of per-role byte sizes (role_nbytes summed over KIMI_PHYSICAL_ROLES) does not equal the manifest's expert_pack.object_bytes. This means the declared per-tensor sizes are internally inconsistent with the declared payload size, indicating a corrupt or miscomputed manifest.
Source
Thrown at python/sglang/srt/layers/moe/expert_pack.py:795
):
raise ValueError(f"Kimi expert-pack {role} quant type is unsupported")
expected_entry_count = len(active_layers) * expected_experts * len(ROLE_NAMES)
index_digest = hashlib.sha256()
self.entries: dict[tuple[int, int, int], ExpertPackEntry] = {}
self.object_offsets: dict[tuple[int, int], int] = {}
object_payload_bytes = int(pack_manifest["object_bytes"])
previous_end = int(pack_manifest["data_start"])
role_offsets: dict[str, int] = {}
role_nbytes = {
role: int(roles[role]["expert_bytes"]) for role in KIMI_PHYSICAL_ROLES
}
running_role_offset = 0
for role in KIMI_PHYSICAL_ROLES:
role_offsets[role] = running_role_offset
running_role_offset += role_nbytes[role]
if running_role_offset != object_payload_bytes:
raise ValueError("Kimi expert-pack role sizes do not match object bytes")
with self.path.open("rb", buffering=0) as stream:
raw_header = stream.read(GGML_PACK_HEADER.size)
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")
View on GitHub (pinned to 0132848349)
Solutions
- Regenerate the manifest with the official packing tool so role sizes and object_bytes are computed consistently
- Check that num_experts, intermediate size, and quant block-size math used to compute role_nbytes match the actual pack
Defensive patterns
Strategy: validation
Validate before calling
total = sum(role_nbytes[r] for r in KIMI_PHYSICAL_ROLES) assert total == int(manifest['expert_pack']['object_bytes'])
Prevention
- Never edit role size fields in the manifest
- Regenerate manifests with the packing tool after any change
When it happens
Trigger: Manifest where role sizes were edited or computed with wrong shard counts (experts, hidden dims, quant block sizes) so their sum diverges from object_bytes.
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 header is truncated
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/ab6f1d63a34a84e8.
Report an issue: GitHub.