{"record":{"id":"7702132a390b5a91","repo":"sgl-project/sglang","slug":"kimi-k3-manifest-is-incomplete","errorCode":null,"errorMessage":"Kimi-K3 manifest is incomplete","messagePattern":"Kimi-K3 manifest is incomplete","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/model_loader/kimi_k3_gguf.py","lineNumber":150,"sourceCode":"        raise ValueError(\"Kimi-K3 GGUF ssm_a must contain finite floating values\")\n    if not torch.all(raw < 0):\n        raise ValueError(\"Kimi-K3 GGUF ssm_a must contain only -exp(A_log) values\")\n    return torch.log(-raw)\n\n\ndef kimi_k3_nonexpert_weights_iterator(\n    manifest_path: str | os.PathLike[str],\n) -> Generator[tuple[str, torch.Tensor], None, None]:\n    \"\"\"Stream non-routed tensors shard by shard without reading routed payloads.\"\"\"\n\n    import gguf\n\n    manifest_file = Path(manifest_path).resolve()\n    manifest = json.loads(manifest_file.read_text(encoding=\"utf-8\"))\n    if manifest.get(\"format\") != \"SGLANG-KIMI-GGMLMOEPACK-ADAPTER-v1\":\n        raise ValueError(\"Kimi-K3 manifest format is unsupported\")\n    if not manifest.get(\"complete\"):\n        raise ValueError(\"Kimi-K3 manifest is incomplete\")\n\n    records_by_shard: dict[int, list[dict]] = defaultdict(list)\n    for record in manifest[\"source\"][\"tensors\"]:\n        records_by_shard[int(record[\"shard_index\"])].append(record)\n\n    emitted: set[str] = set()\n    for shard in manifest[\"source\"][\"shards\"]:\n        shard_index = int(shard[\"index\"])\n        shard_path = Path(shard[\"path\"]).resolve()\n        if not shard_path.is_file() or shard_path.stat().st_size != int(shard[\"size\"]):\n            raise FileNotFoundError(\n                f\"Kimi-K3 GGUF shard is missing or changed: {shard_path}\"\n            )\n        reader = gguf.GGUFReader(str(shard_path), mode=\"r\")\n        tensors = {tensor.name: tensor for tensor in reader.tensors}\n        expected = {record[\"name\"]: record for record in records_by_shard[shard_index]}\n        if set(tensors) != set(expected):\n            raise ValueError(f\"Kimi-K3 GGUF shard inventory changed: {shard_path}\")","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/model_loader/kimi_k3_gguf.py#L132-L168","documentation":"The manifest must have complete: true. The converter writes complete=false (or omits it) when the multi-shard packing was interrupted, so loading would silently use partial weights; the loader refuses.","triggerScenarios":"Loading a manifest from a conversion run that crashed or was Ctrl-C'd partway through writing shards; manifest written with complete flag missing/false.","commonSituations":"Disk-full or OOM kill during GGUF->MoEPack conversion; copying the output directory before conversion finishes.","solutions":["Re-run the full conversion end-to-end so it can set complete: true on success.","Free disk space / fix the cause of the interrupted run before re-converting.","Do not manually flip complete to true — the shards themselves may be partial."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"assert manifest.get(\"complete\") is True, \"conversion incomplete; re-run the packer\"","typeGuard":"def is_complete_manifest(m: dict) -> bool:\n    return m.get(\"complete\") is True","tryCatchPattern":null,"preventionTips":["Treat an incomplete manifest as a failed conversion; always re-run it.","Never hand-edit complete to true."],"tags":["kimi-k3","gguf","manifest","incomplete-conversion"],"backgroundTag":"incomplete-file-transfer","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}