Skip to content

Kimik3 madengine integration - #242

Open
Cemberk wants to merge 130 commits into
ROCm:developfrom
Cemberk:kimik3-madengine-integration
Open

Cemberk wants to merge 130 commits into
ROCm:developfrom
Cemberk:kimik3-madengine-integration

Conversation

@Cemberk

@Cemberk Cemberk commented Sep 1, 2026 •

Copy link
Copy Markdown

This PR extends the work here #237 (built on top of existing kimi k3 pr for madengine enablement and testing)

Summary

Adds Kimi-K3 multinode inference to MAD and makes the multinode vLLM / SGLang workloads run, fail and report the same way whether they are launched through madengine or submitted directly with sbatch. It also adds a docs/ folder that takes a new reader from zero to running, configuring and extending these workloads.

Start here: docs/README.md → docs/multinode-running.md.

Depends on: ROCm/madengine#203. It is needed for exact Dockerfile matching, for counting a failed SLURM deployment as a failure, and for the slurm_multi collector reading a card's multiple_results.

What's in this PR

Kimi-K3 on MI300X / MI355X: 7 new cards, 1 image

Card Launcher Shape
pyt_vllm_kimi-k3_mi300x_wideep_moriep scripts/vllm_multinode (colocated) 2 nodes, wide EP, MoRI-EP
pyt_vllm_kimi-k3_mi300x_wideep_allgather colocated 2 nodes, wide EP, all-gather
pyt_vllm_kimi-k3_mi300x_pp2xtp8 colocated 2 nodes, PP2 × TP8
pyt_vllm_kimi-k3_mi300x_pp2xtp8_way4 colocated same workload, expressed through mad-config.kimi-k3.yaml
pyt_vllm_disagg_mori_kimi-k3-mxfp4 scripts/vllm_dissag (disaggregated) 2P/2D, TP2 × DP8, 4 nodes
pyt_vllm_disagg_mori_kimi-k3 disaggregated 2P/2D, TP2 × DP8, 4 nodes
pyt_vllm_disagg_mori_kimi-k3-mxfp4_mi355x disaggregated MI355X, TP1 × DP16 (bring-up)
  • One image for all seven cards: docker/vllm_kimi_k3.ubuntu.amd.Dockerfile.
    • It builds for MAD_SYSTEM_GPU_ARCHITECTURE (gfx942 or gfx950, no default).
    • AITER is built from source at the Kimi-K3 release commit (ROCm/aiter 68e42f5f), with flydsl 0.2.4. Nothing is copied from a second image.
  • Weights: REQUIRE_LOCAL_WEIGHTS=1 on the Kimi cards requires local NVMe copies. MODEL_WEIGHTS_NAME selects the checkpoint directory when it is staged under another name (for example Kimi-K3 vs Kimi-K3-MXFP4).

Launchers: every failure ends the job with the reason in the log

  • A server that dies at start-up, including one worker running out of GPU memory, fails every node fast with its first error lines. The job no longer waits out a timeout.
  • The vLLM and SGLang disagg launchers fail the job when a node's container failed, or when the benchmark produced no perf.csv.
  • The rixl/DeepEP connector honours the recipe's AITER, KV and cudagraph settings instead of overriding them.
  • Benchmark clients request the model under the recipe's --served-model-name.

Results: perf.csv says what happened, cell by cell

  • Both parsers (vLLM and SGLang) read the log one cell at a time. A cell that stalled, printed no result, lost any request, or measured zero throughput is a FAILURE row. It is no longer a missing row or a false SUCCESS.
  • For NIAH, a context length with any errored request, or NO-RESULT, is a FAILURE row.
  • long_context runs now write perf.csv.

Configuration: one source for each setting

  • Allocation defaults are madengine's SLURM presets (partition, GPUs per node, exclusive).
  • Site facts (weights, fabric, ports, logs) live in scripts/common/cluster.sh.
  • Model tuning lives in each launcher's models.yaml recipe.
  • There are no per-site JSON files. A run passes only what differs, in --additional-context.
  • docs/configuration.md lists every layer, what wins, and where to change what.

How to run

Install madengine with the changes this PR depends on:

pip install git+https://github.com/Cemberk/madengine.git@rocenvflag

Through madengine

From the repo root on a SLURM login node. The Kimi cards carry DOCKER_IMAGE_NAME: "<supply-your-image>", so either build and push an image or point at one.

# Build and push the image for the compute nodes' GPU, then run.
# A login node has no GPU, so name the arch.
madengine build --tags pyt_vllm_disagg_mori_kimi-k3-mxfp4 --registry docker.io/<namespace> \
    --additional-context '{"slurm": {"time": "06:00:00"},
                           "docker_build_arg": {"MAD_SYSTEM_GPU_ARCHITECTURE": "gfx942"}}' \
    --manifest-output build_manifest.json
madengine run --manifest-file build_manifest.json --timeout 21600 --live-output -o perf.csv

# Or use an image you already have:
madengine build --tags pyt_vllm_kimi-k3_mi300x_wideep_moriep --use-image <registry>/<repo>:<tag> \
    --additional-context '{"slurm": {"time": "04:00:00"}}'
madengine run --manifest-file build_manifest.json --live-output
  • What you usually need to pass: only the time limit, because the cards say 24:00:00 and most partitions cap lower.

  • Where the rest comes from: the node count is in each card. The partition, GPUs per node and exclusivity are madengine's presets. Model and log paths default in scripts/common/cluster.sh.

  • On a cluster that differs, add only the keys that differ:

    {"slurm": {"partition": "<partition>", "time": "06:00:00"},
     "env_vars": {"MODEL_DIR": "/path/to/models", "LOG_PATH": "/path/to/shared/logs"}}
  • If a node stages the checkpoint under another name, add "MODEL_WEIGHTS_NAME": "Kimi-K3" under env_vars.

Standalone with sbatch

Each launcher takes the card's env_vars as its contract. Export them, name the image, and submit with the allocation. sbatch options go before the script.

# Disaggregated vLLM (DeepSeek-V3, MoRI-IO + MoRI-EP, 1P/1D)
cd scripts/vllm_dissag
export DOCKER_IMAGE_NAME=<registry>/<image>:<tag> \
       MODEL_NAME=DeepSeek-V3 xP=1 yD=1 WIDE_EP=1 RUN_MORI=1 RUN_DEEPEP=0 \
       BENCHMARK_COMBINATIONS=1024/1024
sbatch --partition=amd-rccl --nodes=2 --ntasks=2 --gpus-per-node=8 --exclusive \
       --time=06:00:00 --export=ALL run_xPyD_models.slurm

# Colocated vLLM (Kimi-K3 PP2 x TP8, NIAH)
cd scripts/vllm_multinode
export DOCKER_IMAGE_NAME=<registry>/<image>:<tag> MODEL_NAME=Kimi-K3 \
       TP_SIZE=8 PP_SIZE=2 ENABLE_EP=0 AITER_SITUV2_A8W4=1 GPU_ARCHS=gfx942 \
       REQUIRE_LOCAL_WEIGHTS=1 BENCHMARK_SCRIPT=niah NIAH_WORDS=10000,50000,100000,200000
sbatch --partition=<partition> --nodes=2 --time=06:00:00 --export=ALL run_multinode.slurm
  • A run is reported identically either way:
    • the job exits non-zero on failure;
    • results land in $LOG_PATH/<job>/perf.csv, one row per cell with SUCCESS or FAILURE;
    • every node's server log is next to them.
  • More detail: see docs/multinode-running.md (inside an salloc, weights, fabric, logs, fail-fast) and docs/kimi-k3.md.

