Skip to content

Kimi-K3.1-Pro on gfx942 (MI325X): MoRIIO 2P1D + DSpark cards - #305

Open
raviguptaamd wants to merge 23 commits into
ROCm:developfrom
raviguptaamd:kimik31-pro-gfx942
Open

raviguptaamd wants to merge 23 commits into
ROCm:developfrom
raviguptaamd:kimik31-pro-gfx942

Conversation

@raviguptaamd

Copy link
Copy Markdown
Contributor

Adds Kimi-K3.1-Pro (MXFP4, ~1.5 TB, 1M context) to the vllm_dissag harness on gfx942 (MI325X): two cards, Kimi-K3.1-Pro-gfx942 and Kimi-K3.1-Pro-gfx942-dspark, their own image, a skill and a results page.

Stacked on #288 (which is stacked on #274). This branch is #288's head (a3726fa) plus eight commits. Until #288 and #274 merge, the diff also shows their commits. Changes of this PR alone: raviguptaamd/MAD@glm53flash-gfx942-mxfp4...raviguptaamd:MAD:kimik31-pro-gfx942

Recipe

  • 2P1D over MoRIIO, TP8 attention + TP-sharded experts on every leg.
    • One prefill node is the TTFT bottleneck for agentic traffic.
    • Wide EP doesn't fit on one node per pool for this model: TP4×DP2 + MoRI-EP leaves ~0.6 GiB KV per GPU.
  • DCP8 on every leg (--decode-context-parallel-size 8 --dcp-comm-backend a2a): KV sharded across the 8 GPUs. DCP must match across legs; a mismatch silently corrupts output.
  • Experts: MXFP4 → int4 per-group-32 at load (--quantization-config '{"moe":{"weight":"int4_per_group_32"}}'), FlyDSL wint4 SiTUv2. gfx942 has no FP4 MMA.
  • KV: fp8_ds_mla. MoRIIO READ mode, plus VLLM_SSM_CONV_STATE_LAYOUT=DS for the KDA conv-state transfer.
  • Prefix reuse: prefill --prefix-match-unit 64 --prefix-cache-retention-interval 16384, which keeps a KDA state every 16K tokens so a session's next turn resumes. Both legs route with sticky_least_loaded.
  • DSpark card: the 5-layer K3.1 DSpark draft on both legs, 7 tokens, block rejection.
    • Draft KV stays bf16.
    • Decode --max-num-seqs 128, with graphs up to 1024 tokens (128 requests at q = 8).

Changes

  1. docker/vllm_disagg_inference.kimik31pro.gfx942.ubuntu.amd.Dockerfile (new). Self-contained, no COPY:
    • vLLM: nightly a2bcb565, plus vllm-project/vllm #66027 @ ed04ad1e as a Python overlay. The split changes no csrc, so the nightly's compiled extensions are kept.
    • AITER: from the gfx942 K3.1 image. It has the fnuz fp8_dsv32_mla sparse MLA, which public AITER lacks.
    • Two inline vLLM patches, each checked by a build-time marker:
      • Allow fp8_ds_mla on gfx942 when AITER supports it.
      • K31_DRAFT_LANE: reserve the DSpark verify workspace on the draft's workspace lane. Without it, decode dies at the post-capture warm-up with Workspace is locked (_forward_triton_dcp_verify). The bug is also in upstream main; an upstream fix is to follow.
    • vllm-router: main + feat(sticky_least_loaded): opt-in bounded overflow for pinned sessions vllm-project/router#540 (opt-in bounded overflow for sticky_least_loaded, VLLM_ROUTER_SLL_OVERFLOW_DELTA), pinned by commit.
  2. models.yaml: cards Kimi-K3.1-Pro-gfx942 and Kimi-K3.1-Pro-gfx942-dspark.
  3. skills/kimik31-pro-gfx942/SKILL.md: build, submit, verify, measured results, failure signatures.
  4. results/Kimi-K3.1-Pro-gfx942_20261108.html, README rows, run_xPyD_models.slurm allowlist, tests/argv_assert.sh lists.

