{
  "hf_id": "moonshotai/Kimi-K3.1-Pro",
  "meta": {
    "title": "Kimi-K3.1-Pro",
    "slug": "kimi-k3.1-pro",
    "provider": "Moonshot AI",
    "description": "2.8T-parameter native multimodal MoE with Kimi Delta Attention, sparse MLA, and a 1M-token context window",
    "date_added": "2026-11-02",
    "date_updated": "2026-11-08",
    "tasks": [
      "multimodal",
      "text"
    ],
    "performance_headline": "TP8 on two GB300 trays or one B300 node, or one MI355X node, for the MXFP4 checkpoint; TP32 on a 4-host TPU slice",
    "related_recipes": [
      "moonshotai/Kimi-K3"
    ],
    "default_hardware": "gb300",
    "hardware": {
      "gb300": "verified",
      "vr200": "supported",
      "810e": "verified",
      "m890": "verified",
      "ironwood": "supported"
    }
  },
  "recommended_command": {
    "hardware": "gb300",
    "strategy": "multi_node_tp",
    "variant": "default",
    "node_count": 2,
    "deploy_type": "multi_node",
    "env": {
      "GLOO_SOCKET_IFNAME": "$IFACE_NAME",
      "NCCL_SOCKET_IFNAME": "$IFACE_NAME",
      "VLLM_ENGINE_READY_TIMEOUT_S": "3600"
    },
    "docker_image": "vllm/vllm-openai:kimi-k31",
    "head_command": "vllm serve moonshotai/Kimi-K3.1-Pro \\\n  --trust-remote-code \\\n  --tensor-parallel-size 8 \\\n  --nnodes 2 \\\n  --node-rank 0 \\\n  --master-addr $HEAD_IP \\\n  --load-format fastsafetensors \\\n  --enable-auto-tool-choice \\\n  --tool-call-parser kimi_k3 \\\n  --reasoning-parser kimi_k3",
    "worker_command": "vllm serve moonshotai/Kimi-K3.1-Pro \\\n  --trust-remote-code \\\n  --tensor-parallel-size 8 \\\n  --nnodes 2 \\\n  --node-rank 1 \\\n  --master-addr $HEAD_IP \\\n  --headless \\\n  --load-format fastsafetensors \\\n  --enable-auto-tool-choice \\\n  --tool-call-parser kimi_k3 \\\n  --reasoning-parser kimi_k3",
    "worker_commands": [
      "vllm serve moonshotai/Kimi-K3.1-Pro \\\n  --trust-remote-code \\\n  --tensor-parallel-size 8 \\\n  --nnodes 2 \\\n  --node-rank 1 \\\n  --master-addr $HEAD_IP \\\n  --headless \\\n  --load-format fastsafetensors \\\n  --enable-auto-tool-choice \\\n  --tool-call-parser kimi_k3 \\\n  --reasoning-parser kimi_k3"
    ],
    "head_argv": [
      "vllm",
      "serve",
      "moonshotai/Kimi-K3.1-Pro",
      "--trust-remote-code",
      "--tensor-parallel-size",
      "8",
      "--nnodes",
      "2",
      "--node-rank",
      "0",
      "--master-addr",
      "$HEAD_IP",
      "--load-format",
      "fastsafetensors",
      "--enable-auto-tool-choice",
      "--tool-call-parser",
      "kimi_k3",
      "--reasoning-parser",
      "kimi_k3"
    ],
    "worker_argv": [
      "vllm",
      "serve",
      "moonshotai/Kimi-K3.1-Pro",
      "--trust-remote-code",
      "--tensor-parallel-size",
      "8",
      "--nnodes",
      "2",
      "--node-rank",
      "1",
      "--master-addr",
      "$HEAD_IP",
      "--headless",
      "--load-format",
      "fastsafetensors",
      "--enable-auto-tool-choice",
      "--tool-call-parser",
      "kimi_k3",
      "--reasoning-parser",
      "kimi_k3"
    ],
    "worker_argvs": [
      [
        "vllm",
        "serve",
        "moonshotai/Kimi-K3.1-Pro",
        "--trust-remote-code",
        "--tensor-parallel-size",
        "8",
        "--nnodes",
        "2",
        "--node-rank",
        "1",
        "--master-addr",
        "$HEAD_IP",
        "--headless",
        "--load-format",
        "fastsafetensors",
        "--enable-auto-tool-choice",
        "--tool-call-parser",
        "kimi_k3",
        "--reasoning-parser",
        "kimi_k3"
      ]
    ],
    "head_docker_command": "docker run --gpus all \\\n  --privileged --ipc=host -p 8000:8000 \\\n  -v ~/.cache/huggingface:/root/.cache/huggingface \\\n  -e GLOO_SOCKET_IFNAME=$IFACE_NAME \\\n  -e NCCL_SOCKET_IFNAME=$IFACE_NAME \\\n  -e VLLM_ENGINE_READY_TIMEOUT_S=3600 \\\n  vllm/vllm-openai:kimi-k31 moonshotai/Kimi-K3.1-Pro \\\n  --trust-remote-code \\\n  --tensor-parallel-size 8 \\\n  --nnodes 2 \\\n  --node-rank 0 \\\n  --master-addr $HEAD_IP \\\n  --load-format fastsafetensors \\\n  --enable-auto-tool-choice \\\n  --tool-call-parser kimi_k3 \\\n  --reasoning-parser kimi_k3",
    "worker_docker_command": "docker run --gpus all \\\n  --privileged --ipc=host -p 8000:8000 \\\n  -v ~/.cache/huggingface:/root/.cache/huggingface \\\n  -e GLOO_SOCKET_IFNAME=$IFACE_NAME \\\n  -e NCCL_SOCKET_IFNAME=$IFACE_NAME \\\n  -e VLLM_ENGINE_READY_TIMEOUT_S=3600 \\\n  vllm/vllm-openai:kimi-k31 moonshotai/Kimi-K3.1-Pro \\\n  --trust-remote-code \\\n  --tensor-parallel-size 8 \\\n  --nnodes 2 \\\n  --node-rank 1 \\\n  --master-addr $HEAD_IP \\\n  --headless \\\n  --load-format fastsafetensors \\\n  --enable-auto-tool-choice \\\n  --tool-call-parser kimi_k3 \\\n  --reasoning-parser kimi_k3",
    "worker_docker_commands": [
      "docker run --gpus all \\\n  --privileged --ipc=host -p 8000:8000 \\\n  -v ~/.cache/huggingface:/root/.cache/huggingface \\\n  -e GLOO_SOCKET_IFNAME=$IFACE_NAME \\\n  -e NCCL_SOCKET_IFNAME=$IFACE_NAME \\\n  -e VLLM_ENGINE_READY_TIMEOUT_S=3600 \\\n  vllm/vllm-openai:kimi-k31 moonshotai/Kimi-K3.1-Pro \\\n  --trust-remote-code \\\n  --tensor-parallel-size 8 \\\n  --nnodes 2 \\\n  --node-rank 1 \\\n  --master-addr $HEAD_IP \\\n  --headless \\\n  --load-format fastsafetensors \\\n  --enable-auto-tool-choice \\\n  --tool-call-parser kimi_k3 \\\n  --reasoning-parser kimi_k3"
    ],
    "head_docker_argv": [
      "docker",
      "run",
      "--gpus",
      "all",
      "--privileged",
      "--ipc=host",
      "-p",
      "8000:8000",
      "-v",
      "~/.cache/huggingface:/root/.cache/huggingface",
      "-e",
      "GLOO_SOCKET_IFNAME=$IFACE_NAME",
      "-e",
      "NCCL_SOCKET_IFNAME=$IFACE_NAME",
      "-e",
      "VLLM_ENGINE_READY_TIMEOUT_S=3600",
      "vllm/vllm-openai:kimi-k31",
      "moonshotai/Kimi-K3.1-Pro",
      "--trust-remote-code",
      "--tensor-parallel-size",
      "8",
      "--nnodes",
      "2",
      "--node-rank",
      "0",
      "--master-addr",
      "$HEAD_IP",
      "--load-format",
      "fastsafetensors",
      "--enable-auto-tool-choice",
      "--tool-call-parser",
      "kimi_k3",
      "--reasoning-parser",
      "kimi_k3"
    ],
    "worker_docker_argv": [
      "docker",
      "run",
      "--gpus",
      "all",
      "--privileged",
      "--ipc=host",
      "-p",
      "8000:8000",
      "-v",
      "~/.cache/huggingface:/root/.cache/huggingface",
      "-e",
      "GLOO_SOCKET_IFNAME=$IFACE_NAME",
      "-e",
      "NCCL_SOCKET_IFNAME=$IFACE_NAME",
      "-e",
      "VLLM_ENGINE_READY_TIMEOUT_S=3600",
      "vllm/vllm-openai:kimi-k31",
      "moonshotai/Kimi-K3.1-Pro",
      "--trust-remote-code",
      "--tensor-parallel-size",
      "8",
      "--nnodes",
      "2",
      "--node-rank",
      "1",
      "--master-addr",
      "$HEAD_IP",
      "--headless",
      "--load-format",
      "fastsafetensors",
      "--enable-auto-tool-choice",
      "--tool-call-parser",
      "kimi_k3",
      "--reasoning-parser",
      "kimi_k3"
    ],
    "worker_docker_argvs": [
      [
        "docker",
        "run",
        "--gpus",
        "all",
        "--privileged",
        "--ipc=host",
        "-p",
        "8000:8000",
        "-v",
        "~/.cache/huggingface:/root/.cache/huggingface",
        "-e",
        "GLOO_SOCKET_IFNAME=$IFACE_NAME",
        "-e",
        "NCCL_SOCKET_IFNAME=$IFACE_NAME",
        "-e",
        "VLLM_ENGINE_READY_TIMEOUT_S=3600",
        "vllm/vllm-openai:kimi-k31",
        "moonshotai/Kimi-K3.1-Pro",
        "--trust-remote-code",
        "--tensor-parallel-size",
        "8",
        "--nnodes",
        "2",
        "--node-rank",
        "1",
        "--master-addr",
        "$HEAD_IP",
        "--headless",
        "--load-format",
        "fastsafetensors",
        "--enable-auto-tool-choice",
        "--tool-call-parser",
        "kimi_k3",
        "--reasoning-parser",
        "kimi_k3"
      ]
    ],
    "strategy_spec": {
      "name": "multi_node_tp",
      "deploy_type": "multi_node",
      "display_name": "Multi-Node Tensor Parallel",
      "short_label": "Multi-node TP",
      "orientation": "latency",
      "description": "Multi-node TP. Splits the model across GPUs spanning multiple nodes. TP is set to total GPU count across all nodes. Head node serves requests, worker nodes run with --headless. Requires InfiniBand interconnect.\n",
      "hardware_match": {
        "min_gpus": 2,
        "multi_node": true
      },
      "parallel_flag": "--tensor-parallel-size",
      "env": {
        "GLOO_SOCKET_IFNAME": "$IFACE_NAME",
        "NCCL_SOCKET_IFNAME": "$IFACE_NAME"
      }
    },
    "hardware_profile": {
      "brand": "NVIDIA",
      "generation": "blackwell",
      "compute_arch": "sm103",
      "display_name": "GB300 NVL4",
      "description": "NVIDIA GB300 Grace-Blackwell Ultra compute tray · 288 GB HBM3e/GPU · 4 GPUs (NVL72 tray unit)",
      "gpu_count": 4,
      "vram_gb": 1152,
      "multi_node": false
    },
    "alternatives": {
      "pd_cluster": "/moonshotai/Kimi-K3.1-Pro/strategies/pd_cluster.json",
      "kv_store_centralized_mooncake": "/moonshotai/Kimi-K3.1-Pro/strategies/kv_store_centralized_mooncake.json",
      "kv_store_distributed_mooncake": "/moonshotai/Kimi-K3.1-Pro/strategies/kv_store_distributed_mooncake.json"
    },
    "by_hardware": {
      "gb300": "/moonshotai/Kimi-K3.1-Pro/hw/gb300.json",
      "b300": "/moonshotai/Kimi-K3.1-Pro/hw/b300.json",
      "vr200": "/moonshotai/Kimi-K3.1-Pro/hw/vr200.json",
      "mi355x": "/moonshotai/Kimi-K3.1-Pro/hw/mi355x.json",
      "ironwood": "/moonshotai/Kimi-K3.1-Pro/hw/ironwood.json",
      "810e": "/moonshotai/Kimi-K3.1-Pro/hw/810e.json",
      "m890": "/moonshotai/Kimi-K3.1-Pro/hw/m890.json"
    }
  },
  "model": {
    "model_id": "moonshotai/Kimi-K3.1-Pro",
    "min_vllm_version": "0.34.0",
    "nightly_required": true,
    "docker_image": {
      "nvidia": "vllm/vllm-openai:kimi-k31",
      "amd": "vllm/vllm-openai-rocm:kimi-k31"
    },
    "architecture": "moe",
    "parameter_count": "2.8T",
    "active_parameters": "16 experts/token + shared (of 896 routed)",
    "context_length": 1048576,
    "base_args": [
      "--trust-remote-code"
    ],
    "install": {
      "docker": {
        "command": "docker pull vllm/vllm-openai:kimi-k31"
      }
    }
  },
  "features": {
    "tool_calling": {
      "description": "Enable automatic tool choice with the Kimi K3 tool-call parser.",
      "args": [
        "--enable-auto-tool-choice",
        "--tool-call-parser",
        "kimi_k3"
      ]
    },
    "reasoning": {
      "description": "Parse Kimi K3 reasoning output separately from the final answer.",
      "args": [
        "--reasoning-parser",
        "kimi_k3"
      ]
    },
    "spec_decoding": {
      "description": "Use DSpark speculative decoding with the Kimi-K3.1 draft.",
      "args": [
        "--speculative-config",
        "{\"model\":\"Inferact/Kimi-K3.1-Pro-DSpark-preview\",\"num_speculative_tokens\":5,\"method\":\"dspark\",\"draft_sample_method\":\"probabilistic\"}"
      ],
      "hardware_overrides": {
        "mi355x": {
          "args": [
            "--kv-cache-dtype",
            "fp8",
            "--speculative-config",
            "{\"model\":\"Inferact/Kimi-K3.1-Pro-DSpark-preview\",\"num_speculative_tokens\":5,\"method\":\"dspark\",\"attention_backend\":\"ROCM_AITER_MLA\",\"kv_cache_dtype\":\"fp8\",\"draft_sample_method\":\"probabilistic\"}"
          ]
        }
      },
      "hardware": {
        "ironwood": "unsupported"
      }
    },
    "text_only": {
      "description": "Skip the vision encoder for text-only workloads; frees its memory for KV cache.",
      "hardware": {
        "ironwood": "unsupported"
      },
      "args": [
        "--language-model-only"
      ]
    },
    "low_latency_decode": {
      "label": "Low-latency decode",
      "description": "Run decode steps on the fused latency_specialized decode path (CuTe DSL kernels on NVIDIA, FlyDSL kernels on MI355X). Fastest at low concurrency; needs FULL decode CUDA graphs. On MI355X it needs speculative decoding and at most 16 decode rows per step; see the concurrency-1 preset.",
      "strategies": [
        "single_node_tp",
        "multi_node_tp"
      ],
      "hardware": {
        "ppu": "unsupported",
        "ironwood": "unsupported"
      },
      "args": [
        "--additional-config",
        "{\"decode_backend\":\"latency_specialized\"}"
      ]
    },
    "nvfp4_kv_cache": {
      "label": "NVFP4 KV cache",
      "description": "Store the MLA latent in NVFP4 instead of FP8 for about 1.5x the KV cache tokens; the indexer keys stay FP8.",
      "hardware": {
        "ppu": "unsupported",
        "ironwood": "unsupported"
      },
      "args": [
        "--kv-cache-dtype",
        "nvfp4_ds_mla"
      ]
    }
  },
  "opt_in_features": [
    "spec_decoding",
    "text_only",
    "low_latency_decode",
    "nvfp4_kv_cache"
  ],
  "variants": {
    "default": {
      "precision": "mxfp4",
      "vram_minimum_gb": 1874,
      "supported_hardware": [
        "b300",
        "gb300",
        "vr200",
        "mi355x",
        "810e",
        "m890",
        "ironwood"
      ],
      "description": "MXFP4 routed-expert weights (~1.56 TB on disk); attention, shared experts and the vision tower stay in BF16.",
      "hardware_overrides": {
        "810e": {
          "docker_image": "egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun-tmp/inference-xpu-pytorch:kimi-k3.1-pro-vllm0.32.0-cuda13.0-pytorch2.13.0-20261103",
          "docker_serve_command": "vllm serve",
          "install": {
            "pip": false
          }
        },
        "m890": {
          "docker_image": "egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun-tmp/inference-xpu-pytorch:kimi-k3.1-pro-vllm0.32.0-cuda13.0-pytorch2.13.0-20261103",
          "docker_serve_command": "vllm serve",
          "install": {
            "pip": false
          }
        },
        "vr200": {
          "docker_image": "vllm/vllm-openai:kimi-k31-cu134",
          "install": {
            "pip": false
          }
        },
        "ironwood": {
          "install": {
            "docker": false,
            "pip": {
              "command": "git clone https://github.com/vllm-project/vllm-torchtpu.git && cd vllm-torchtpu && git checkout kimi-k31pro && VLLM_TARGET_DEVICE=empty uv sync --group vllm && source .venv/bin/activate",
              "note": "Source build of vLLM-TorchTPU from the kimi-k31pro branch (Python 3.12, uv; its vllm group builds the pinned vLLM 0.32.0). Tracks vllm-torchtpu#2775 until it merges into main."
            }
          },
          "extra_env": {
            "TPU_VLLM_ENABLE_UNIFIED_BLOCK_POOL": "1",
            "TPU_MOE_HIERARCHICAL_EP": "1"
          },
          "extra_args": [
            "--language-model-only",
            "--limit-mm-per-prompt",
            "{\"image\":0,\"video\":0}",
            "--enable-ep-weight-filter",
            "--kv-cache-dtype",
            "fp8",
            "--async-scheduling",
            "--enable-prefix-caching"
          ]
        }
      }
    }
  },
  "strategy_hardware": {
    "multi_node_tep": {
      "810e": "supported",
      "m890": "supported",
      "ironwood": "supported"
    },
    "single_node_tp": {
      "810e": "unsupported",
      "m890": "unsupported"
    },
    "single_node_tep": {
      "810e": "unsupported",
      "m890": "unsupported"
    },
    "multi_node_tp": {
      "810e": "unsupported",
      "m890": "unsupported",
      "ironwood": "unsupported"
    },
    "pd_cluster": {
      "810e": "unsupported",
      "m890": "unsupported",
      "ironwood": "unsupported"
    }
  },
  "strategy_min_gpus": {
    "single_node_tp": 8,
    "single_node_tep": 8,
    "multi_node_tp": 8,
    "810e": 32,
    "m890": 32,
    "ironwood": 32
  },
  "hardware_overrides": {
    "blackwell": {
      "extra_args": [
        "--load-format",
        "fastsafetensors"
      ],
      "extra_env": {
        "VLLM_ENGINE_READY_TIMEOUT_S": "3600"
      }
    },
    "rubin": {
      "extra_args": [
        "--load-format",
        "fastsafetensors"
      ],
      "extra_env": {
        "VLLM_ENGINE_READY_TIMEOUT_S": "3600"
      }
    },
    "amd": {
      "extra_env": {
        "VLLM_ROCM_USE_AITER": "1",
        "SAFETENSORS_FAST_GPU": "1",
        "VLLM_ROCM_USE_AITER_MOE_SITUV2": "1",
        "VLLM_USE_BREAKABLE_CUDAGRAPH": "1",
        "VLLM_ENGINE_READY_TIMEOUT_S": "7200"
      }
    }
  },
  "presets": {
    "mi355x_agentx": {
      "label": "AgentX TP8, concurrency 48",
      "hardware": "mi355x",
      "strategy": "single_node_tp",
      "workload": "Agentic (InferenceX AgentX)",
      "description": "Concurrency 48 on one MI355X node: TP8 with DCP8, the K3.1 DSpark draft with 3 tokens and host KV offload, with linear layers, MoE combine and all-reduce in BF16.",
      "select": {
        "frontend": "python",
        "features": {
          "spec_decoding": true,
          "text_only": true,
          "low_latency_decode": false
        },
        "kv_offload": "simple"
      },
      "args": [
        "--load-format",
        "fastsafetensors",
        "--max-model-len",
        "1048576",
        "--enable-prefix-caching",
        "--kv-cache-dtype",
        "fp8",
        "--mamba-ssm-cache-dtype",
        "float32",
        "--stream-interval",
        "10",
        "--decode-context-parallel-size",
        "8",
        "--dcp-comm-backend",
        "a2a",
        "--cp-kv-cache-interleave-size",
        "1",
        "--prefix-match-unit",
        "64",
        "--moe-backend",
        "auto",
        "--seed",
        "7",
        "--disable-uvicorn-access-log",
        "--max-num-seqs",
        "48",
        "--max-num-batched-tokens",
        "10240",
        "--gpu-memory-utilization",
        "0.91",
        "--attention-config",
        "{\"indexer_kv_dtype\":\"mxfp4\"}",
        "--additional-config",
        "{\"kda_prefill_backend\":\"fused\"}",
        "--compilation-config",
        "{\"mode\":3,\"cudagraph_mode\":\"FULL_AND_PIECEWISE\",\"max_cudagraph_capture_size\":10240,\"custom_ops\":[\"+fused_rms_norm_gated\"],\"cudagraph_capture_sizes\":[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,224,256,288,320,352,384,416,448,480,512,640,768,896,1024,1280,1536,1792,2048,2560,3072,3584,4096,4608,5120,6144,6400,7168,8192,8704,10240]}"
      ],
      "env": {
        "VLLM_USE_V2_MODEL_RUNNER": "1",
        "VLLM_FASTSAFETENSORS_QUEUE_SIZE": "-1",
        "VLLM_ROCM_AITER_MLA_ASM_PADDING": "asm",
        "VLLM_ROCM_AITER_MLA_DCP_VERIFY": "asm",
        "VLLM_ROCM_DCP_AITER_ALLGATHER": "1",
        "VLLM_ROCM_USE_AITER_FLYDSL_SPARSE_MLA": "1",
        "AITER_FLYDSL_SPARSE_MLA": "1",
        "VLLM_ROCM_DSA_DCP_GLOBAL_KEY_PREFILL": "1",
        "VLLM_ROCM_DSA_DCP_ROWSHARD_PREFILL": "1",
        "VLLM_USE_DIRECT_DCP_A2A": "0",
        "VLLM_USE_DIRECT_DCP_Q_GATHER": "0",
        "VLLM_USE_DIRECT_DCP_KV_GATHER": "0",
        "AITER_FLYDSL_STAGE2_FP8": "0",
        "VLLM_ROCM_QUICK_REDUCE_QUANTIZATION": "NONE",
        "AITER_BF16_FP8_MOE_BOUND": "0",
        "HSA_NO_SCRATCH_RECLAIM": "1",
        "THP_MEM_ALLOC_ENABLE": "1",
        "VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS": "1200",
        "PYTHONNOUSERSITE": "1",
        "PYTHONHASHSEED": "42"
      },
      "json_args": {
        "--speculative-config": {
          "num_speculative_tokens": 3,
          "rejection_sample_method": "block"
        },
        "--kv-transfer-config": {
          "kv_connector_extra_config": {
            "cpu_bytes_to_use_per_rank": 224875000000
          }
        },
        "--additional-config": {
          "kda_prefill_backend": "fused"
        }
      },
      "runbook": "The single-node MI355X TP8 AgentX configuration at concurrency 48. It follows the concurrency-48 point of InferenceX's MI355X vLLM AgentX lane (SemiAnalysisAI/InferenceX#4887), measured on the image digest named in the [concurrency-1 preset](#preset-mi355x_agentx_c1). It keeps linear layers, MoE combine and all-reduce in BF16 and serves text with tool-call and reasoning parsers, using DCP8/A2A.\n\n**Serving config.**\n- **`--max-num-seqs 48` and capture sizes 4 to 10240.** At concurrency 48, decode batches are at most 48 requests × 4 rows (1 + 3 draft tokens), so the sizes 4 to 192 in steps of 4 cover every decode step exactly. The list then continues from 224 up to 10240, the value of `--max-num-batched-tokens`, to cover the prefill steps.\n- **`VLLM_USE_BREAKABLE_CUDAGRAPH=1`.** K3.1 has no `torch.compile` submodule, so vLLM resolves `FULL_AND_PIECEWISE` to `FULL_DECODE_ONLY` and captures decode only. Breakable graphs are what let it capture the prefill sizes as well, so the AMD profile turns them on. They cost graph memory, which comes out of the KV cache: with an old 2-to-576 list (`--max-num-seqs 96`) they took 63.1 GiB and the server did not start. Keep the capture list to the sizes the workload really uses.\n- **`--max-num-batched-tokens 10240`.** With prefix caching, the hybrid KV manager ends every non-final prefill chunk on a block boundary. In this preset (with the dense MLA DSpark draft sharing the block row) K3.1's packed DSA block is 1152 tokens, so after the decode rows a chunk floors to 9216 tokens (6912 at 8192).\n- **`--gpu-memory-utilization 0.91`.** Kernel scratch is allocated outside this budget, so leave headroom.\n- **The indexer key cache is MXFP4** (`indexer_kv_dtype`). AITER needs padded FP4 indexer pages for it. Stock AITER asserts on the page stride at startup.\n- `VLLM_ROCM_DCP_AITER_ALLGATHER=1`, the FlyDSL sparse-MLA kernels and the DSA DCP prefill paths are on. `kda_prefill_backend: fused` prefills the KDA layers with the fused gfx950 kernel.\n- **Spec decoding** (the Spec decoding feature, on in this preset) uses the K3.1 DSpark draft (5 layers, not the K3 draft) with 3 tokens, `ROCM_AITER_MLA` attention, FP8 KV, probabilistic drafting and block rejection, as in the benchmark lane. The draft is [`Inferact/Kimi-K3.1-Pro-DSpark-preview`](https://huggingface.co/Inferact/Kimi-K3.1-Pro-DSpark-preview).\n- The **Simple** KV-offload option gets 224,875,000,000 bytes of host DRAM per rank. Size `cpu_bytes_to_use_per_rank` to your host.\n\n**Precision.** As the K3.1 precision policy requires: BF16 all-reduce (`VLLM_ROCM_QUICK_REDUCE_QUANTIZATION=NONE`), BF16 MoE combine (`AITER_FLYDSL_STAGE2_FP8=0`), BF16 KDA input projections (no `--quantization-config`) and an FP32 KDA recurrent state (`--mamba-ssm-cache-dtype float32`).\n\n### Throughput measurement only (synthetic acceptance)\n\nTo measure throughput the AgentX way, replace real verification with synthetic acceptance at InferenceX's K3.1 DSpark golden acceptance length for 3 draft tokens, 2.88. Only `--speculative-config` changes:\n\n```bash\n--speculative-config '{\"model\":\"Inferact/Kimi-K3.1-Pro-DSpark-preview\",\"num_speculative_tokens\":3,\"method\":\"dspark\",\"attention_backend\":\"ROCM_AITER_MLA\",\"kv_cache_dtype\":\"fp8\",\"draft_sample_method\":\"probabilistic\",\"rejection_sample_method\":\"synthetic\",\"synthetic_acceptance_length\":2.88}'\n```\n\nSynthetic acceptance skips real verification. Never use it to serve users or to evaluate accuracy.\n",
      "json": "/moonshotai/Kimi-K3.1-Pro/presets/mi355x_agentx.json"
    },
    "mi355x_agentx_c1": {
      "label": "AgentX TP8, concurrency 1",
      "hardware": "mi355x",
      "strategy": "single_node_tp",
      "workload": "Agentic (InferenceX AgentX)",
      "description": "Concurrency 1 on one MI355X node: plain TP8 without DCP, KV cache on the GPU, the K3.1 DSpark draft with 7 tokens and the low-latency decode backend, with linear layers, MoE combine and all-reduce in BF16.",
      "select": {
        "frontend": "python",
        "features": {
          "spec_decoding": true,
          "text_only": true,
          "low_latency_decode": true
        },
        "kv_offload": "off"
      },
      "args": [
        "--load-format",
        "fastsafetensors",
        "--max-model-len",
        "1048576",
        "--enable-prefix-caching",
        "--kv-cache-dtype",
        "fp8",
        "--mamba-ssm-cache-dtype",
        "float32",
        "--stream-interval",
        "10",
        "--prefix-match-unit",
        "64",
        "--moe-backend",
        "auto",
        "--seed",
        "7",
        "--disable-uvicorn-access-log",
        "--max-num-seqs",
        "1",
        "--max-num-batched-tokens",
        "16384",
        "--gpu-memory-utilization",
        "0.90",
        "--attention-config",
        "{\"indexer_kv_dtype\":\"mxfp4\"}",
        "--additional-config",
        "{\"kda_prefill_backend\":\"fused\"}",
        "--compilation-config",
        "{\"mode\":3,\"cudagraph_mode\":\"FULL_AND_PIECEWISE\",\"max_cudagraph_capture_size\":16,\"custom_ops\":[\"+fused_rms_norm_gated\"],\"cudagraph_capture_sizes\":[2,4,6,8,10,12,14,16]}"
      ],
      "json_args": {
        "--speculative-config": {
          "num_speculative_tokens": 7,
          "rejection_sample_method": "block"
        },
        "--additional-config": {
          "kda_prefill_backend": "fused"
        }
      },
      "env": {
        "VLLM_USE_BREAKABLE_CUDAGRAPH": "0",
        "VLLM_USE_V2_MODEL_RUNNER": "1",
        "VLLM_FASTSAFETENSORS_QUEUE_SIZE": "-1",
        "VLLM_ROCM_AITER_MLA_ASM_PADDING": "asm",
        "VLLM_ROCM_USE_AITER_FLYDSL_SPARSE_MLA": "1",
        "AITER_FLYDSL_SPARSE_MLA": "1",
        "VLLM_ROCM_AITER_MLA_DCP_VERIFY": "asm",
        "VLLM_ROCM_DCP_AITER_ALLGATHER": "1",
        "VLLM_ROCM_DSA_DCP_GLOBAL_KEY_PREFILL": "1",
        "VLLM_ROCM_DSA_DCP_ROWSHARD_PREFILL": "1",
        "VLLM_USE_DIRECT_DCP_A2A": "0",
        "VLLM_USE_DIRECT_DCP_Q_GATHER": "0",
        "VLLM_USE_DIRECT_DCP_KV_GATHER": "0",
        "AITER_FLYDSL_STAGE2_FP8": "0",
        "VLLM_ROCM_QUICK_REDUCE_QUANTIZATION": "NONE",
        "AITER_BF16_FP8_MOE_BOUND": "0",
        "HSA_NO_SCRATCH_RECLAIM": "1",
        "THP_MEM_ALLOC_ENABLE": "1",
        "VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS": "1200",
        "PYTHONNOUSERSITE": "1",
        "PYTHONHASHSEED": "42"
      },
      "runbook": "The single-node MI355X TP8 AgentX configuration at concurrency 1 (one user, lowest latency). It keeps linear layers, MoE combine and all-reduce in BF16, as [AgentX TP8, concurrency 48](#preset-mi355x_agentx) does. It serves text with tool-call and reasoning parsers. It follows the concurrency-1 point of InferenceX's MI355X vLLM AgentX lane (SemiAnalysisAI/InferenceX#4887) and has been measured only on the image digest below.\n\n**Serving config.**\n- **Plain TP8, no DCP, KV cache on the GPU (KV offload off).** At one request DCP's extra KV capacity isn't needed: the InferenceX concurrency-1 server log reported about 2.8M KV tokens for TP8 with FP8 KV, 2.7x a 1M-token request.\n- **Low-latency decode** (the Low-latency decode feature, on in this preset) sets `decode_backend: latency_specialized`. On MI355X it runs pure decode steps of up to 16 rows on fused FlyDSL kernels; prefill and mixed steps run the default path. Among other startup checks, it needs: TP8 with no expert, data or pipeline parallelism; AITER on, the `ROCM_AITER_MLA` attention backend and an fp8 (E4M3) KV cache; speculative decoding on; no KV offload connector (only MoRIIO or Mooncake consumers are allowed); `--max-num-seqs` 1, 2, 4 or 8 with `--max-num-seqs` × (1 + draft tokens) ≤ 16; a BF16 KDA `in_proj` (no `--quantization-config`); and an FP32 KDA recurrent state. Without DCP it serves only 3 or 7 draft tokens with `--max-num-seqs` 1 or 2.\n- **`--max-num-seqs 1` and capture sizes 2 to 16.** A decode step is 1 request × 8 rows (1 + 7 draft tokens), so 8 is the size that matters. No prefill size is captured, so `VLLM_USE_BREAKABLE_CUDAGRAPH=0` overrides the AMD profile and `FULL_AND_PIECEWISE` resolves to FULL decode graphs only.\n- **Spec decoding** uses the K3.1 DSpark draft with 7 tokens, `ROCM_AITER_MLA` attention, FP8 KV, probabilistic drafting and block rejection, as in the benchmark lane.\n- `--max-num-batched-tokens 16384` floors to 14 packed 1152-token DSA blocks per prefill chunk. `--gpu-memory-utilization 0.90` leaves headroom for kernel scratch.\n\n**Image.** This preset starts only on the `vllm/vllm-openai-rocm:kimi-k31` image; InferenceX measured `sha256:5f47cc1004d9a7ac65f8a913725edb20c62c99a07e31cbf4ba21741bd0b4f9b1`, whose server log shows the specialized decode active without DCP. Current vLLM main does not yet serve K3.1 on this path without DCP: there it also requires `VLLM_ROCM_USE_AITER_FP4BMM=1` and still refuses K3.1's sparse (indexer) MLA layers, so the command above fails at startup on main or nightly images.\n\n**Inherited environment.** The env also carries the lane's DCP variables (`VLLM_ROCM_AITER_MLA_DCP_VERIFY`, `VLLM_ROCM_DCP_AITER_ALLGATHER`, `VLLM_ROCM_DSA_DCP_*`, `VLLM_USE_DIRECT_DCP_*`) and `THP_MEM_ALLOC_ENABLE=1`, which backs the KV offload pool there, so that it matches the InferenceX run exactly. DCP and KV offload are off in this preset, so they are expected to have no effect.\n\n### Throughput measurement only (synthetic acceptance)\n\nTo measure throughput the AgentX way, replace real verification with synthetic acceptance at InferenceX's K3.1 DSpark golden acceptance length for 7 draft tokens, 3.69. Only `--speculative-config` changes:\n\n```bash\n--speculative-config '{\"model\":\"Inferact/Kimi-K3.1-Pro-DSpark-preview\",\"num_speculative_tokens\":7,\"method\":\"dspark\",\"attention_backend\":\"ROCM_AITER_MLA\",\"kv_cache_dtype\":\"fp8\",\"draft_sample_method\":\"probabilistic\",\"rejection_sample_method\":\"synthetic\",\"synthetic_acceptance_length\":3.69}'\n```\n\nSynthetic acceptance skips real verification. Never use it to serve users or to evaluate accuracy.\n",
      "json": "/moonshotai/Kimi-K3.1-Pro/presets/mi355x_agentx_c1.json"
    },
    "v7x_validated": {
      "label": "Validated TEP32 (v7x)",
      "hardware": "ironwood",
      "strategy": "multi_node_tep",
      "workload": "Accuracy validation (GSM8K)",
      "description": "The #2775 validation config on a 2x2x4 v7x slice: complete GSM8K at 97.50%, prefix-cache hits returning identical tokens and logprobs, BEAM-1M matching the GPU reference.",
      "select": {
        "nodes": 4
      },
      "args": [
        "--max-model-len",
        "10240",
        "--max-num-batched-tokens",
        "8192",
        "--max-num-seqs",
        "16",
        "--gpu-memory-utilization",
        "0.82",
        "--compilation-config",
        "{\"compile_sizes\":[1,8,16,8192]}"
      ],
      "source": {
        "href": "https://github.com/vllm-project/vllm-torchtpu/pull/2775",
        "key": "kimi-k31-pro-v7x-tp32-ep32",
        "revision": "af0fce9305f4e591e54892153ea86d49deaf1ccb"
      },
      "runbook": "The configuration vllm-torchtpu#2775 validated on the real checkpoint on a 2x2x4 TPU v7x slice: complete GSM8K at **97.50%** (1,286/1,319), prefix-cache probes returning identical tokens and logprobs, and BEAM-1M long context matching the GPU reference.\n\n#2775 ran one `vllm serve` driver over a Ray cluster (`TPU_MULTIHOST_BACKEND=ray`); the builder renders torchtpu's default multiprocessing backend (per-host `--nnodes` / `--node-rank` / `--headless`). The flags match; the multi-host transport differs. GSM8K ran through the completions API, so the default-on chat and tool-call parsers were not exercised on TPU.\n\nGSM8K capped outputs at 1,024 tokens with 8 concurrent requests; `--max-model-len 10240` and `--max-num-seqs 16` come from that run, not from a serving-quality target.\n",
      "json": "/moonshotai/Kimi-K3.1-Pro/presets/v7x_validated.json"
    },
    "v7x_dcp8": {
      "label": "Validated TEP32 + DCP8 (v7x)",
      "hardware": "ironwood",
      "strategy": "multi_node_tep",
      "workload": "Accuracy validation (GSM8K)",
      "description": "TEP32 + DCP8 on the same 2x2x4 v7x slice: complete GSM8K at 97.42%. Pick it when KV capacity, not decode speed, is the limit. DSpark does not support DCP on TPU, so this preset keeps Spec decoding off.",
      "select": {
        "nodes": 4,
        "features": {
          "spec_decoding": false
        }
      },
      "args": [
        "--decode-context-parallel-size",
        "8",
        "--cp-kv-cache-interleave-size",
        "4",
        "--max-model-len",
        "10240",
        "--max-num-batched-tokens",
        "8192",
        "--max-num-seqs",
        "16",
        "--gpu-memory-utilization",
        "0.82",
        "--compilation-config",
        "{\"compile_sizes\":[8,16,8192]}"
      ],
      "source": {
        "href": "https://github.com/vllm-project/vllm-torchtpu/pull/2775",
        "key": "kimi-k31-pro-v7x-tp32-ep32-dcp8",
        "revision": "af0fce9305f4e591e54892153ea86d49deaf1ccb"
      },
      "runbook": "The TP32 + DCP8 arm of the vllm-torchtpu#2775 validation on the same slice: complete GSM8K at **97.42%** (1,285/1,319), with prefix-cache and long-context checks matching the TP32 arm. Compile sizes drop the 1-batch capture (DCP decode batches start at 8).\n",
      "json": "/moonshotai/Kimi-K3.1-Pro/presets/v7x_dcp8.json"
    }
  },
  "decode_context_parallel": {
    "sizes": {
      "b300": [
        8
      ],
      "gb300": [
        8
      ]
    },
    "match_tp": true
  },
  "notes": [
    {
      "title": "Text-only on TPU",
      "when": {
        "hardware": [
          "ironwood"
        ]
      },
      "body": "TPU serving runs through vllm-torchtpu, which does not load the vision tower for K3.1 — the command always carries `--language-model-only` and image/video are disabled."
    }
  ],
  "guide": "## Overview\n\nKimi-K3.1 keeps the Kimi-K3 layout (Kimi Delta Attention, 896 routed experts with 16 active\nper token, a latent MoE projection and a vision encoder) and adds sparse\nattention (DSA, top-2048 indexer) to 24 of its MLA layers. The checkpoint ships MXFP4\nrouted-expert weights; everything else is BF16.\n\nThe baseline is the simplest working setup on NVIDIA: one tensor-parallel group of 8 GPUs,\neither two GB300 trays or one B300 node. Throughput was not tuned.\n\nVR200 (preview) takes the same TP8 layout on two trays, in the `vllm/vllm-openai:kimi-k31-cu134`\nimage (CUDA 13.4). It uses the Blackwell flags and hasn't been tuned or verified on Rubin.\n\nOn MI355X, one node takes the same TP8 layout with the AMD profile's AITER environment, in the\nday-0 `vllm/vllm-openai-rocm:kimi-k31` image. Two single-node AgentX configurations have run\non MI355X, both InferenceX points: [AgentX TP8, concurrency 48](#preset-mi355x_agentx), with\nDCP8, the K3.1 DSpark draft and host KV offload, and\n[AgentX TP8, concurrency 1](#preset-mi355x_agentx_c1), InferenceX's concurrency-1 point with\nplain TP8, GPU KV and the low-latency decode backend, which needs the image the preset names.\n\nOn Zhenwu PPUs, the default MXFP4 checkpoint runs without speculative decoding on\ntwo 16-PPU 810E nodes with TP32 / EP32, or four 8-PPU M890 nodes with TP8 / DP4 / EP32.\nOn 810E, `ppu_deep_gemm_w4a16` loads the checkpoint with a W4A16 compute path.\nUse the PPU image specified for each hardware configuration.\n\nOn TPU, the model is served by [vLLM torch-TPU](https://github.com/vllm-project/vllm-torchtpu),\ntext-only: the vision tower is not loaded. The validated layout is TP32 with expert\nparallelism on a 2x2x4 TPU v7x slice (16 chips, 32 devices, on 4 hosts). See [TPU serving](#tpu-serving).\n\n## Tensor + expert parallelism\n\nOn one B300 node, the **Tensor + Expert Parallel** strategy keeps attention at TP8 and runs\nthe routed experts with expert parallelism on the MegaMoE kernel. It has the lowest\nlong-prompt time to first token of the single-node layouts: a single 340K-token prompt\nprefills in about 10 s, against about 15 s at plain TP8 (8x B300, one request at a time,\npre-release checkpoint).\n\n## Long context: decode context parallelism\n\nThe **Decode Context Parallelism** row shards the MLA latent and indexer-key caches across\nthe 8 GPUs of the TP group instead of replicating them, so DCP8 holds about 7x the KV cache\ntokens of TP8 (about 18.5M vs 2.6M tokens with FP8 KV on 8x B300). Prefill is as fast as\nat TP8. Decode steps are 7–25% slower than TP8 at the same batch, so use DCP when KV\ncapacity is the limit: very long contexts or many long-lived agentic sessions.\n\n## Low-latency decode\n\nThe **Low-latency decode** feature switches decode steps to a fused CuTe DSL path tuned for\nsmall batches; prefill and mixed steps still run the default path. On 8x B300 at TP8 it cuts\nthe decode step by 1.6–1.7x at batch 1 and 1.2–1.3x at batch 32–64. Under DCP8 it brings decode\nto within 6% of TP8. It requires the V2 model runner and FULL decode CUDA graphs (the\ndefaults), TP8 or TP8 + DCP8, and no expert parallelism in this recipe.\n\nOn MI355X the same switch selects fused FlyDSL decode kernels. They cover only pure decode\nsteps of up to 16 rows, so among other checks they also need speculative decoding,\n`--max-num-seqs` 1, 2, 4 or 8 with `--max-num-seqs` × (1 + draft tokens) ≤ 16, BF16 KDA\nprojections, an FP32 KDA recurrent state (`--mamba-ssm-cache-dtype float32`) and no KV\noffload. Without DCP they serve only 3 or 7 draft tokens at `--max-num-seqs` 1 or 2, so the\nMI355X default of 5 draft tokens needs DCP8. The\n[concurrency-1 preset](#preset-mi355x_agentx_c1) shows a working setup, on the image it\nnames; current vLLM main does not yet run K3.1 on this path without DCP. The concurrency-48\npreset does not qualify, so leave the feature off there.\n\n## NVFP4 KV cache\n\nThe **NVFP4 KV cache** feature stores the MLA latent in NVFP4 (352 bytes per token per layer\ninstead of 576) and holds about 1.5x the KV cache tokens of FP8. The indexer keys stay FP8,\nso the top-2048 token selection is unchanged. GSM8K matched FP8 on 8x GB300 (96.1% vs 96.2%);\nlong-context accuracy has not been measured yet.\n\n## TPU serving\n\nTPU serving runs through [vLLM torch-TPU](https://github.com/vllm-project/vllm-torchtpu) and\nis text-only: the vision tower is not loaded. K3.1 support is under review as\n[vllm-torchtpu#2775](https://github.com/vllm-project/vllm-torchtpu/pull/2775); until it merges,\nthe Install tab on TPU builds from the `kimi-k31pro` staging branch (Python 3.12, uv). No\npublished image or wheel carries it yet.\n\nThe generated command uses vllm-torchtpu's default multiprocessing multi-host backend: run the\nhead command on the slice's first host and the worker commands on the remaining hosts (the\nbuilder renders both). The **Multi-Node TEP** strategy at 4 nodes matches the validated flags of\n[vllm-torchtpu#2775](https://github.com/vllm-project/vllm-torchtpu/pull/2775) with two\ndifferences: #2775 ran one driver over a Ray cluster (`TPU_MULTIHOST_BACKEND=ray`), and its\nGSM8K validation used the completions API, so the default-on chat and tool-call parsers were not\nexercised on TPU. Validated on a 2x2x4 TPU v7x slice with an FP8 latent KV cache, the unified\nblock pool and prefix caching: the complete GSM8K split scored 97.50% (TP32) and 97.42%\n(TP32 + DCP8), prefix-cache hits returned identical tokens and logprobs, and the BEAM-1M\nlong-context benchmark matched the GPU reference. The run-specific sizing of that validation\n(10K context, 16 sequences, compile sizes) is not the TPU default — it lives in the two\n**Validated** presets: [TEP32](#preset-v7x_validated) and\n[TEP32 + DCP8](#preset-v7x_dcp8) for KV-capacity-bound workloads.\n\n**Spec decoding is gated off on TPU for now**: DSpark with `--async-scheduling` (always on in\nthis configuration) needs [vllm-torchtpu#2770](https://github.com/vllm-project/vllm-torchtpu/pull/2770),\nstill open. #2775 validated DSpark with 7 draft tokens once that fix is in.\n\n## Prefill/decode disaggregation\n\nThe **Prefill/Decode Disaggregation** strategy runs one TP8 prefill pool (with expert\nparallelism) and one DEP16 decode pool (TP1 x DP16 with expert parallelism), and decode\npulls each request's KV from prefill over NIXL. Every PD worker sets\n`VLLM_SSM_CONV_STATE_LAYOUT=DS`: NIXL transfers the Kimi Delta Attention conv state in three\nreads, which needs that layout, and the NIXL connector refuses to start without it.\n\n## KV cache offloading\n\nThe **Simple** option on the KV Offload row adds `SimpleCPUOffloadConnector`, a host-DRAM\nprefix tier for each GPU. Under Prefill/Decode Disaggregation it is added to the prefill pool\nonly, next to NIXL in a MultiConnector; decode keeps plain NIXL. The tier pins\n`cpu_bytes_to_use_per_rank` of host memory for every GPU, so size it from the host DRAM that\nis free after the engines are up. The tested GB300 prefill workers used 128 GiB per GPU\n(512 GiB per tray).\n\n## Client usage\n\n```bash\ncurl http://localhost:8000/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"moonshotai/Kimi-K3.1-Pro\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Explain sparse attention in two sentences.\"}],\n    \"temperature\": 0.7,\n    \"top_p\": 0.95\n  }'\n```\n\n## References\n\n- [Model card](https://huggingface.co/moonshotai/Kimi-K3.1-Pro)\n- [Kimi-K3 recipe](https://recipes.vllm.ai/moonshotai/Kimi-K3)\n",
  "source": {
    "source": "vllm",
    "repo": "vllm-project/vllm",
    "ref": "main",
    "sha": "d5ed2c9605c3b385d1c94c3097472b7bface3b5e",
    "path": "recipes/models/moonshotai/Kimi-K3.1-Pro.yaml",
    "edit_url": "https://github.com/vllm-project/vllm/edit/main/recipes/models/moonshotai/Kimi-K3.1-Pro.yaml",
    "overlays": []
  }
}