Checks that need no GPUs

bash scripts/vllm_dissag/tests/argv_assert.sh          # the vllm serve argv/env each connector and recipe builds
bash scripts/vllm_dissag/tests/parse_to_csv_assert.sh  # vLLM sweep, NIAH and long_context result rows
bash scripts/sglang_disagg/tests/parse_to_csv_assert.sh

Validation status (MI300X, gfx942)

Workload Status
vLLM disagg: NIXL Llama-3.3-70B-FP8, MoRI DeepSeek-V3, MoRI GLM-5.1-FP8 Passing, every sweep cell 8 → 512
SGLang disagg: MoRI-IO Qwen3-32B, MoRI-DP DeepSeek-V3, Mooncake Qwen3-32B / DeepSeek-V3, agentic Qwen3-32B Passing
Kimi-K3 colocated: wide EP MoRI-EP, wide EP all-gather, PP2 × TP8 (both forms) Passing, NIAH 10/10 at 10k–200k words
Kimi-K3-MXFP4 disagg 2P/2D Weights resolve and both servers start on 4 nodes; end-to-end NIAH run in progress

Known issues

  • DeepEP DeepSeek-V3 (pyt_vllm_disagg_deepep_deepseek-v3, pyt_vllm_disagg_nixl_deepseek-v3):
    • start-up now works;
    • prefill fails at concurrency ≥ 128 with DeepEP error: CPU recv timeout in high-throughput intranode dispatch;
    • needs a DeepEP-side fix. The results mark those cells FAILURE.
  • pyt_vllm_disagg_mori_kimi-k3 (the Kimi-K3 recipe): its memory budget (40e9 KV cache and a 16 GiB MoRI heap on top of ~148.6 GiB of TP2 weights) does not fit a 192 GB MI300X. It is left unchanged pending the recipe owner. pyt_vllm_disagg_mori_kimi-k3-mxfp4 is the validated Kimi disagg recipe.
  • SiTUv2 warning on the gfx942 int4 MoE path. The Kimi image's vLLM warns that its AITER build "ignores the SiTUv2 activation on the packed-int4 MoE path".
  • GLM-5.1-FP8 and Mooncake DeepSeek-V3 show lower throughput at concurrency 512 than at 256, with no failed requests.

Review guide

  • docker/vllm_kimi_k3.ubuntu.amd.Dockerfile: the single Kimi image.
  • scripts/vllm_dissag/, scripts/sglang_disagg/, scripts/vllm_multinode/: launchers, recipes (models.yaml), cards (models.json), parsers.
  • scripts/common/cluster.sh: site facts shared by all three launchers.
  • docs/: new. The existing READMEs are unchanged except where they now point into docs/.

Cemberk and others added 14 commits August 13, 2026 17:17
… selector

The xPyD harness already models pools that span multiple nodes (xP/yD count
NODES, roles are MASTER/CHILD via --data-parallel-start-rank + --headless), but
the wideEP path hardcoded TP=1: dp_size was xP*GPUS_PER_NODE and the connector
emitted a literal `-tp 1`. That makes any model whose REPLICATED (non-expert)
weights exceed one GPU inexpressible - e.g. Kimi-K3 on MI300X, where TP1/DP16
needs 190.7 GiB/GPU (> 192 GB HBM) and TP2 is required to fit.

- vllm_disagg.sh: topology math is TP-aware. dp_per_node = GPUS_PER_NODE/TP_SIZE
  feeds dp_size, dp_size_local and both start-rank calculations. TP_SIZE defaults
  to 1 and is validated to divide GPUS_PER_NODE.
- moriio.sh: emit -tp ${TP_SIZE}; clamp --api-server-count to dp_size (it must be
  <= data-parallel-size or the frontend DP balancer routes to ranks that do not
  exist - only reachable once TP>1 shrinks dp_size below GPUS_PER_NODE).
- moriio.sh: advertise the peer pool's node IPs as moriio_pod_hosts when a pool
  spans >1 node. Without it the connector falls back to the peer MASTER only and
  KV writes aimed at ranks on a peer CHILD node silently miss, so those ranks
  decode with no context. Emitted only when xP>1 || yD>1.
- run_xPyD_models.slurm: forward TP_SIZE/GPUS_PER_NODE, wire BENCHMARK_SCRIPT=niah
  to the already-present benchmark_niah.sh, forward NIAH_* knobs.

Default-neutral: at xP=1 yD=1 TP_SIZE=1 - the topology every registered entry
uses - DRY_RUN output is byte-identical to develop across all four node roles.
At xP=2 yD=2 TP_SIZE=2 it emits tp=2, dp_size=8, dp_local=4, child start-rank 4
(= EP16 per pool over 16 GPUs).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…Kimi-K3 recipe

Two parts.

1) moriio.sh wideEP dropped ${model_args[@]} on the floor. models.yaml documents
   per-model dp: tuning as supported ("both connectors now append it") and rixl's
   deepep path does append it, but the moriio wideEP branch parsed the flags,
   logged them, and then emitted an argv without them. Verified with a sentinel
   flag: present in the log line, absent from the command. Now appended, matching
   rixl. Every existing wideEP model has an empty dp: block, so emitted argv is
   unchanged for all of them.

2) Kimi-K3 recipe, entirely as data: env: block for the gfx942 knobs
   (VLLM_ROCM_USE_AITER_MLA=0 - the AITER MLA kernel is gfx950-only -
   AITER_SITUV2_A8W4=1 for the packed-int4 SiTUv2 MoE path, KDA conv state layout,
   40e9 KV cache for >600K contexts, per-role cudagraph + MoRI backends), and a
   dp: block for the serve flags the connector does not emit (reasoning parser,
   1M max-model-len, batched-tokens pinned at 2048, MoE quantization-config).
   Registered in MORI_EP_VALID_MODELS and WIDE_EP_ONLY_MODELS.

   The JSON quantization-config carries its own shell quotes: the launcher
   word-splits dp: via eval, which would otherwise strip the JSON's double quotes
   and hand vLLM invalid JSON. Verified the emitted value parses as JSON.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
docker/pyt_vllm_kimi_k3_mi300x.ubuntu.amd.Dockerfile
  The shared vllm_disagg_inference stack with the pins K3 needs on gfx942
  (MoRI 1.2.2, AITER 0.1.19 + flydsl 0.2.4, the K3+MoRIIO vLLM commit) plus the
  K3-aware AITER graft from the public vendor image - without that graft the K3
  MoE profiling shape finds no tuned FlyDSL config, falls back to a heuristic
  kernel and aborts LLVM inside determine_available_memory.

  Differences from the recipe this is ported from:
  - every source pinned to an immutable SHA, not a fork branch name (branches on
    personal forks can be force-pushed; MAD needs the image rebuildable later)
  - GH_TOKEN build-arg dropped: all three repos are public, and a token passed
    this way is recorded in image metadata
  - the flydsl 0.2.4 re-pin happens at build time, so the launcher no longer runs
    pip install inside every container at serve time
  - WITH_NIXL defaults to 0 (K3 uses the moriio connector only)
  - no runtime patchers: all connector/KDA fixes are committed in the pinned vLLM

scripts/vllm_multinode/
  Colocated (single-instance) multi-node serving - the counterpart to
  vllm_dissag, for models that do not fit one node but want lowest single-request
  latency rather than disagg throughput. TP within a node, PP across nodes.

  It owns only node discovery, the container launch and the head/worker split;
  models.yaml, socket_barrier.py, benchmark_xPyD.sh, benchmark_niah.sh and
  parse_to_csv.py are reused from vllm_dissag (scripts/ is mounted whole), so the
  model recipe and the CSV pipeline have one home.

  The three K3 colocated variants collapse to this one script: dry-run confirms
  pp2xtp8 / allgather / moriep argv differ only by --enable-expert-parallel and
  --all2all-backend, so they become three models.json entries rather than three
  near-identical run.sh copies.