Validation

  • Offline: tests/argv_assert.sh 77/77, tests/gate_check.sh 37/37.
  • Build: the Dockerfile built from source on MI325X (×3 nodes). Markers present; /app/versions.txt shows router #540@0349cc2.
  • Live, run_xPyD_models.slurm, MI325X 2P1D (3 × 8 MI325X, Broadcom Thor2, MORI_IB_GID_INDEX=3):
card NIAH (10 needles, 3 seeds) AgentX 256k c4 / c8 TTFT p50 AgentX 512k c4 / c8 TTFT p50 axes in band
Kimi-K3.1-Pro-gfx942 10/10 at 128K, 256K, 512K, 748K 11.9 / 16.6 s 16.1 / 32.7 s 13/13
Kimi-K3.1-Pro-gfx942-dspark 10/10 at 128K, 256K, 512K, 748K 9.2 / 20.5 s 12.1 / 38.2 s 13/13
  • Same image and flags with the recipe's launcher:
    • GSM8K (250, 8-shot): 0.996 (base) and 0.992 (DSpark).
    • Distinct-needle concurrency gate: 9/9.
    • DSpark per-stream decode on mixed text: 94 / 61 / 48 tok/s at c1 / c8 / c32 (~49 at c1 without the draft).

Notes for users

  • Warm the page cache before submitting. Weights load through mmap page faults: ~2 min warm, ~55 min cold, which also exceeds the default LOG_WAIT_TIMEOUT_SECONDS=4000.
  • Thor2: export MORI_IB_GID_INDEX=3 NCCL_IB_GID_INDEX=3; connectors/moriio.env defaults to GID 1.
  • Model runner V2 reads CUDAGRAPH_CAPTURE_SIZES (tokens) as the decode limit too, in whole requests. With DSpark, q = 8, so the default "1..64" graphs only 8 requests and c32 decode halves. The DSpark card captures up to 1024 tokens (~9 GiB).
  • Validated on MI325X only; MI300X is untested.

🤖 Generated with Claude Code

ravgupta and others added 22 commits October 2, 2026 14:54
…/EP8)

Adds GLM-5.3-Flash-FP8 (Glm5NextForConditionalGeneration) disaggregated serving on
MI300X / MI325X to the vllm_dissag harness: EP8 prefill (eager) + EP8 decode with MTP on
both legs and a FULL_AND_PIECEWISE decode CUDA graph, max-model-len 760000, MoRIIO READ.

