Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 193 additions & 0 deletions recipes/models/MiniMaxAI/MiniMax-M3.1-Flash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,199 @@ presets:
sequence-parallel prefill as off; it is omitted here. SP prefill is available on
the default checkpoint through the DBO / SP prefill feature.

# MI355X AgentX 1P2D: one TP4 prefill engine feeds two TP4 decode engines over MoRI-IO
# RDMA WRITE, on the image and opt-in switches of mi355x_agentx above.
mi355x_agentx_pd:
label: "AgentX 1P2D (MoRI-IO)"
hardware: mi355x
strategy: pd_cluster
variants: [mxfp4]
workload: "Agentic (InferenceX AgentX)"
description: "One TP4 prefill engine with a host-DRAM KV tier feeds two TP4 decode engines on one node over MoRI-IO RDMA WRITE, behind vllm-router with consistent-hash routing (12 GPUs). Seven-token DSpark, NVFP4 KV and indexer K caches, and the nightly's opt-in MiniMax-M3.1 ROCm switches on both roles."
source: { label: "ROCm/ATOM MoRI-IO 1P2D", href: "https://github.com/ROCm/ATOM/blob/7e0e199ffd45e2c5cb451e171ac2a05a1e973420/.github/benchmark/models_atomesh.yaml", key: "m31-flash-vllm-moriio-rdma-1p2d-s65822", revision: 7e0e199ffd45e2c5cb451e171ac2a05a1e973420 }
image: "vllm/vllm-openai-rocm:nightly-4fab5a07475822c6eaa971dceb2e2220d0446808@sha256:6f126f27a3b58959da3c16076248fc99eb31e26d0a3ae9f8563bda7317d6a7e6"
select:
pd_connector: moriio
kv_offload: simple
features: { text_only: true, spec_decoding: true }
args:
- "--enable-prefix-caching"
- "--max-model-len"
- "1048576"
- "--gpu-memory-utilization"
- "0.85"
env:
VLLM_USE_V2_MODEL_RUNNER: "1"
DEBUG_HIP_DYNAMIC_QUEUES: "0"
# Prefill and decode hash prefix blocks alike.
PYTHONHASHSEED: "42"
VLLM_ENGINE_READY_TIMEOUT_S: "7200"
VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS: "1200"
VLLM_HTTP_TIMEOUT_KEEP_ALIVE: "3600"
HIP_FORCE_DEV_KERNARG: "1"
NCCL_DMABUF_ENABLE: "0"
HSA_ENABLE_IPC_MODE_LEGACY: "1"
VLLM_ROCM_MINIMAX_M3_MONO_DRAFTER: "1"
VLLM_ROCM_PARALLEL_INDEX_TOPK: "1"
VLLM_USE_RUST_FRONTEND: "1"
VLLM_ROCM_USE_SKINNY_GEMM: "0"
json_args:
"--speculative-config": { num_speculative_tokens: 7, rejection_sample_method: block }
# Four QPs per transfer: one overflows its 16384-WR send queue on a ~230K-token prompt.
"--kv-transfer-config": { MoRIIOConnector: { kv_connector_extra_config: { backend: rdma, num_workers: 4, qp_per_transfer: 4, read_mode: false } } }
# MoRI-IO ran on the default KV cache layout; the pd_cluster block's BLHNC is for NIXL.
roles:
prefill:
env: { VLLM_KV_CACHE_LAYOUT: "LBHNC" }
json_args:
"--attention-config": { indexer_decode_cp: true }
decode:
env: { VLLM_KV_CACHE_LAYOUT: "LBHNC" }
# Replaces the NIXL config the pd_cluster block writes for MI355X decode.
args:
- "--max-num-batched-tokens"
- "8192"
- "--kv-transfer-config"
- '{"kv_connector":"MoRIIOConnector","kv_role":"kv_consumer","kv_load_failure_policy":"fail","kv_connector_extra_config":{"proxy_ip":"$ROUTER_HOST","proxy_ping_port":"36367","http_port":"{port}","handshake_port":"7301","notify_port":"62005"}}'
# Prefill admits twice the sessions; each decode engine caps its batch, and its graphs
# cover that batch x (1 + 7 draft tokens).
points:
c40:
label: "40"
concurrency: 40
roles:
prefill:
args: ["--max-num-seqs", "80"]
json_args:
"--kv-transfer-config": { SimpleCPUOffloadConnector: { kv_connector_extra_config: { cpu_bytes_to_use_per_rank: null, cpu_hugepage_block_size: null, cpu_bytes_to_use: 1349000000000, lazy_offload: false } } }
decode:
args: ["--max-num-seqs", "10"]
json_args:
"--compilation-config": { cudagraph_capture_sizes: [8, 16, 24, 32, 40, 48, 56, 64, 72, 80], max_cudagraph_capture_size: 80 }
c48:
label: "48"
concurrency: 48
roles:
prefill:
args: ["--max-num-seqs", "96"]
json_args:
"--kv-transfer-config": { SimpleCPUOffloadConnector: { kv_connector_extra_config: { cpu_bytes_to_use_per_rank: null, cpu_hugepage_block_size: null, cpu_bytes_to_use: 1349000000000, lazy_offload: false } } }
decode:
args: ["--max-num-seqs", "12"]
json_args:
"--compilation-config": { cudagraph_capture_sizes: [8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96], max_cudagraph_capture_size: 96 }
c64:
label: "64"
concurrency: 64
roles:
prefill:
args: ["--max-num-seqs", "128"]
json_args:
"--kv-transfer-config": { SimpleCPUOffloadConnector: { kv_connector_extra_config: { cpu_bytes_to_use_per_rank: null, cpu_hugepage_block_size: null, cpu_bytes_to_use: 1349000000000, lazy_offload: false } } }
decode:
args: ["--max-num-seqs", "16"]
json_args:
"--compilation-config": { cudagraph_capture_sizes: [8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128], max_cudagraph_capture_size: 128 }
c96:
label: "96"
concurrency: 96
default: true
roles:
prefill:
args: ["--max-num-seqs", "192"]
json_args:
"--kv-transfer-config": { SimpleCPUOffloadConnector: { kv_connector_extra_config: { cpu_bytes_to_use_per_rank: null, cpu_hugepage_block_size: null, cpu_bytes_to_use: 1900000000000, lazy_offload: false } } }
decode:
args: ["--max-num-seqs", "16"]
json_args:
"--compilation-config": { cudagraph_capture_sizes: [8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128], max_cudagraph_capture_size: 128 }
c112:
label: "112"
concurrency: 112
roles:
prefill:
args: ["--max-num-seqs", "224"]
json_args:
"--kv-transfer-config": { SimpleCPUOffloadConnector: { kv_connector_extra_config: { cpu_bytes_to_use_per_rank: null, cpu_hugepage_block_size: null, cpu_bytes_to_use: 1900000000000, lazy_offload: false } } }
decode:
args: ["--max-num-seqs", "20"]
json_args:
"--compilation-config": { cudagraph_capture_sizes: [8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160], max_cudagraph_capture_size: 160 }
c128:
label: "128"
concurrency: 128
roles:
prefill:
args: ["--max-num-seqs", "256"]
json_args:
"--kv-transfer-config": { SimpleCPUOffloadConnector: { kv_connector_extra_config: { cpu_bytes_to_use_per_rank: null, cpu_hugepage_block_size: null, cpu_bytes_to_use: 2200000000000, lazy_offload: false } } }
decode:
args: ["--max-num-seqs", "24"]
json_args:
"--compilation-config": { cudagraph_capture_sizes: [8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192], max_cudagraph_capture_size: 192 }
runbook: |
A 1P2D AgentX lane on 12 MI355X GPUs, on the Quark MXFP4 checkpoint: one TP4 prefill
engine (GPUs 0-3 of its node) and two TP4 decode engines (GPUs 0-3 and 4-7 of a second
node), with KV moved from prefill to decode by MoRI-IO RDMA WRITE. Measured in
[ROCm/ATOM](https://github.com/ROCm/ATOM/blob/7e0e199ffd45e2c5cb451e171ac2a05a1e973420/.github/benchmark/models_atomesh.yaml)
(`m31-flash-vllm-moriio-rdma-1p2d-s65822-*`, and `-n4fab-c96-dcap16-cpu19-nodbo` for
concurrency 96) with agentx-harness 1.0.12 on the
`semianalysis_cc_traces_weka_062126` traces, 3600 s per point. Throughput runs replaced
block verification with synthetic rejection at the golden DSpark acceptance length
(4.04); the commands above keep block verification.

**Image and vLLM.** The image and opt-in switches of the MI355X AgentX TP4 lane
(`4fab5a074`), plus
[vllm-project/vllm#65822](https://github.com/vllm-project/vllm/pull/65822): with
prefix caching on the decode engine, MoRI-IO WRITE skips the blocks the decoder already
holds instead of rewriting them. The lane overlaid that PR's Python files on the image;
use a nightly that contains it.

**Running it.** The preset renders the prefill engine and one decode engine. Start the
second decode engine on the same node with the same command and environment, with
`CUDA_VISIBLE_DEVICES=4,5,6,7`, `--port 8003`, and `handshake_port` 7401 and
`notify_port` 62105 in its `--kv-transfer-config` (each TP rank listens on base + rank).
Pin each engine to its GPUs' NUMA node (GPUs 0-3 on node 0, 4-7 on node 1). Run
vllm-router 0.1.16 (MoRI-IO WRITE needs 0.1.15 or later) with
`--policy consistent_hash --prefill-policy consistent_hash --decode-policy consistent_hash`
in place of `round_robin`, so every turn of a conversation reaches the engines that
cache its prefix.

Engines find the router through `proxy_ip`, not a list of endpoints: set `ROUTER_HOST`
to an address of the router's node that both nodes can reach; the default `localhost`
only reaches engines on the router's node. Each engine registers the address
`get_ip()` returns; on hosts with several NICs, set `VLLM_HOST_IP` to the node's
routable address.

**Tuning rules.**

- Prefill `--max-num-seqs` is twice the concurrency. Each decode engine caps its batch
(`--max-num-seqs` 10-24), and its CUDA graphs cover that batch x (1 + 7 draft tokens).
A capped engine queues extra requests instead of running a larger, slower batch.
- The prefill host-DRAM KV tier keeps the conversations' prefixes once they outgrow HBM
(about 53 KB per token): 1.349 TB up to concurrency 64, 1.9 TB (about 36M tokens) at
96 and 112, 2.2 TB at 128. The prefill prefix hit rate stayed at 95-97%.
- Decode engines run vLLM's default `FULL_AND_PIECEWISE` graphs.

| Concurrency | Decode cap | Total tokens/s per GPU | Interactivity p50 / p90 (tokens/s/user) | TTFT p90 | E2E latency p90 |
| ---: | ---: | ---: | ---: | ---: | ---: |
| 40 | 10 | 24,884 | 312.7 / 241.0 | 0.8 s | 9.8 s |
| 48 | 12 | 29,553 | 277.3 / 229.9 | 1.1 s | 9.8 s |
| 64 | 16 | 39,616 | 231.5 / 200.4 | 2.4 s | 11.6 s |
| 96 | 16 | 46,295 | 200.7 / 189.0 | 7.1 s | 16.4 s |
| 112 | 20 | 50,561 | 187.0 / 168.4 | 9.6 s | 18.4 s |
| 128 | 24 | 52,889 | 178.4 / 159.7 | 11.3 s | 21.5 s |

Single runs of the rendered commands. Dual-batch overlap on prefill
(`--enable-dbo --dbo-prefill-token-threshold 16384 --dbo-decode-token-threshold 32768`,
[vllm-project/vllm#63483](https://github.com/vllm-project/vllm/pull/63483)) gave the
same throughput and interactivity at every point and lowered TTFT p90 by 1-2 s at 112
and 128, so the preset leaves it off.

A worker can fail at startup with mori's `tcp.cpp` "Address already in use": MoRI-IO
picks its RDMA port with a probe-and-release, and another process on a busy node can
take it first. Restart the engine.

guide: |
## Overview

Expand Down
Loading