Not built here - this environment has no docker and one 8-GPU node; the harness
is verified by DRY_RUN argv inspection only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
models.json: four entries, all skip_gpu_arch gfx950 (the existing four Kimi-K3
entries are gfx950/TP8 single-node and all carry skip_gpu_arch gfx942, so K3 is
currently skipped entirely on MI300X - this is that gap):

  pyt_vllm_disagg_mori_kimi-k3               -N 4  xP2 yD2 TP2 -> EP16/pool
  pyt_vllm_kimi-k3_mi300x_pp2xtp8            -N 2  TP8 x PP2, no EP
  pyt_vllm_kimi-k3_mi300x_wideep_allgather   -N 2  + EP, allgather_reducescatter
  pyt_vllm_kimi-k3_mi300x_wideep_moriep      -N 2  + EP, mori_low_latency

The three colocated entries differ only in ENABLE_EP / ALL2ALL_BACKEND /
AITER_SITUV2_A8W4, which is why they share one launcher.

Result reporting: BENCHMARK_SCRIPT=niah previously produced logs and nothing
else, so a model declaring multiple_results would have reported no metric.
- parse_to_csv.py gains --niah: parses benchmark_niah.py output and writes the
  same 29-column madengine perf.csv as the throughput path (verified identical
  column sets). One row per context size, performance = needles found /10. A
  size that errored is written as a FAILURE row with performance 0 rather than
  dropped, so a pass->crash regression is visible instead of silent.
- benchmark_niah.sh calls it.
- Both slurm launchers copy /run_logs/$SLURM_JOB_ID/perf.csv to
  ./perf_$MODEL_NAME.csv on completion: madengine resolves multiple_results
  against the job directory it launched from, not the container log mount.
  No-op for entries that do not declare multiple_results.

Verified: madengine discover goes 133 -> 137 with exactly these four added and
none removed; every referenced dockerfile and script exists; -N matches each
topology; the int4 quantization-config survives shell word-splitting as valid
JSON; DeepSeek moriio and rixl/deepep DRY_RUN output is byte-identical to
develop.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Ports the writeups from PR ROCm#193 next to the existing gfx950 K3 doc, keyed to the
madengine tags rather than to shell scripts: topology rationale (why MI300X needs
multi-node and why the disagg pool needs TP2), the gfx942 knobs and where each
one lives now, the NIAH results, and the three root-cause fixes.

Corrections carried in:
- the NIAH ceiling is 900K throughout. The upstream READMEs still said 300K in
  seven places after two later commits raised it to 500K and then 900K.
- states that the NIAH harness sizes context in WORDS (~1.3x tokens) while the
  results table is in tokens, so the two columns are not comparable.

benchmark/kimi_k3/README.md gains a pointer: all four entries there carry
skip_gpu_arch gfx942, which is exactly the gap the MI300X page fills.

Every tag, node count and knob value in the new page is checked against
models.json and models.yaml.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…metadata

The four MI300X Kimi-K3 entries could not run correctly on a cluster. Three
separate defects, all from the colocated launcher inheriting conventions that
only hold for the disaggregated one.

Node sizing. The entries carried `"args": "-N 4 -n 4"` on the assumption that
madengine forwards args to sbatch. It does not — args are appended to
`bash <model>.slurm`, and neither launcher parses $@, so the flags were dropped
and the job was submitted with the `slurm.nodes` default of 1. Sizing now uses
`distributed.nnodes`, which madengine reconciles into `#SBATCH --nodes`, and the
inert args are removed. `slurm.nodes` is deliberately left unset: setting it
selects the multi-node preset, whose `NCCL_SOCKET_IFNAME=eth0` is forwarded into
the container by run_xPyD_models.slurm and would override the fabric interface
on an RDMA cluster. `slurm.time` is set explicitly instead, since the
single-node preset's 12 h default is short for a full NIAH sweep.

NIAH model tag. benchmark_niah.sh requested MODEL_PATH as the model name,
correct for the disagg path where vLLM defaults served_model_name to the serve
argument. serve_colocated.sh passes `--served-model-name "$MODEL_NAME"`, so
every request 404'd and all three colocated entries — which default to
BENCHMARK_SCRIPT=niah — would have recorded a full sweep of FAILURE rows. The
harness now honors NIAH_MODEL when a launcher sets it, and the colocated
launcher sets it to the tag it actually serves.

Colocated run metadata. parse_to_csv derived nnodes, n_gpus, deployment_type and
tags from xP/yD. serve_colocated.sh exports xP=1 yD=0 only so the shared log
filenames stay unique, so a 2-node 16-GPU colocated run reported itself as a
1-node 8-GPU `disagg_1P0D` with a nixl backend it never used. Node count now
comes from NNODES (exported by both launchers), and a launcher whose shape is
not "xP prefill + yD decode" states its own identity via PERF_DEPLOYMENT_TYPE /
PERF_TAGS. The disagg path is byte-identical to before.

Also corrects the README, which documented the args-to-sbatch behavior that does
not exist and a quick start that cannot work now that the "<supply-your-image>"
placeholder is rejected rather than pulled.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
NUM_NODES is derived from the requested topology (xP+yD), not from the
allocation, and the node list was then truncated with `head -n $NUM_NODES`. A
short allocation therefore produced a silently wrong topology: pools were built
from nodes that were never allocated, and the run failed much later as a
connector handshake timeout with no indication of the real cause.

This mattered little while these models were always launched from a matching
`salloc`, but the sbatch path now sizes the allocation from the model card, so a
mismatch between card and cluster is a reachable state. Check up front and name
the three ways to fix it.

The colocated launcher already fails on the equivalent mismatch via its
TP*PP == NNODES*GPUS check, so it needs no counterpart.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ntract

parse_to_csv.py hand-wrote a full 29-column perf.csv, assembling node counts, GPU
counts, launcher, image and tags from the environment. Most of that is not the
workload's to know: madengine already owns it, and the guesses were wrong for the
colocated launcher, which sets xP=1 yD=0 only to keep log filenames unique.

The NIAH writer now emits a narrow CSV — model, performance, metric, status, plus
descriptive columns — and madengine merges in the run metadata via the entries'
`multiple_results` declaration. The columns that genuinely describe the workload's
own configuration rather than its placement (tp, pp, ep_backend, prefill_decode)
move to descriptive columns, matching how scripts/vllm/run_vllm.py already reports
tp/dtype/bs on the templated path. Nothing is lost; it is relocated to whichever
side actually knows it.

`status` stays explicit: an errored context size scores 0, and deriving status from
performance would file that real failure as a SUCCESS.

Scoped to leave every other workload alone. The NIAH writer is reachable only by the
four Kimi entries, which all declare `multiple_results`. The throughput writer keeps
its full-schema output by default, because the twelve disagg cards that use it
declare no `multiple_results` and madengine reads their CSV directly with no
metadata to merge — a narrow CSV there would drop every descriptive column. Their
output is byte-identical; `--narrow` is the opt-in for migrating one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…uted.nnodes

madengine reads only slurm.nodes when emitting `#SBATCH --nodes`
(deployment/slurm.py: `self.nodes = slurm_config.get("nodes", 1)`), and
nothing maps distributed.nnodes across — build_orchestrator copies nnodes
into deployment_config.distributed for launcher detection only. The four
MI300X model cards carried nnodes but no slurm.nodes, so every one of them
would have been submitted as a 1-node job. The launcher's
TP*PP == NNODES*GPUS_PER_NODE assertion catches it, but only after the
allocation is granted.