- docker/vllm_disagg_inference.glmv53flash.gfx942.ubuntu.amd.Dockerfile: self-contained,
  builds vLLM (raviguptaamd/vllm@98b24865), AITER (raviguptaamd/aiter@6f65fba0, incl.
  ROCm/aiter#3913), MoRI (ROCm/mori@78b7a5f3) and vllm-router
  (raviguptaamd/router@9b2146ec, incl. vllm-project/router#313) from pinned commits on a
  digest-pinned base; no patch overlay; 18 build-time fix checks.
- models.yaml / models.json: GLM-5.3-Flash-FP8-gfx942 (sweep, niah, long_context,
  agentic conformance_256k / conformance_512k).
- connectors/moriio.sh: opt-in MORIIO_READ_MODE and ROUTER_PREFILL_POLICY /
  ROUTER_DECODE_POLICY (no-ops for other models); run_xPyD_models.slurm gate lists.
- skills/: MoRIIO NIC setup for Broadcom Thor2 and ConnectX-7.
- results/: validation report (NIAH 256K/512K/750K, concurrent NIAH, perf, AgentX on
  MI325X and MI300X).
- README.MD, tests/gate_check.sh, tests/argv_assert.sh.

Co-authored-by: Cursor <cursoragent@cursor.com>
madengine slurm_multi sizes #SBATCH --nodes from slurm.nodes or
distributed.nnodes (default 1); the card's args "-N 2 -n 2" is only
passed to the script. Declare distributed.nnodes=2 on the five
GLM-5.3-Flash-FP8-gfx942 cards so a 1P/1D job gets both nodes.
The slurm probed <root>/$MODEL_NAME, but the models.yaml key
GLM-5.3-Flash-FP8-gfx942 is not the checkpoint directory (GLM-5.3-Flash-FP8
on NVMe and shared FS), so a run found no weights without a hand-made
symlink. Add MODEL_WEIGHTS_NAME (default MODEL_NAME, same name and
semantics as cluster.sh in ROCm#242) to the probe, set it on the five
GLM-5.3 gfx942 cards, and cover the probe in argv_assert.
…4-bit decode) on the GLM-5.3 image

Repins the GLM-5.3 gfx942 image to fork branches that add, on top of the pins of this recipe:
- vLLM glm53-flash-gfx942-mxfp4-mad 439eabe5c (= 6a0cb9395 + 11): DSA indexer exact causal rows under FULL
  graphs with MTP; SP dense-MLP replication and MoRIIO KDA-state fan-in for TP prefill (both inert unless
  used); MXFP4 weight-only on gfx942, MXFP4 experts and shared experts converted exactly to FP8 128x128
  blocks at load, FlyDSL exact-e2m1 4-bit experts.
- AITER glm53-flash-gfx942-fp4lut 11a6be6e (= 6f65fba0 + 3): FlyDSL W4A16 exact OCP e2m1 decode, tuned
  GLM-5.3-Flash fused_moe configs.
- router glm53-flash-gfx942-hybrid 076800b (= 9b2146ec + 1): ROUTER_DECODE_DP_PIN=0 (off by default).
9 new build-time fix markers (29 total).

Adds the GLM-5.3-Flash-MXFP4-gfx942 recipe (FP8 card flags + MXFP4 switches; routed experts as FP8 blocks on
prefill only via a new opt-in per-leg env, PREFILL_EXTRA_ENV / DECODE_EXTRA_ENV in connectors/moriio.sh),
5 models.json cards, slurm allowlists, README, and tests (gate_check 32/32, argv_assert 56/56).
…ication) and MXFP4 card validation results

skills/glm53-flash-gfx942/SKILL.md: choosing the FP8 or MXFP4 card, building and checking the image, weights and
NIC setup, submission, per-leg load-log checks with expected weights and KV per GPU, expected results, and the
failure signatures seen on gfx942 clusters. results/GLM-5.3-Flash-MXFP4-gfx942_20261023.html: harness validation on
MI300X and full-suite results on MI325X and MI300X. README links both.
…refill prefix-cache retention)

PREFILL_TP (models.yaml env, wideEP only, default 1) runs the prefill leg as TP x (GPUS/TP) DP engines per
node with the router expanding prefill to that many ranks; PREFILL_KV_BLOCK_SIZE sets the prefill block size;
PREFILL_PREFIX_CACHE_RETENTION adds --prefix-cache-retention-interval on prefill when prefix caching is on.
New cards GLM-5.3-Flash-{FP8,MXFP4}-gfx942-hyb (+ models.json runs, slurm allow-lists). Existing cards'
dry-run argv byte-identical (48 card x mode x role outputs). gate_check 37/37, argv_assert 77/77.
…ide to the four cards, skill

README: how to choose between the EP8 and -hyb cards, the settings the -hyb cards add, run commands for all four
(sbatch and madengine names), per-leg checks, and the image pins. Skill: prefill-layout choice and -hyb checks.
-hyb cards set VLLM_HTTP_TIMEOUT_KEEP_ALIVE=120 (above the router's 50 s idle pool).
…0X, customer method)

AgentX conformance_256k/512k at 1-8 sessions, capacity search, NIAH sweep (460/460 x2 x2), accuracy,
MAD harness validation. All steps pass the customer TTFT SLO on both checkpoints (MI325X all 16, MI300X
15 of 16). README links the page.
…t the expert-all2all wording

The four GLM-5.3-Flash-gfx942 cards use MoRIIO (KV) + vLLM allgather_reducescatter (expert
all-to-all); the cards override combo 3's mori wideEP default. Prior prose/skill implied
MoRI-EP. Correct the README table footnote and the SKILL, and add a standalone how-to:

- skills/glm53-flash-gfx942/Recipe_enable_MoriEP.md: the ~4-knob opt-in (flip VLLM_ALL2ALL_BACKEND
  and DECODE_MORI_BACKEND to mori_high_throughput/mori_low_latency; cap the decode MoRI buffer via
  DECODE_EXTRA_ENV VLLM_MORI_MAX_TOKENS_PER_RANK=256 and the decode max-num-batched-tokens to 256),
  the buffer>=profiling-batch landmine and GPU-fault signature, verify steps, and measured results
  (NIAH/GSM8K accurate; decode-TPOT parity on MI325X, ~6-7% slower on MI300X). No image change -
  the PR ROCm#288 image already ships MoRI ops + FlyDSL 4-bit + ep_intranode.

Recommendation stays: keep the default (MoRIIO + all-gather, hybrid prefill).
…open MoRI-EP stability issue

- models.yaml: GLM-5.3-Flash-{FP8,MXFP4}-gfx942 (EP8) set VLLM_HTTP_TIMEOUT_KEEP_ALIVE=120, as the
  -hyb cards already do. The router's 50 s idle pool can otherwise reuse a connection the server is
  closing ("connection closed before message completed"); the race is in the router/server HTTP
  layer, not the prefill layout, and was first seen on EP8 AgentX runs.
- README: keep-alive is set on all four cards, not only the -hyb ones.
- Recipe_enable_MoriEP.md: record that one long AgentX run with MoRI-EP lost a decode engine
  (one DP rank exited at conformance_128k c4, cause not captured); stability under sustained
  load is not established.

Co-authored-by: Cursor <cursoragent@cursor.com>
…to-all, full capacity table

- Images and tags: mad274-mxfp4-src (sha256:786eae0c, built from this PR's Dockerfile, versions.txt pins)
  and release-20261018 (sha256:c945c89c, the image behind every number on the page; vLLM source tree
  identical to 439eabe5c), checked against Docker Hub and the serving nodes.
- Expert parallelism: MoRIIO KV + vLLM allgather_reducescatter (RCCL; AITER custom AG/RS inside full
  decode CUDA graphs); MoRI-EP opt-in results, including the open stability issue.
- Capacity: users per prefill pod for EP8, HYB and HYB+R on both checkpoints and platforms, the SLOs,
  and every step of the final-recipe search.

Co-authored-by: Cursor <cursoragent@cursor.com>
…llm-dev:vllm-glm53flash-mad288-mxfp4-src

Co-authored-by: Cursor <cursoragent@cursor.com>
… private image tags

- results pages: the public image rocm/vllm-dev:vllm-glm53flash-mad288-mxfp4-src only; results noted as measured on
  an equivalent build with the same pins; neutral section names; no node names or workspace paths.
- Recipe_enable_MoriEP.md: neutral measured heading; the open issue stated as not yet validated under sustained load.
- NIC skills: use the public image in the run example.
…ge and skill

Signed-off-by: Ravi Gupta <ravi.gupta@amd.com>
…P1D AgentX numbers

Signed-off-by: Ravi Gupta <ravi.gupta@amd.com>
Signed-off-by: Ravi Gupta <ravi.gupta@amd.com>
…uter = vllm-project/router main ea20a53 (rust 1.95)

Signed-off-by: Ravi Gupta <ravi.gupta@amd.com>
Signed-off-by: Ravi Gupta <ravi.gupta@amd.com>
…_least_loaded bounded overflow); cards carry 2P1D results

Signed-off-by: Ravi Gupta <ravi.gupta@amd.com>
…workspace fix, draft path from MODEL_PATH; skill: Thor2 GID 3, page-cache warm-up, harness-measured results

Signed-off-by: Ravi Gupta <ravi.gupta@amd.com>
… decode limit); results page, README rows, skill numbers from this image

Signed-off-by: Ravi Gupta <ravi.gupta@amd.com>
…eed, AgentX both cards, prefill and decode, harness jobs, ruled-out levers, failure signatures

Signed-off-by: Ravi Gupta <ravi.gupta@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants