sgl-project/sglang · error · ValueError

Kimi-K3 manifest is incomplete

Error message

Kimi-K3 manifest is incomplete

What it means

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.

Source

Thrown at python/sglang/srt/model_loader/kimi_k3_gguf.py:150

        raise ValueError("Kimi-K3 GGUF ssm_a must contain finite floating values")
    if not torch.all(raw < 0):
        raise ValueError("Kimi-K3 GGUF ssm_a must contain only -exp(A_log) values")
    return torch.log(-raw)


def kimi_k3_nonexpert_weights_iterator(
    manifest_path: str | os.PathLike[str],
) -> Generator[tuple[str, torch.Tensor], None, None]:
    """Stream non-routed tensors shard by shard without reading routed payloads."""

    import gguf

    manifest_file = Path(manifest_path).resolve()
    manifest = json.loads(manifest_file.read_text(encoding="utf-8"))
    if manifest.get("format") != "SGLANG-KIMI-GGMLMOEPACK-ADAPTER-v1":
        raise ValueError("Kimi-K3 manifest format is unsupported")
    if not manifest.get("complete"):
        raise ValueError("Kimi-K3 manifest is incomplete")

    records_by_shard: dict[int, list[dict]] = defaultdict(list)
    for record in manifest["source"]["tensors"]:
        records_by_shard[int(record["shard_index"])].append(record)

    emitted: set[str] = set()
    for shard in manifest["source"]["shards"]:
        shard_index = int(shard["index"])
        shard_path = Path(shard["path"]).resolve()
        if not shard_path.is_file() or shard_path.stat().st_size != int(shard["size"]):
            raise FileNotFoundError(
                f"Kimi-K3 GGUF shard is missing or changed: {shard_path}"
            )
        reader = gguf.GGUFReader(str(shard_path), mode="r")
        tensors = {tensor.name: tensor for tensor in reader.tensors}
        expected = {record["name"]: record for record in records_by_shard[shard_index]}
        if set(tensors) != set(expected):
            raise ValueError(f"Kimi-K3 GGUF shard inventory changed: {shard_path}")

View on GitHub (pinned to 0132848349)

Solutions

  1. Re-run the full conversion end-to-end so it can set complete: true on success.
  2. Free disk space / fix the cause of the interrupted run before re-converting.
  3. Do not manually flip complete to true — the shards themselves may be partial.
Defensive patterns

Strategy: validation

Validate before calling

assert manifest.get("complete") is True, "conversion incomplete; re-run the packer"

Type guard

def is_complete_manifest(m: dict) -> bool:
    return m.get("complete") is True

Prevention

When it happens

Trigger: 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.

Common situations: Disk-full or OOM kill during GGUF->MoEPack conversion; copying the output directory before conversion finishes.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/7702132a390b5a91. Report an issue: GitHub.