Add nodes/gpus_per_node to the four slurm blocks, and ship the site configs
that carry the values a model card cannot:

  - results_dir, absent from the key list madengine copies out of models.json,
    and required because the slurm_multi collector globs results_dir for
    perf*.csv rather than resolving multiple_results
  - MODEL_DIR / LOG_PATH, which otherwise default to /shared_inference

*.json is gitignored repo-wide, so the templates need explicit negations or
they never reach a clone.

Correct the two README claims that did not match madengine's behavior
(nnodes-sizes-the-allocation, multiple_results-is-resolved-first), document
that --account/--qos are unwired for slurm_multi and need SBATCH_ACCOUNT,
and drop --keep-model-dir from the SLURM examples — it is a local-Docker
flag that madengine ignores with a warning on SLURM.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Four defects, each found by running the recipes end to end on a real
MI300X SLURM cluster for the first time. None of them could have survived
a single successful run, which is consistent with these cards never having
been executed through madengine.

1. Build was not reproducible. Every source is pinned to a commit SHA, but
   pip resolves build dependencies in an isolated environment from PyPI at
   build time, so nothing pinned the toolchain. setuptools >= 80 added
       assert isinstance(self.compiler, CCompiler)
   to distutils' build_ext.build_extension, which MoRI's legacy
   Cython.Distutils.build_ext path violates, so the amd_mori wheel failed
   with "AssertionError: run() must precede build_extension()" while every
   pinned SHA was still correct (job 223849). PIP_CONSTRAINT is the only
   mechanism that reaches inside pip's build isolation -- installing
   setuptools in the image does not. Set globally so the AITER, vLLM and
   router stages cannot regress the same way. Build then completed in
   19 minutes, all 18 stages (job 223872).

2. RDMA library mounts used -e, which is true for directories. Docker
   creates a DIRECTORY at a bind-mount source that does not exist, so the
   first run on a node lacking e.g. libionic.so.1 leaves an empty directory
   behind, and every later run on that node mounts a directory over a file
   inside the image:
       OCI runtime create failed: ... not a directory
   Self-propagating and per-node, so it presents as intermittent. The
   surviving node then waits at socket_barrier.py forever for a peer that
   already died -- 4h10m of "Waiting for nodes. . ." before the wall clock
   (job 223909). Use -f so only regular files are mounted.

3. pyt_vllm_kimi-k3_mi300x_pp2xtp8 omitted the gfx942 MoE requirement that
   the two wideep variants carry. gfx942 has no scaled-MXFP4 MFMA and the
   a16w4 SiTUv2 heuristic FlyDSL kernel cannot codegen there, so the MoE
   must be requantized to packed int4. Without it the worker aborts inside
   determine_available_memory with
       LLVM ERROR: Do not know how to expand this operator's operand!
   and quantization_config=None in the engine config (job 224132). This is
   a hardware requirement, not an EP-specific tuning, so all three
   colocated cards now carry AITER_SITUV2_A8W4=1 and the int4 config.

4. A run that produced no results exited 0. The launchers warned about a
   missing perf CSV and returned success anyway, so madengine recorded
   exit_code=0 in its completion marker and the collector reported
   "0 successful, 0 failed" -- a hard engine crash was indistinguishable
   from a clean run. For a benchmark repo that is the worst possible
   reporting outcome. Both launchers now exit 1.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Each of these cost hours to diagnose on a real cluster, and in every case
the symptom is a long way from the cause -- an intermittent multi-node
hang that is actually a poisoned bind-mount path, a wheel build that fails
while every pinned SHA is correct, an LLVM abort that is a missing
quantization flag. Record them so the next person reads instead of
rediscovers.

Also record the cluster facts a model card structurally cannot carry: the
SLURM association wall-time cap (which silently parks a job as PENDING
rather than failing), account requirements, docker on compute nodes, and
the fact that a registry-less cluster has no supported path to distribute
an image -- --build-on-compute requires --registry.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds Kimi-K3-MXFP4 (MI300X gfx942 MXFP4 MoE) to the vllm_dissag framework:
- models.yaml: K3 recipe env anchor + model entry (TP2×DP8, MoRI-EP)
- run_xPyD_models.slurm: allowlists + 2P/2D validation + JIT cache split
- moriio.sh: K3-gated topology (pod_hosts, api-server-count, headless KV)
- vllm_disagg.sh: pod hosts export + _model_config_to_array helper
- argv_assert.sh: K3 offline tests

Config-only integration; image build documented in README.

Co-Authored-By: Claude <noreply@anthropic.com>
…lsifiable

Both found on the first end-to-end MI300X run (job 224200), which served
Kimi-K3 and produced results -- but results that could not be trusted, from
a job that then would not exit.

Deadlock on teardown. serve_colocated.sh has the head kill only its own
server and exit, while every worker sits in `wait` on a headless vLLM that
nothing stops. srun waits on those tasks, so the job holds all nodes until
the wall clock: 4.5 hours of two idle exclusive MI300X nodes AFTER the
benchmark had already written perf.csv. The head now raises a sentinel on
the shared log volume and workers watch for it. The sentinel is raised from
an EXIT trap so a head that fails or times out cannot strand workers either.

NIAH could not distinguish truncation from retrieval failure. Scoring reads
content + reasoning_content, and K3 is a reasoning model served with
--reasoning-parser kimi_k3, so a trace that exhausts max_tokens is cut off
and only the earliest needles survive. At the old 2048 default, two of four
context sizes scored 1/10 and both listed exactly ANIMALS[0] -- the needle
placed first in the haystack. That signature is a truncated trace, not a
model failure, but finish_reason was never recorded so the two were
indistinguishable, and every row was written SUCCESS regardless.

  - record finish_reason and print it as finish=<reason>
  - raise the default max_tokens to 8192
  - keep the needle count as the metric, always reported, never dropped
  - mark a truncated row FAILURE and annotate the metric, so a measurement
    artifact cannot enter the results as if it were a model result

9/10 stays SUCCESS: the README documents ~9/10 at >=20K as a known RDMA
residual, so a strict 10/10 gate would flag known-acceptable behaviour.
Logs predating the finish= field still parse.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 1, 2026 19:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Kimi-K3 MI300X support by integrating a new colocated multi-node vLLM launcher alongside updates to the existing disaggregated (prefill/decode) vLLM harness, plus reporting/benchmarking and documentation updates to make results consumable by madengine.

Changes:

  • Introduces a 2-node colocated vLLM SLURM+container launcher (vllm_multinode) with shared-model recipe support and shutdown coordination.
  • Extends the disaggregated launcher path to support TP_SIZE>1, multi-node pool host advertisement for MoRIIO, and NIAH benchmarking/reporting.
  • Adds Kimi-K3 model recipes/cards, MI300X-specific docs/site-config templates, and a pinned Dockerfile for the K3 MI300X image.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/vllm_multinode/serve_colocated.sh Per-node in-container entrypoint for colocated multi-node vLLM serving + benchmarking.
scripts/vllm_multinode/run_multinode.slurm SLURM launcher that discovers nodes/IPs, runs per-node containers, and publishes perf CSV.
scripts/vllm_dissag/vllm_disagg.sh Adds TP-aware topology math and peer-pool host export for KV connector.
scripts/vllm_dissag/run_xPyD_models.slurm Adds Kimi-K3 support, TP_SIZE plumbing, NIAH option, safer RDMA mounts, perf CSV publish.
scripts/vllm_dissag/parse_to_csv.py Adds narrow-schema perf CSV mode, NNODES-aware metadata, and NIAH parsing/output.
scripts/vllm_dissag/models.yaml Adds Kimi-K3 MI300X serving recipe env + flags (MXFP4/int4 MoE path).
scripts/vllm_dissag/connectors/moriio.sh Adds multi-node pod host list to KV config; TP-aware api-server-count and tp flag.
scripts/vllm_dissag/benchmark_niah.sh Uses NIAH_MODEL when set; emits perf.csv for NIAH via parse_to_csv.py.
scripts/vllm_dissag/benchmark_niah.py Raises default max_tokens, records finish_reason, and prints parseable result lines.
models.json Adds Kimi-K3 MI300X disagg + colocated model-card entries with multiple_results CSV.
docker/pyt_vllm_kimi_k3_mi300x.ubuntu.amd.Dockerfile New pinned build for Kimi-K3 MI300X (MoRI/AITER/vLLM/router + graft step).
benchmark/kimi_k3/README.md Notes gfx942 requires multi-node sharding and points to MI300X recipes.
benchmark/kimi_k3/mi300x/slurm-config.disagg.json Site-config template for 4-node disaggregated MI300X runs.
benchmark/kimi_k3/mi300x/slurm-config.colocated.json Site-config template for 2-node colocated MI300X runs.
benchmark/kimi_k3/mi300x/README.md Full MI300X recipe documentation, tradeoffs, and madengine integration notes.
.gitignore Ensures MI300X site-config templates are not ignored.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +105 to +108
if [[ -n "${COLOCATED_EXTRA_ARGS:-}" ]]; then
eval "extra_args=(${COLOCATED_EXTRA_ARGS})"
serve_args+=("${extra_args[@]}")
fi
Comment on lines +149 to +151
docker rm -f $DOCKER_CONT_NAME 2>/dev/null || true
fuser -k 2223/tcp 2>/dev/null || true
sleep 2

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 52a5a7c: the fuser -k is gone, and the barrier port is one per job (20000 + job id mod 9000), passed into the container as CONTAINER_BARRIER_PORT.

Job 239755 (Kimi-K3, 2x8 on oci-64) died in vLLM's startup barrier. Node 0
finished loading weights at 23:21:41 and entered in_the_same_node_as ->
torch.distributed.barrier; node 1 was still constructing MoE layers ~50 min
later. gloo gave up at 23:51:41, exactly 1800s in, and the master's TCPStore
died with it, so node 1 then failed with "Broken pipe" to :29500. The barrier
is all-or-nothing across all 16 ranks, so what has to stay small is the GAP
between nodes, not the absolute load time.

Five problems, addressed here:

1. --distributed-timeout-seconds does not reach the barrier that failed. It
   feeds ParallelConfig.distributed_timeout_seconds, which only configures the
   device/NCCL groups. The startup barrier runs on the gloo CPU group, built by
   GroupCoordinator from the separate cpu_distributed_timeout_seconds field.
   Unset, it falls back to PyTorch's stock 1800s -- which is exactly the
   deadline in the traceback, despite 7200 being passed. Pass
   --cpu-distributed-timeout-seconds too.

2. Cold AITER JIT compile on every rank, every run. The image points
   AITER_JIT_DIR/TRITON_CACHE_DIR/VLLM_CACHE_ROOT/COMGR_CACHE_DIR at
   /opt/vllm_cache, but this launcher mounted only /tmp/vllm_cache, a path
   nothing reads, inside --rm containers. Mount a host-persistent cache at
   /opt/vllm_cache keyed by image ID, as vllm_dissag/run_xPyD_models.slurm
   already does. Per-node cold compile is precisely the skew the barrier
   cannot absorb.

3. WORKER_PID was tee's PID. After `a | b &` the shell reports b, so every
   kill in this script hit tee and left vLLM running, and no liveness check
   was possible. Launch through process substitution instead.

4. A dead engine was indistinguishable from a slow one. The head polled the
   log for the full 4000s after its writer had already died, then reported a
   timeout rather than the traceback. Both wait loops now check liveness --
   via a helper that also rejects zombies, since an exited-but-unreaped child
   still answers kill -0. This also fixes a latent hang where a worker would
   spin forever on a dead engine.

5. Container env was a closed allowlist. Tuning any of the above from CI meant
   a new -e line and another MAD PR. COLOCATED_FORWARD_ENV names the variables
   to forward, and they are passed via docker --env-file so values containing
   spaces survive. The file is node-local, mode 600, and unlike the wrapper
   scripts is never archived as a build artifact.

Also adds an opt-out checkpoint page-cache pre-warm before the container
barrier (PREWARM_CHECKPOINT=0 to skip). Its per-node duration is the real
diagnostic: a large spread means the storage path is the problem and no
timeout will fix it.

Verified: bash -n clean on both files, and on the single-quoted srun body
extracted in isolation; env-file forwarding preserves spaces and skips unset
vars at mode 600; the liveness helper correctly reports an unreaped child as
dead; DRY_RUN=1 emits the new flag and honours an override, with
COLOCATED_EXTRA_ARGS still appended last.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 3, 2026 14:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new run_multinode.slurm launcher has verified set -u-triggered failure paths (optional env expansion and hardcoded barrier port) that can prevent runs from starting or make barrier cleanup inconsistent.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

scripts/vllm_multinode/run_multinode.slurm:158

  • The barrier port is configurable via CONTAINER_BARRIER_PORT (and serve_colocated.sh honors it), but this fuser call always kills 2223. If the port is overridden, stale listeners on the configured port won’t be cleared and the barrier can hang/fail. Use the same ${CONTAINER_BARRIER_PORT:-2223} default here.
fuser -k 2223/tcp 2>/dev/null || true
  • Files reviewed: 15/16 changed files
  • Comments generated: 1
  • Review effort level: Lite

Job 240624 spent its entire 7200s allocation in the pre-warm added by the
previous commit. Both nodes printed "[prewarm] reading ..." and neither ever
printed "[prewarm] done", so vllm serve was never launched -- the run timed
out having tested nothing.

The flaw: it reads the WHOLE checkpoint on EVERY node, while PP2xTP8 means a
node only ever loads its own shard. On a 1453 GiB checkpoint that is roughly
4x the necessary I/O against a single NFS export, with both nodes competing
for it. It manufactured exactly the contention it was meant to relieve.

Default it to off. It stays available, because the per-node duration is a
useful storage probe -- a large spread between nodes means the storage path is
the problem and no timeout will fix it -- but it is now opt-in via
PREWARM_CHECKPOINT=1 and bounded by PREWARM_TIMEOUT_SECONDS (default 900). On
expiry it warns that the filesystem could not deliver the checkpoint in the
window and proceeds, rather than burning the whole allocation.

Note this run did not exercise --cpu-distributed-timeout-seconds: vLLM never
reached the startup barrier, so the absence of the 1800000ms gloo timeout in
the log says nothing either way. That fix is still untested.

Verified: default unset is silent; PREWARM_CHECKPOINT=1 runs and reports its
duration; a stalled read hits the budget, warns, and exits 0 so startup
continues.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 3, 2026 18:19
Cemberk and others added 7 commits November 6, 2026 16:07
A worker of the colocated launcher waited while its vllm serve was alive and
then exited 0, also when the server had died on its own. Nothing told the
head, whose server then never became ready: it waited out
LOG_WAIT_TIMEOUT_SECONDS (4000 s), while the dead worker's task reported
success.

A worker whose server ends before the head's shutdown signal now prints the
server's log tail, writes .worker_failed_NODE<rank> with its status in the
shared per-job log directory, and exits 1. The head's readiness wait stops at
once on such a marker, naming the worker; its exit trap raises the shutdown
signal for the other workers, as before. The per-job log directory can be
overridden with _RUN_LOGS, as in vllm_disagg.sh, for the new
colocated_worker_assert (11): dying worker, head stopping on it, and a
worker shut down by the head still exiting 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ils the node

The head discarded the benchmark's exit status and always exited 0, so a run
whose benchmark failed reported success. It now stops the server and exits with
that status. A container barrier that fails (a node's container never came up)
used to be ignored and the node went on to start its server; it now fails the
node with a message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A sweep over several concurrencies writes each aggregate JSON under
<workload>/conc<N>/, one level deeper than the -maxdepth 2 search reached, so a
sweep published no perf.csv. Search to depth 3, and name each row by workload
and concurrency ("agentic coding conc16") instead of by the conc<N> directory
alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It resolved EP_TP_SIZE from the recipe for the host-side JIT cache split but did
not forward it, so the in-container launcher could run with a different value
than the cache was keyed on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pkill -f "sleep 30" could kill any process on the machine running that
command. The stand-in now sleeps a duration unique to the test run, and only
that exact command is killed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The file holding forwarded values (which can include credentials) had a
predictable /tmp name and was created with rm/truncate/chmod, so another user
could pre-create it or a link at that name. mktemp creates it new with mode 600,
and it is removed however the node exits, a cancelled run included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cancelled run's other ranks can start their stand-in container after the
test's one-time cleanup; the test's EXIT trap now kills them too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The _way4 card carries only MAD_CONFIG; its MODEL_NAME and the rest are in
mad-config.kimi-k3.yaml, which madengine resolves and plain sbatch does not.
Submitted with sbatch, the launcher stopped on "set MODEL_NAME" with no hint
why. It now stops before any work and says the file is a madengine layered
config. Tested in launcher_verdict_assert.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cemberk added a commit to Cemberk/MAD that referenced this pull request Nov 16, 2026
Brings ROCm#242's review fixes into ROCm#293: the agentic error rate counted as
validate_agentic_result.sh counts it, sweep (conc<N>) aggregates in perf.csv,
the colocated head's benchmark status and barrier failures, a failed worker
failing the job, EP_TP_SIZE forwarded by run_interactive.sh, header-only
perf CSVs failing the verdict, the mktemp forwarded-env file, and the
MAD_CONFIG refusal in the colocated launcher.

Conflicts were the same fixes applied on both sides: kept this branch's
cluster_expand_nodelist, CONTAINER_ENV/GPU_MEM_TRACE and long-context tests,
and took ROCm#242's launcher directory resolution, header-only verdict and
test-sleep cleanup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cemberk added a commit to Cemberk/MAD that referenced this pull request Nov 16, 2026
Brings ROCm#293's head: ROCm#242 (through its merge into ROCm#293), the run_interactive
JIT_CACHE_HOST / JIT_LOCK_STALE_MIN forwarding, the standalone k8s refusal
of a layered-config card, and the SGLang disagg Dockerfile's per-architecture
BASE_DOCKER / BASE_DOCKER_GFX950 ARGs that the mad-validate workflow's
renderer reads. Conflicts: kept this branch's disagg barrier-port test and
cache directories in launcher_verdict_assert.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cemberk added a commit to Cemberk/MAD that referenced this pull request Nov 16, 2026
Brings ROCm#293's head, which now carries ROCm#242: the MAD_CONFIG refusal in the
colocated launcher, run_interactive.sh passing JIT_CACHE_HOST and
JIT_LOCK_STALE_MIN, and ROCm#242's merge of develop (kvcache_transfer_bench and
the other develop changes it carried).

Resolved in favour of this branch's structure: the Kubernetes agent and its
token stay removed (pods dispatch per pod), submit.py keeps its own layered
config handling (resolved through madengine when installed), the colocated
srun body stays in node.sh, the per-model SGLang disagg Dockerfile stays
retired (docker/di_sglang + docker/pins/sglang-disagg.json), and
docs/sglang-disagg.md keeps the pin-set build instructions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cemberk and others added 4 commits November 18, 2026 16:06
develop's ROCm#226 (KV_OFFLOAD tiered prefix caching) changed the same vLLM disagg
files. Resolved:

- connectors/moriio.sh
  - kv config: develop's read_mode plus our peer-pool hosts (moriio_pod_hosts,
    only when EP_TP_SIZE>1).
  - master: our api-server-count clamp plus develop's offload wrap. The offload
    TP world is EP_TP_SIZE (each DP rank spans that many GPUs), 1 at TP1.
  - headless children: at EP_TP_SIZE>1 they keep the full connector config, as
    validated on Kimi-K3-MXFP4 2P/2D; at TP1 they take develop's config with
    proxy_ip emptied.
  - router: develop's multi-node host/rank args and policy env apply at TP1;
    TP-within-EP keeps its --moriio-dp-size path.
  - serve: both MAX_NUM_BATCHED_TOKENS (ours) and MAX_MODEL_LEN (develop).
- connectors/rixl.sh (DeepEP): our recipe-driven block size, KV dtype and memory
  default with develop's prefix-cache arg and MAX_MODEL_LEN cap;
  --kv-cache-memory-bytes is passed once.
- run_xPyD_models.slurm: develop's DISABLE_HOST_RDMA_MOUNTS gate (both sides
  had moved to -f) with our note on why; develop's MT_* forwards with our
  quoted NIAH_WORDS.
- parse_to_csv.py: ours. The per-cell parser walks every [RUNNING] header, so
  develop's off-by-one fix to the old loop does not apply.
- tests/argv_assert.sh: both suites. A TP1 headless child now carries
  --kv-transfer-config with proxy_ip emptied (develop's behaviour), so that
  assertion changed; added one that the TP-within-EP child keeps proxy_ip and
  its pod hosts.

argv_assert 174/174; run_all, parse_to_csv (vLLM 24, SGLang 15), gate_check,
bench_model_name, colocated_worker, launcher_verdict all pass; both-paths
check passes against madengine develop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
develop's kvcache_transfer_bench run.slurm (ROCm#269) uses both, correctly:
awk '"'"'{print $1}'"'"' puts a literal apostrophe in the body, and
'"${MAD_SYSTEM_GPU_ARCHITECTURE:-}"' splices a value with a default. The
checker paired apostrophes left to right, so the double-quoted apostrophe
shifted every pair after it, and its splice pattern allowed only $VAR and
${VAR}. Both are now recognised. It still reports the two truncations its
docstring records, and a default holding a command substitution.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…V4 (ROCm#302/ROCm#318), new models (ROCm#319)

Resolved as in ROCm#293, under the same rules (this PR's behaviour where it reaches our stack,
develop's scoped to DeepSeek-V4):
- Boot failure: this PR's check on the waited-on log, the abort file and _job_fail, with
  develop's scan of every node's worker log and its BOOT_FATAL marker.
- Barrier: develop's port cleanup and timeout with the abort file; socket_barrier.py as in ROCm#293.
- MoRI-IO: develop's config builder (DeepSeek-V4 tuning, router install at boot, router argument
  array) with this PR's pod hosts and --moriio-dp-size for TP-within-EP.
- NIAH: the chat harness by default; develop's prompt-method harness (benchmark_niah_methods.py)
  when NIAH_METHOD is set (run_wideep.sh).
- parse_to_csv: the per-cell parser and NIAH errors with develop's tolerant NIAH line and
  appending perf.csv.
- Launcher: Kimi-K3 and DeepSeek-V4 in the model lists; BOOT_FATAL ends the step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… flags do not

The Kimi-K3 recipes set both, so the merged connectors passed the flag twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@coketaste coketaste left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR does a lot of useful work. It adds a shared site file (scripts/common/cluster.sh), gives every launcher one job verdict (cluster_job_verdict) with FAILURE rows, checks the GPU arch before weights are read, and cleans up containers when a job is cancelled. I checked out the head (1eb749b) locally:

  • the model validator passes all 208 models, with no duplicate names;
  • the GPU-free suites added here all pass: argv 175/175, vLLM parse 24/24, SGLang parse 15/15, verdict 33/33, colocated worker 17/17, plus check_continuations, check_srun_quotes and check_gpu_arch_declarations.

Many earlier review comments look addressed: the TP_SIZE/PP_SIZE defaults, cluster_mark_dir inside srun, pipefail, the tee PID, COLOCATED_FORWARD_ENV, Kimi in VALID_MODELS, and PyYAML.

One blocker: eight existing SGLang disagg cards now set USE_CX7_NICS=1 (inline). The other comments are hardening suggestions.

Comment thread scripts/sglang_disagg/models.json Outdated
"DP_MODE": "0",
"RUN_MORI": "1",
"USE_CX7_NICS": "0",
"USE_CX7_NICS": "1",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[blocking] This PR changes USE_CX7_NICS from "0" to "1" on 8 existing cards (mori_io and mooncake for llama-3.1-8b, qwen3-32b, llama-3.3-70b-fp8 and llama-3.1-405b-fp8). No commit in the branch history sets it explicitly, so it most likely came in through a merge conflict resolution. Two effects:

  1. mori_ep_env.sh pins NCCL_IB_HCA/IB_DEVICES to the mlx5 rail list, which is wrong on AINIC/Thor2 nodes and overrides what cluster.sh detects.
  2. select_same_rail_nodes exits 1 when the allocation spans more than one leaf, which #SBATCH --switches=2 allows, so these cards now fail depending on where the nodes land.

It also goes against this PR's own rule that fabric settings live in cluster.sh, not in cards. Please restore "0", or drop the key and let cluster.sh's default apply.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it was a merge leftover. cdff5d5 merged develop when models.json moved per directory, and it carried the branch's old root values across. Fixed in e38a6a0: every card's USE_CX7_NICS is develop's value again (0 on all eight), so cluster.sh decides the fabric and select_same_rail_nodes isn't triggered. One thing worth knowing: with 0, the Mooncake/MoRI-IO SGLang cards send KV over the mlx5_1 management NIC (mori_ep_env.sh), exactly as on develop.

"MODEL_NAME": "DeepSeek-V3",
"xP": "1",
"yD": "1",
"WIDE_EP": "1",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] Adding WIDE_EP=1 to the pyt_vllm_disagg_nixl_deepseek-* cards (RUN_MORI=0, RUN_DEEPEP=0) resolves to CONNECTOR=rixl + EP_BACKEND=deepep. So these 'nixl' cards now run exactly what pyt_vllm_disagg_deepep_deepseek-* runs, but their perf rows are labelled nixl. Either drop the nixl DeepSeek cards or make the card/tag say DeepEP.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. On develop these cards don't run at all: DeepSeek is wide-EP only, and without WIDE_EP they resolve to rixl+TP and are refused. With WIDE_EP=1 they run rixl + DeepEP, the same as the DeepEP cards. For now they say so (d9889b2):

  • The three cards carry the deepep tag beside nixl. Their KV transfer is NIXL; their EP is DeepEP.
  • The perf rows are labelled deepep. The parser now labels the EP backend the run resolved (WIDE_EP + EP_BACKEND) instead of looking only at RUN_DEEPEP. parse_to_csv_assert.sh covers it.

Since they duplicate the DeepEP cards, we plan to remove them in a follow-up cleanup.

mkdir -p /tmp/rocshmem-build && cd /tmp/rocshmem-build && \
/tmp/rocm-systems/projects/rocshmem/scripts/build_configs/all_backends \
-DUSE_EXTERNAL_MPI=OFF -DGPU_TARGETS="${K3_GFX_ARCH}" && \
cd /tmp && git clone https://github.com/ROCm/DeepEP.git && cd DeepEP && \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] DeepEP is cloned from its default branch with no pin, while this same PR pins rocSHMEM because tracking develop broke the build. Add ARG DEEPEP_REF=<sha> + git checkout "${DEEPEP_REF}" so the image is reproducible.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 7fa491c: ARG DEEPEP_REF=0f63d3e9… (the DeepEP build the Kimi-K3 stack is validated with), checked out after the clone and written to /app/versions.txt, the same way as rocSHMEM. In #300 this Dockerfile becomes the vllm-kimi-k3 image spec, which selects the same DeepEP build from compat/rocm.yaml.

# recipe took a GH_TOKEN build-arg, which would bake the token into image
# metadata - removed).
# -----------------------------------------------------------------------------
ARG VLLM_REPO=https://github.com/raviguptaamd/vllm.git

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] vLLM (and the router at L246) build from a personal fork branch. The SHA pin protects against force-pushes, but not against the fork or branch being deleted. Before this becomes a supported card, consider mirroring the commit into a ROCm org repo.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, and #300 takes care of it. There, vLLM and the router are built from upstream commits, with the fork's changes carried as patches in docker/patches/ (sha256 and upstream status recorded in compat/rocm.yaml). docker/patches/verify.py proves that upstream + patches == the fork commit's tree. I ran it: all five patched builds reproduce their fork trees. So the fork going away no longer affects the build. Mirroring the commits into a ROCm repo would still be good for history, and I'll raise it with the owners.

#SBATCH --spread-job
#SBATCH --gres=gpu:8
#SBATCH --time=24:00:00
#SBATCH --output="/shared_inference/%u/model_blog_logs/slurm-%j.out"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] #SBATCH --output/--error are hardcoded under /shared_inference/%u/model_blog_logs/. On a cluster without that path, or for a user whose directory doesn't exist yet, Slurm can't open the file and the job fails with no log at all. Drop these directives (Slurm defaults to slurm-%j.out in the submit dir) or use a relative path.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 1272ebb. Slurm's default (slurm-<job>.out in the submit directory) applies, and the run's own logs still go to LOG_PATH. The two disagg launchers have the same directives, but those come from develop. I left them as they are in this PR, since changing them moves the log location for develop's current users. I can drop them in a follow-up if you'd prefer.

Comment thread scripts/common/cluster.sh Outdated
# --------------------------------------------------------------- slurm
# These mirror what the scheduler already tells a running job; they matter when
# a launcher is run by hand outside sbatch, where the SLURM_* names are unset.
export SBATCH_PARTITION="${SBATCH_PARTITION:-amd-rccl}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] Defaults for one specific site (amd-rccl partition/account, m2m cluster name, 10.158. subnet, /mnt/m2m_nobackup, /shared_inference) are exported from a shared file into every launcher. Consider leaving the SLURM_* identity values unset when SLURM doesn't provide them, and marking the remaining defaults as site-specific. Also, L173 references .claude/skills/mad-slurm-multinode/references/cluster-types.md, which doesn't exist in this repo.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in c27c50a. SBATCH_PARTITION, SLURM_JOB_ACCOUNT, SLURM_JOB_QOS and SLURM_CLUSTER_NAME are empty outside sbatch now, instead of one cluster's names. NVME_ROOT/SHARED_MOUNT/FABRIC_SUBNET_PREFIX are labelled as a reference site's defaults to set per site. The comment that pointed at a .claude/...cluster-types.md file not in this repository now says how to confirm the fabric on a node. #317 then moves a site's values into site profiles (MAD_CLUSTER / MAD_CLUSTER_FILE).

Comment thread scripts/vllm_dissag/models.yaml Outdated
# MFMA, and the image is built for gfx942. Native MXFP4 on MI355X is its own recipe.
GPU_ARCHS: "gfx942"
VLLM_USE_V1: "1"
NCCL_DEBUG: "WARN"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] NCCL_DEBUG: WARN / NCCL_DEBUG_SUBSYS: INIT,NET in the Kimi-K3-MXFP4 recipe look like leftover debug settings, and they override whatever the submitter sets (run_xPyD_models.slurm already forwards NCCL_DEBUG*). Suggest removing them.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 7fa491c.

@@ -0,0 +1,144 @@
#!/bin/bash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] The new GPU-free checks all pass locally, but no workflow runs them (.github/workflows/mad-validate.yml is unchanged). Several of them catch shell-quoting failures that bash -n misses, so a CI job for them would be valuable.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in d6c897d. scripts/common/tests/run_offline.sh finds the static checks, every *_assert.sh, the vllm_dissag offline suites and the unittest directories by location. mad-validate.yml gets a launcher-offline job that runs it. Later PRs add to it without touching the workflow: #300 adds the patch check and the snapshot harness in all its modes.

# Per-variant serve flags (reasoning parser, max-model-len, quantization-config...).
# Word-split like the disagg driver does, so JSON values must carry their own quotes.
if [[ -n "${COLOCATED_EXTRA_ARGS:-}" ]]; then
eval "extra_args=(${COLOCATED_EXTRA_ARGS})"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] eval "extra_args=(${COLOCATED_EXTRA_ARGS})" is still here. The disagg path already splits with Python shlex. Doing the same here, e.g. mapfile -t extra_args < <(python3 -c 'import os,shlex;print("\n".join(shlex.split(os.environ["COLOCATED_EXTRA_ARGS"])))'), avoids running shell code from an env var inside a privileged container.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in b194f55, with shlex as you suggested. The output is captured first, so a split that fails (e.g. an unbalanced quote) stops the node with a message; mapfile < <(...) would have hidden that. colocated_worker_assert.sh covers a quoted JSON value, a quoted space, a $(...) that must not run, and the refusal.

Cemberk and others added 6 commits November 24, 2026 15:26
A merge of develop (cdff5d5, when models.json moved per directory)
carried the branch's old root values over: USE_CX7_NICS=1 on the
mori_io and mooncake llama-3.1-8b, qwen3-32b, llama-3.3-70b-fp8 and
llama-3.1-405b-fp8 cards. That pins NCCL to the mlx5 rails and makes
select_same_rail_nodes refuse allocations across leaves. Every card's
value is develop's again; cluster.sh decides the fabric.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s as site defaults

Outside sbatch SBATCH_PARTITION, SLURM_JOB_ACCOUNT, SLURM_JOB_QOS and
SLURM_CLUSTER_NAME are now empty instead of one cluster's names. The
filesystem roots and fabric subnet are labelled as a reference site's
defaults to set per site, and the comment pointing at a file not in this
repository now says how to confirm the fabric on a node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Slurm cannot open /shared_inference/<user>/... on a cluster without that
path (or before the user's directory exists) and the job fails with no
log at all. Slurm's default (slurm-<job>.out in the submit directory)
applies; the run's own logs still go to LOG_PATH.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DeepEP is checked out at 0f63d3e9 (the build the Kimi-K3 stack is
validated with) instead of its moving default branch, as rocSHMEM is.
NCCL_DEBUG/NCCL_DEBUG_SUBSYS in the Kimi-K3-MXFP4 recipe overrode what a
submitter sets; removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The disagg path already splits with Python's shlex; the colocated path
ran eval on an env value inside a privileged container. An unbalanced
quote now fails the node with a message. colocated_worker_assert covers
quoted JSON, a quoted space, a command substitution that must not run,
and the refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/common/tests/run_offline.sh finds the static checks, every
*_assert.sh, the vllm_dissag offline suites and the unittest directories
by location, so suites added later run without editing the workflow.
mad-validate.yml gains a launcher-offline job that runs it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With WIDE_EP=1 the pyt_vllm_disagg_nixl_deepseek-* cards resolve to
rixl + DeepEP (DeepSeek is wide-EP only), but their perf rows were
labelled nixl because the parser looked only at RUN_DEEPEP. The parser
now labels the EP backend the run resolved (WIDE_EP + EP_BACKEND), and
the three cards carry the deepep tag beside nixl.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Cemberk

Cemberk commented Nov 30, 2026

Copy link
Copy Markdown
Author

Thanks for the thorough pass. The blocker and all eight suggestions are addressed, and it's now carried up through #293, #299, #300 and #317:

  • USE_CX7_NICS restored: e38a6a0
  • cluster.sh site defaults: c27c50a
  • #SBATCH log path: 1272ebb
  • DeepEP pin and the recipe NCCL debug settings: 7fa491c
  • COLOCATED_EXTRA_ARGS without eval: b194f55
  • a CI job for the GPU-free suites: d6c897d
  • the nixl DeepSeek cards say they run DeepEP: d9889b2

Details inline. The offline suites pass on this head (bash scripts/common/tests/run_offline.sh).

…tegration

ROCm#313 moves multi-node MoRI-IO from router flags to peer hosts in the
connector config. Its multi-node path is taken as is; TP-within-EP
(EP_TP_SIZE>1, Kimi-K3) keeps its validated pod-host list and
--moriio-dp-size router path, and gets no remote_hosts. The master keeps
the api-server-count clamp and the TP-within-EP offload world, and gains
develop's --enable-scale-out. argv_assert: both sides' tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical runtime failures can break colocated NIAH collection and terminate unrelated listeners, while several new regression checks remain outside CI coverage.

38 open issues

And 18 more that still need to be addressed.

Review effort: Lite

Comment on lines +77 to 78
# Includes harness failure: a harness exits 1 when every request is NO-RESULT.
niah_rc=${PIPESTATUS[0]}
Comment on lines +32 to +39
# Container-creation barrier port. Env-overridable (BARRIER_PORT). The default
# was 5000, which this comment already called collision-prone: on the OCI hosts
# something the job cannot kill holds 5000, and the barrier "passed" on both
# nodes by connecting to it. 15000 is the port this connector's
# wideEP branch already uses for the same barrier, and the launcher's cleanup
# already frees it (run_xPyD_models.slurm: fuser -k 15000/tcp). The two
# branches never run in the same job.
CONTAINER_BARRIER_PORT="${BARRIER_PORT:-15000}"
scripts/vllm_multinode/tests/*_assert.sh; do
[ -f "$f" ] && run "$f" bash "$f"
done
[ -f scripts/vllm_dissag/tests/run_all.sh ] && run "vllm_dissag offline suites" bash scripts/vllm_dissag/tests/run_all.sh
Comment on lines +84 to +89
print("\n5. the card declares results both collectors look for")
ok5 = card.get("multiple_results") == "perf_Kimi-K3.csv"
print(f" multiple_results: {card.get('multiple_results')} (madengine honours it since b3e3180)")

allok = all([ok1, ok2, ok3, ok4, ok5])
print("\nRESULT:", "both paths generate a runnable invocation" if allok else "REGRESSION")
Comment on lines +101 to +103
JOB_ABORT_FILE="/run_logs/${SLURM_JOB_ID:-0}/ABORTED"
# Lines SGLang prints only when a server has died.
_FATAL_SERVER_LOG_RE='Scheduler hit an exception|Received sigquit from a child process'
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.

4 participants