Skip to content

Di refactor: dispatchers topology spec config layers image specs - #300

Open
Cemberk wants to merge 297 commits into
ROCm:developfrom
Cemberk:di-refactor
Open

Cemberk wants to merge 297 commits into
ROCm:developfrom
Cemberk:di-refactor

Conversation

@Cemberk

@Cemberk Cemberk commented Nov 4, 2026 •

Copy link
Copy Markdown

Draft: offline-verified; real-cluster runs pending (list below). Stacked on #293 (spurupdate): until it merges this PR also shows its commits. The image part overlaps #295 (workload image specs); it will be rebased onto that once #295 is in.

Distributed-inference cards (vLLM disaggregated, SGLang disaggregated, vLLM colocated multi-node) are restructured into layers. A setup is described rather than written into a launcher, and the same card runs on SLURM, Spur and Kubernetes, standalone and through madengine. Overview: docs/multinode-architecture.md.

Layers

  • Node program: each launcher's per-node body is scripts/<launcher>/node.sh; the shared parts are in scripts/common/node/node_lib.sh.

  • Dispatchers (scripts/common/dispatch/dispatch.sh, MAD_DISPATCH):

    • slurm-srun (default);
    • spur-array: one single-node task per node of a job array, with rendezvous on shared storage;
    • k8s-indexed: one pod per node.

    Kubernetes runs per pod only; the srun stand-in and agent are removed.

  • Shared launcher steps (scripts/common/launcher/launcher_lib.sh): node selection in the scheduler's order, addresses, running the node program, and the verdict.

  • Topology spec (scripts/common/topology/): roles, node counts, parallelism and router placement as data.

    • MAD_TOPOLOGY=<spec.json> replaces xP/yD/....
    • ROUTER_NODE=1 puts the router and benchmark client on a node of their own.
  • One configuration order (scripts/common/config/layers.sh): site < connector .env < recipe < topology spec < submit time, in every launcher. Each run writes config.resolved.json with every value and the layer that set it.

  • Images from image specs: every DI card names a shared spec ("image_spec": "${images.<name>}"). The specs are in compat/images/:

    • di-vllm, the shared base the vLLM stacks extend;
    • vllm-mori121;
    • vllm-kimi-k3;
    • vllm-glm51;
    • sglang-disagg.

    Each spec gives a base per GPU and selects builds authorized once in compat/rocm.yaml. Fork changes are carried as patches in docker/patches/, each with its sha256 and upstream status; verify.py checks that they reproduce the fork trees exactly. madengine (Kimi k3 hf download fix #248) generates the Dockerfile. The per-model DI Dockerfiles are removed.

Merged from develop, and how it was resolved (develop came in through #293):

Fixed on the way

  • A recipe (models.yaml env:) value never took effect for a name the launcher forwards when cluster.sh or the connector .env had a value for it.
  • The SGLang launcher sorted nodes by name, so with 10+ unpadded names a rank was given another node's address.
  • SGLang and rixl registered every address after the prefill nodes as a decode backend.
  • SGLang and colocated launchers failed under sbatch (spooled script).
  • SGLang's router-hosting prefill node lacked the server-metrics flags the other servers get.

MIR-AMD and others added 30 commits September 19, 2026 01:24
…y guard

Follow-up to 6e4ab58: remove the remaining MODEL_NAME==Kimi-K3-MXFP4 control-flow
coupling from the shared slurm/interactive launchers and harden the generic knob.

P1 (run_xPyD_models.slurm):
- resolve EP_TP_SIZE from the recipe at submit time (env/-e wins), mirroring
  vllm_disagg.sh; gate the wideEP+moriio combo check on (( EP_TP_SIZE>1 ))
- drop the K3-specific xP=2/yD=2 and NUM_NODES==4 locks; topology is generic
  (xP+yD) and correctness is enforced by the divisibility guard below

P3 (run_xPyD_models.slurm + tests/run_interactive.sh):
- role-split the persistent JIT cache when (( EP_TP_SIZE>1 )) instead of by model
  name; knob renamed JIT_CACHE_SPLIT_K3 -> JIT_CACHE_SPLIT_ROLE

Guard (vllm_disagg.sh):
- fail fast if EP_TP_SIZE does not divide GPUS_PER_NODE or the per-pool DP sizes

Tests (tests/argv_assert.sh):
- assert -e EP_TP_SIZE=1 override beats the recipe (K3 -> plain wideEP -tp 1)
- assert the divisibility guard rejects an indivisible EP_TP_SIZE (=3 on 8 GPUs)

Verified offline: argv_assert 40/40; bash -n on all touched files; resolve/split
simulation shows K3->EP_TP_SIZE=2 (JIT role-split ON, unchanged), DeepSeek/Llama->1
(split OFF, unchanged), -e EP_TP_SIZE=1 forces OFF. No residual name branching in
shared code (only the standard VALID_MODELS allowlist entries remain).
…eeds

The teardown srun sat at the end of the happy path, so any run that did not reach
it left its container running. `docker run` here is attached, but the container
belongs to the docker daemon and not to the job: scancel kills this script and
the srun under it, and the container keeps its GPU memory.

The next job to get that node then sees

    RuntimeError: The memory capacity is unbalanced.
                  Some GPUs may be occupied by other processes.

with no SLURM job on the node to account for it. Build 93 hit that, and build 93
was itself cancelled at the 4 hour wall clock after its scheduler died -- so the
runs that fail are the ones dirtying the nodes for the runs that follow.

The teardown is now a function on trap EXIT INT TERM, and idempotent, so the
explicit call and the trap can both fire. Every run cleans up after itself
whichever way it ends.

Verified: bash -n, both hazard checkers over 68 files, and the both-paths
generation check.
The card sets it, and it reached nothing. It is an aiter library variable read
inside the container by vLLM, documented in this repo at
scripts/vllm_dissag/models.yaml:298 as the SiTUv2 a8w4 path (fp8 activations,
int4 weights), so no script reads it and none should -- but it was on no -e list
either, so the container never saw it.

The same cards set COLOCATED_EXTRA_ARGS with
--quantization-config '{"moe":{"weight":"int4_per_group_32"}}', which IS
forwarded. So the weight format was requested and the kernel selection that goes
with it was silently dropped: builds 59, 60 and 101 all ran half the recipe.

Uses the ${VAR:+-e VAR=$VAR} form already used for BENCHMARK_ITR, NIAH_SEEDS and
NIAH_WARMUP, so the flag appears only when a card sets it.

This changes what is measured. Numbers from the next run are not comparable to
builds 59, 60 or 101.

Verified: bash -n, both hazard checkers over 68 files, and the pipeline's
reachability harness now classifies it as reaching the container.
madengine#121 adds Hydra config groups, and +profile / +env cover site facts
better than a model card can: they are chosen per run, by whoever launches, and a
card is the wrong place to describe a cluster.

So this file keeps what no Hydra group can express -- the serve recipe and the
benchmark -- and gives up the rest. layered_config now refuses a site: block
rather than ignoring one.

REQUIRE_LOCAL_WEIGHTS moves into model:, which is where it belonged anyway. It is
a fact about Kimi-K3 being 1.5T of weights, not about this cluster; the cluster
half -- which local root exists, and whether one does -- was always cluster.sh's.

Verified: resolving the twin still reproduces the original card's nine
environment values exactly, which is the property the twin exists to demonstrate.
…logy/JIT

- README/ARCHITECTURE: reference in-tree docker/vllm_disagg_inference.kimik3.ubuntu.amd.Dockerfile
- ARCHITECTURE: correct stale claims (topology no longer slurm-locked; JIT split gated on EP_TP_SIZE>1, not MODEL_NAME)
- argv_assert.sh: add non-K3 wideEP dormancy + parametric EP_TP_SIZE fuzz rows (40->56 tests)
K3-specialized sibling of docker/vllm_disagg_inference.ubuntu.amd.Dockerfile.
Byte-identical to the PR#241 standalone recipe (MoRI v1.2.2 + AITER 0.1.19 + K3-tuned FlyDSL).
The K3 image bakes TRITON_CACHE_DIR/VLLM_CACHE_ROOT/COMGR_CACHE_DIR/AITER_JIT_DIR
to /opt/vllm_cache, so this connector fallback never fires for K3. Reverting to
develop-s /tmp default keeps non-K3 moriio models (DeepSeek/Llama) byte-identical
to develop. No effect on the JIT role-split (image env + /opt mount, not this fallback).
rixl is not on the wideEP/K3 moriio path; the eval->helper swap was an unrelated
drive-by cleanup. Reverting to develop keeps the PR diff K3-scoped. The shared
_model_config_to_array helper stays (used by moriio.sh). Behaviorally identical
(64-cell dry-run parity showed rixl/deepep argv byte-identical).
Build 105 failed before serving anything:

    Error: MODEL_NAME 'DeepSeek-V3' is wideEP-only (set WIDE_EP=1).
           TP mode is not supported

The gate is right and the card was wrong. README.MD's supported-models table is
explicit -- the DeepSeek family and GLM-5.1-FP8 are wideEP-only, TP is rejected --
and WIDE_EP is caller-supplied: drive_cell.sh requires ${WIDE_EP:?} and nothing
anywhere derives it from MODEL_NAME. So a card naming one of those models and not
setting WIDE_EP cannot run, and thirteen of the seventeen cards here were in that
state. Only pyt_vllm_disagg_mori_kimi-k3 had it.

Driven off MODEL_NAME against the README table rather than off the card name,
which encodes the connector and not the model: the same DeepSeek-V3 appears under
nixl, mori, deepep and agentic, and all four were equally broken.

The three dense TP-only cards -- Llama-3.3-70B, Llama-3.1-405B, gpt-oss-120b --
are deliberately untouched. Setting WIDE_EP on those would break them the
opposite way, which is why this keys on the table rather than applying the flag
everywhere the error could appear.

Not yet confirmed by a run. Builds 107, 108 and 109 carry WIDE_EP=1 as a
MODEL_ENV_OVERRIDES parameter to test exactly this hypothesis, and they are
currently blocked: the SLURM login node useocpslog-001 is offline because its
sshd now refuses non-interactive commands, so Jenkins cannot launch an agent on
it. If those runs disprove the diagnosis this commit should be reverted rather
than adjusted.
PR 237 and this branch each added TP inside the wideEP pools, under different
names (EP_TP_SIZE, TP_SIZE) and at different layers. Combined as-is they would
divide the DP sizes twice. This keeps one of each:

- One knob, EP_TP_SIZE. TP_SIZE could not stay: scripts/common/cluster.sh,
  which run_xPyD_models.slurm sources first, exports TP_SIZE=GPUS_PER_NODE for
  the colocated launcher. The slurm's TP_SIZE=${TP_SIZE:-1} therefore kept 8
  and forwarded it, so every TP1/DP16 wideEP recipe (DeepSeek, GLM) launched as
  -tp 8 --data-parallel-size 2. Reproduced in DRY_RUN on the previous head.
- DP sizes are derived once, in vllm_disagg.sh. moriio.sh no longer divides
  them again; the router's --moriio-dp-size is PREFILL_DP_SIZE rather than a
  recomputation from xP alone.
- moriio_pod_hosts stays keyed on a pool spanning more than one node, not on
  EP_TP_SIZE. Headless workers carry --kv-transfer-config only when
  EP_TP_SIZE>1, the condition PR 237 validated.
- Kimi-K3-MXFP4's recipe no longer pins the fabric (rail list, GID indexes,
  socket interfaces). Those are cluster facts: cluster.sh detects them and
  connectors/moriio.env supplies the rest. On the slurm path the recipe's
  MORI_IB_GID_INDEX=3 was already being overridden by moriio.env's 1.
- Add the pyt_vllm_disagg_mori_kimi-k3-mxfp4 card so madengine and the CI can
  select the PR 237 workload at all.

Also fixed while here:
- Kimi-K3 was missing from VALID_MODELS, so validate_model_name rejected the
  existing pyt_vllm_disagg_mori_kimi-k3 card before launch.
- The live vllm serve passed the models.yaml flags twice while DRY_RUN passed
  them once, so argv_assert was not testing the real command line.
- parse_to_csv reports tp from EP_TP_SIZE only for wideEP runs.
- Both Kimi Dockerfiles derive MORI_GPU_ARCHS from GFX_COMPILATION_ARCH.
- README: sbatch --export must precede the script; document MODEL_WEIGHTS_NAME.

argv_assert: 84 passed, 0 failed. DRY_RUN argv is identical to develop for
every 1P/1D cell (moriio/rixl x TP/wideEP, both ranks).
A Kimi-K3 multinode recipe is written for one GPU: on MI300X it requantizes the
MoE to int4 (gfx942 has no scaled-MXFP4 MFMA) and turns AITER MLA off (that
kernel is gfx950-only). Nothing stopped one from being scheduled onto MI355X.
The card's skip_gpu_arch says so, but only orchestrators read it: madengine
applies it on local runs only, never on SLURM, and the Jenkins check needs a
hand-typed TARGET_GFX and runs in STANDALONE only. So the same card could be
refused by one path and sent to the wrong GPU by the other.

The launcher now checks for itself, on the nodes it was given, before the
weights probe -- so it is the same under MADENGINE and STANDALONE:

- cluster.sh: cluster_detect_gpu_arch reads every allocated node's arch from the
  KFD topology the driver publishes (no ROCm userspace needed on the host;
  rocminfo as fallback) and refuses a mixed allocation.
  cluster_require_gpu_arch fails when the recipe's GPU_ARCHS excludes it, warns
  and continues when the arch cannot be determined, and GPU_ARCH_CHECK=0 skips
  it for bring-up on a new GPU. Safe under set -euo pipefail.
- vllm_dissag: GPU_ARCHS comes from models.yaml (Kimi-K3, Kimi-K3-MXFP4:
  gfx942). The EP_TP_SIZE lookup becomes a shared _recipe_env helper.
- vllm_multinode: the four MI300X Kimi cards carry GPU_ARCHS=gfx942.
- sglang_disagg: detects and labels only; no card restricts yet.
- The detected arch is forwarded as PERF_GPU_ARCH, so the perf CSV names the GPU
  the run used. sglang_disagg's parse_to_csv wrote 'gfx942' unconditionally.
- check_gpu_arch_declarations.py fails when a card's skip_gpu_arch disagrees
  with its recipe's GPU_ARCHS, so the orchestrator-side and launcher-side
  declarations cannot drift apart. Wired into argv_assert.

argv_assert: 92 passed, 0 failed. The KFD decoder was checked against 90402,
90500, 90010 and 90400, and the probe on a real gfx942 node.
The merge emitted moriio_pod_hosts for any pool spanning more than one node.
Reading the connectors the two images build shows that was wrong:

- The generic (DeepSeek) connector never reads the key; it routes on the
  request's remote_hosts, which the router never sends. Harmless, useless.
- The K3 connector uses it as a fallback and maps a rank to
  pod_hosts[rank // (remote_dp_size / len(pod_hosts))]. At EP_TP_SIZE=1 the
  router advertises remote_dp_size=8 and only targets ranks 0-7, all on each
  pool's master; with two hosts listed, master ranks 4-7 would be sent to the
  peer child node's IP.

The router addresses the whole pool exactly when EP_TP_SIZE>1 (moriio.sh then
passes --moriio-dp-size), which is also when headless ranks need their own
--kv-transfer-config. The pod hosts now follow the same condition, so all three
move together. DRY_RUN argv is again identical to develop for DeepSeek and
Llama at 2P/2D on every rank, as it already was at 1P/1D.

remote_dp_size is the prefill pool's width in both directions, so the decode
side's pod math assumes equal pools: EP_TP_SIZE>1 with xP != yD now fails at
startup instead of misrouting.

Also, RDMA rails per fabric. The connectors default to one CX7 cluster's
mlx5_* list, which names devices that do not exist on AINIC or Thor2 -- NCCL
skips them and runs over TCP without failing. cluster.sh now sets the
archetype's rails there (rdma0..7, bnxt_re0..7), and leaves cx7 untouched so
every connector keeps its current choice, including rixl.sh's ibstat probe.
cluster_report_rdma_rails logs the rails in use and warns about any that is
absent or not ACTIVE on the node.

argv_assert: 93 passed, 0 failed.
…n MoRI

Both Kimi-K3 disagg recipes are MI300X-only: the MoE is requantized to int4
because gfx942 has no scaled-MXFP4 MFMA. This adds the MI355X counterpart,
which runs the MXFP4 weights natively.

- Kimi-K3-MXFP4-MI355X (models.yaml): GPU_ARCHS=gfx950, EP_TP_SIZE=1, no
  --quantization-config, AITER MLA left on, --max-num-batched-tokens 4096.
  TP1/DP16 fits MI355X's 288 GB with ~81 GiB left after weights and the MoRI
  heap; the arithmetic is in the recipe comment.
- Card pyt_vllm_disagg_mori_kimi-k3-mxfp4_mi355x: skip_gpu_arch=gfx942, reads
  the same Kimi-K3-MXFP4 weights through MODEL_WEIGHTS_NAME.
- docker/pyt_vllm_kimi_k3_mi355x: the MI300X Kimi image with the AITER donor
  named for what it is (vllm/vllm-openai-rocm:kimi-k3, pinned by digest; the
  mi325x donor is that image plus three .py files), GFX_COMPILATION_ARCH=gfx950,
  and without the flydsl 0.2.4 re-pin that only the gfx942 int4 path needs.
  Not named vllm_disagg_inference.*: madengine builds every file matching the
  card's dockerfile prefix, and the generic cards already glob that one.
- MORI_GPU_ARCHS follows the detected GPU. connectors/moriio.env pins gfx942,
  which on MI355X JIT-builds the EP kernels for the wrong GPU - for every model,
  not just this one. An explicit MORI_GPU_ARCHS still wins.

BRING-UP, NOT VALIDATED: nothing shows MoRIIO disagg with Kimi-K3 has run on
gfx950, and the vLLM ref is the fork's gfx942 branch. The GLM MI355X work on the
same stack needed EP16 startup-deadlock gates and a MoRI combine fix that this
ref lacks. The launcher only runs it on gfx950; GPU_ARCH_CHECK=0 bypasses that.

argv_assert: 104 passed, 0 failed.
Three runs on OCI failed in ways the CI could not see or end:

- SLURM job 442891 (Kimi-K3 2P/2D): the prefill master died at 17:16
  with "Engine core initialization failed". The wait only looked for
  "Application startup complete.", so it noticed at its 4000s timeout
  (17:55), printed just "Timeout (4000s)", and exited alone. The other
  three nodes stayed in socket_barrier, which has no timeout, until the
  job was cancelled by hand hours later. The OOM behind it had to be
  fetched from the cluster.
- SLURM job 442923 (llama-70B rixl/TP): both servers failed engine init.
  The TP wait is a bare port barrier with no timeout and no log check,
  so it waited indefinitely.
- The same job's container barrier "passed" although neither node could
  open port 5000: bind() failed in the accept thread, and every node's
  check then connected to whatever else holds 5000 on those hosts.

Changes:

- _wait_log_signal_or_fail fails as soon as a server log shows vLLM's
  start-up failure lines, and on any failure prints the last 80 lines of
  that log to stdout, which is what reaches the CI.
- _job_fail writes /run_logs/<job>/ABORTED (the job's shared log dir),
  and every barrier now passes --abort-file, so the other nodes stop as
  soon as one gives up.
- socket_barrier.py: --timeout and --abort-file, both off by default so
  existing callers keep their behaviour; bind() failure is fatal instead
  of a dead thread.
- rixl/TP waits on each node's server log (bounded by
  LOG_WAIT_TIMEOUT_SECONDS, as moriio already is), then keeps the port
  check. rixl/wideEP uses the same knob instead of a hardcoded 4000.
- rixl/TP's barrier default moves from 5000, which its own comment called
  collision-prone, to 15000: the port the wideEP branch of the same
  connector uses and the launcher's cleanup already frees.
- The TP path no longer prints wideEP DP sizes it never uses.

Tested locally: socket_barrier normal pass, held port, abort file,
timeout, and unchanged behaviour with no flags; the real wait helpers
against a log ending in the 442891 OOM fail immediately, print the tail
and write the marker that a peer barrier then exits on. argv_assert: 104
passed, 0 failed. verify_srun_quotes and verify_path_equivalence clean.
SLURM job 443011 (pyt_sglang_disagg_mori_io_agentic_qwen3-32b): the
decode server on node 041 hit "Scheduler hit an exception" at 17:56
("The memory capacity is unbalanced. Some GPUs may be occupied by other
processes"). The router wait on NODE0 only watched for the ready line,
timed out 4000s later and exited alone; the other nodes stayed in
socket_barrier waiting for a proxy that would never open, and the job ran
to its 6-hour TIMEOUT.

Same fix as the vLLM launcher (vllm_dissag 04332cb), applied to the
launcher run_xPyD_models.slurm uses (sglang_disagg_mori_io_ep.sh):

- The three server waits fail as soon as a log shows SGLang's fatal
  lines, print the last 80 lines of that log, and fail through _job_fail.
- _job_fail writes /run_logs/<job>/ABORTED; the container barrier and both
  proxy waits pass --abort-file and fail when it appears.
- socket_barrier.py is the vllm_dissag copy (the two were identical):
  --timeout / --abort-file, and a failed bind() is fatal.

sglang_disagg_server.sh is not touched: run_xPyD_models.slurm always runs
the mori_io launcher.

Tested locally with the real helper and prefill wait loop against a log
shaped like 443011's: fails immediately, prints the tail, writes the
marker. verify_srun_quotes clean.
SLURM job 445591 (llama-3.3-70B, rixl/TP8): the prefill server's first
TP all-reduce failed with

    RuntimeError: NCCL error: unhandled cuda error
    (run with NCCL_DEBUG=INFO for details)

and there was no way to do what it says. NCCL_DEBUG set for the run
reaches the node but not the container: the docker run passes an explicit
-e list, and it has no NCCL_DEBUG. sglang_disagg's launcher gained the
same three lines in d4ccac7.

Forwarded only when set, so a run that does not set them is unchanged.
argv_assert: 104 passed, 0 failed; verify_srun_quotes clean.
Builds 142, 143 and 144 (llama-3.3-70B, DeepSeek-V3 mori and deepep) all
failed to build vllm_disagg_inference.ubuntu.amd:

    rocshmem/src/atomic.hpp:78:10: error: address argument to atomic
    operation must be a pointer to integer or pointer ('float *' invalid)

The Dockerfile pins every source (MORI_REF, VLLM_REF, ROUTER_REF, the UCX
and RIXL branches) except rocSHMEM, which it built from rocm-systems
`develop`. rocm-systems 16dc5673 (2026-09-25, "replace hip atomic builtins
with scoped counterparts") moved atomic.hpp from __hip_atomic_* to
__scoped_atomic_*, which the compiler in this image's pinned base
(rocm/vllm-dev:ci_base-0fcd9b99, ROCm 7.2) rejects for float and double.
The GLM-5.1 image built the same `develop` fine the same afternoon; its
base is newer.

ROCSHMEM_REF pins the checkout to 9c43b232, 16dc5673's parent: the rocSHMEM
these images built against until three days ago, nothing else changed.
The Kimi-K3 disagg Dockerfile is on the same ROCm 7.2 base and the same
unpinned checkout, so it gets the same pin. The GLM-5.1 Dockerfile builds
today and is left as it is.
SLURM job 445932 (llama-3.3-70B rixl/TP8) died in start-up and the
launcher printed the last 80 lines of the prefill log -- all of them the
API server's traceback, ending "See root cause above". The worker's
exception, and RCCL's NCCL WARN lines with NCCL_DEBUG=INFO on, were
earlier in the log, so the CI log had the symptom and not the cause.

Both launchers now print the log's first error lines (Error, Exception,
NCCL WARN, out of memory, hipError, segfaults; traceback frames left out,
at most 40) before the 80-line tail.

Tested on a log shaped like 445932's: the NCCL WARN and worker
RuntimeError on lines 2-3 are printed ahead of 120 lines of traceback.
argv_assert: 104 passed, 0 failed.
SLURM job 445932 (llama-3.3-70B, 2 nodes): NODE0's prefill failed and
NODE1's barrier saw the abort marker and exited -- but NODE1's decode
server had started fine and kept running. It held the container's output
pipe, so the container, and the SLURM job, stayed up; the job was still
RUNNING six minutes later and would have held both nodes to the wall
clock. 04332cb only made the waiting script exit. Build 140 ended within
seconds only because both of its servers had died by themselves.

_job_fail now kills every process the launcher started, children first,
before it exits. Same in the sglang launcher.

Tested with a stand-in server (a process tree behind `| tee`, as the
container runs it): with the change the launcher's pipeline ends in 1s
and no server process is left; without it the pipeline hangs until
killed. argv_assert: 104 passed, 0 failed.
SLURM job 445932 (llama-3.3-70B TP8): three of the eight prefill workers
on useocpm2m-097-071 refused to start --

    Free memory on device cuda:4 (156.95/191.98 GiB) on startup is less
    than desired GPU memory utilization (0.92, 176.63 GiB)

-- although madengine's health check had measured that node at 2 GB used
four minutes earlier, and the decode node started fine. vLLM says how
much memory was missing, not who held it, and nothing else in the CI log
could.

On a server start-up failure both launchers now also print each GPU's
used/total VRAM and the processes holding GPU memory, from the amdgpu and
KFD sysfs (readable inside the container, host PIDs), plus rocm-smi
--showpids when present.

Ran the snapshot on an 8x MI300X host: per-card usage and the KFD process
list print as expected. argv_assert: 104 passed, 0 failed.
run_xPyD_models.slurm documents GPU_MEMORY_UTILIZATION's precedence --
submit-time, then models.yaml, then the launcher's topology-aware fallback
(0.8, or 0.70 at EP>=32) -- and vllm_disagg.sh resolves and exports it.
The moriio connector passes it to vllm serve. The rixl connector did not:
rixl/TP passed no --gpu-memory-utilization at all, and rixl/deepep
hardcoded 0.8.

So rixl/TP ran at vLLM's built-in default, which is 0.92 in this image
(it is absent from vLLM's "non-default args"; the launcher had logged
"GPU_MEMORY_UTILIZATION launcher fallback: 0.8"). On llama-3.3-70B:

- SLURM job 446044: 9 GiB weights + 164.62 GiB KV cache per GPU, then the
  first RCCL all-reduce failed with "NCCL error: unhandled cuda error" on
  all eight ranks, at 178-179 of 191 GiB used per GPU.
- SLURM job 445932: start-up refused outright, "Free memory on device ...
  is less than desired GPU memory utilization (0.92, 176.63 GiB)", on the
  GPUs of a node that was not almost empty.

Both rixl paths now pass the resolved value, before the model's own flags
so a models.yaml tp: flag still wins. deepep's default is unchanged (0.8).

argv_assert: 108 passed, 0 failed. The four new assertions (TP fallback,
deepep fallback, a submit-time value winning, the flag appearing once)
fail three of four against the previous rixl.sh; deepep's passes there
because its hardcoded 0.8 equals the default.
Build 145 (pyt_sglang_disagg_mori_io_agentic_qwen3-32b) ran its replay to
completion and measured 33,109 tok/s, TTFT, TPOT, E2E latency and a 24.7%
prefix-cache hit rate, then reported "0 perf files, 0 successful, 0
failed": the replay (common/agentic_lib.sh) writes an aggregate JSON and,
by design, no perf.csv, and nothing after it converted one into the other.
The sweep does that step itself (benchmark_xPyD.sh -> parse_to_csv.py
--perf-csv /run_logs/$SLURM_JOB_ID/perf.csv).

The agentic shims in both families now run the shared script instead of
exec'ing it, then hand the job's agentic_<jobid>_*.json to their
parse_to_csv.py --agentic-json, which writes /run_logs/$SLURM_JOB_ID/
perf.csv in the same full schema and metadata as the sweep. Per workload:
total and output tok/s, TTFT/TPOT/E2E-latency p50 in ms, and the GPU
prefix-cache hit rate, all as the JSON states them. Status follows the
replay's own validator: FAILURE when nothing succeeded, when the error
rate exceeds AGENTIC_MAX_ERROR_RATE (default 0.10) or when the run wrote
RUN_INVALID.json. The shim's exit status is the replay's; agentic_lib.sh
is not touched.

Tested with 445799's aggregate JSON: six rows (33109.31 tok/s total,
11585.05 ms TTFT p50, 24.65% cache hit), SUCCESS; a 20% error rate or a
RUN_INVALID.json gives FAILURE; the shim keeps the replay's exit code and
warns when there is no JSON. The full-schema field list moved to a
module constant, unchanged. argv_assert: 108 passed, 0 failed.
SLURM job 446532 (llama-3.3-70B TP8): the prefill workers' first
all-reduce failed at 01:14 ("[FATAL ERROR]: HIP failure: 'out of
memory'", then "RuntimeError: NCCL error"), and two things went wrong
after that:

- The engine hung instead of exiting, so neither "Engine core
  initialization failed" nor "EngineCore failed to start" was ever
  logged. The wait only recognised those, and ran its full 4000s.
  RCCL's HIP failure and vLLM's "RuntimeError: NCCL error" are now fatal
  start-up lines too (vLLM launcher).
- When both nodes did give up, the job still ran on: _job_fail sent
  SIGTERM, and workers wedged in the failed HIP call ignore it. It now
  collects the whole process tree, sends SIGTERM, waits up to 15s and
  SIGKILLs what is left (both launchers).

Tested: a launcher whose server tree ignores SIGTERM now ends in 16s
with nothing left running; the fatal pattern matches both 446532 lines
and not an ordinary INFO line. argv_assert: 108 passed, 0 failed.
pyt_vllm_disagg_nixl_llama-3.3-70b-fp8 failed its first TP all-reduce on
every run in its own image (SLURM jobs 446044, 446332, 446532) with "NCCL
error: unhandled cuda error", at GPU_MEMORY_UTILIZATION 0.92 and 0.8
alike. With NCCL_DEBUG=INFO,ALLOC (446532) RCCL named it:

    [FATAL ERROR]: HIP failure: 'out of memory'
    alloc.h:386 NCCL WARN Failed to CUDA malloc 20971520 bytes

and its allocation log showed where the GPU went: msccl_setup.cc:550
allocated a 20 MiB scratch buffer 1721 times during vLLM's compile and
warmup and kept them all -- RCCL alone reached 38.31 GiB on GPU 6, the
whole 20% vLLM leaves free at 0.8.

This recipe is the only one with --disable-custom-all-reduce (d538f56,
"avoids a hipIpcGetMemHandle HIP-IPC crash"), which routes every TP
all-reduce through RCCL, and on MI300X RCCL uses MSCCL for them. The
other TP recipes keep vLLM's custom all-reduce and never take this path
(vllm_multinode's Kimi TP8 passes). RCCL_MSCCL_ENABLE=0 keeps the July
workaround and has RCCL use its standard algorithms. It is exported by
the recipe's env:, inside the container, before vllm serve.

argv_assert: 111 passed, 0 failed -- the recipe exports it, it is scoped
to this model, and a submit-time value still wins.
pyt_vllm_disagg_deepep_deepseek-v3 (SLURM job 445925) died in KV-cache
init with "Worker proc VllmWorker-0 died unexpectedly"; the decode log
above it has

    Memory access fault by GPU node-N ... Reason: Unknown.

on all eight GPUs, right after the workers loaded AITER's MLA kernel
(mla_a8w8_qh128...).

The DeepSeek recipes set KV_BLOCK_SIZE=16, KV_CACHE_DTYPE=fp8 and
KV_CACHE_MEMORY_BYTES, because -- in the moriio connector's words -- "the
block=1 + AITER-MLA fp8 decode kernel GPU-faults", and KV_CACHE_MEMORY_BYTES
skips the boot profiling forward. moriio passes them (R2, mori, passes).
The rixl/deepep path hardcoded --block-size 1 and --kv-cache-dtype fp8 and
never passed KV_CACHE_MEMORY_BYTES: exactly the faulting combination, for
every DeepSeek deepep card whatever its recipe said.

It now takes them from the environment the recipe exports, with the old
hardcoded values as defaults, so a recipe that sets none of them is
unchanged. Same shape of lapse as 4a28f2c (GPU_MEMORY_UTILIZATION).

argv_assert: 116 passed, 0 failed. The new checks (block 16, 20e9 cache
bytes, dtype, flag once, moriio reference) fail two of the three
recipe-knob assertions against the previous rixl.sh.
SLURM job 446532 was cancelled (build 158 aborted) and its container
kept running on useocpm2m-097-014, holding 1535 GB across all eight GPUs.
The next job's health check correctly turned the node away, but nothing
could clean it: the pipeline's release srun got "Requested nodes are
busy", and the launcher's own cleanup is the line after the main srun,
which a cancelled batch script never reaches.

The container belongs to the docker daemon, not to the task, and its PID
1 is a plain bash that ignores SIGTERM -- so scancel's SIGTERM to the task
never reached anything that would stop it.

Each node's task now traps TERM/INT and runs docker stop -t 10 and
docker rm -f on its own container, then exits 143. docker run runs in the
background under `wait`, so the trap fires as soon as the signal lands
instead of after the container exits. Normal completion still returns
the container's exit status. Both launchers (vllm_dissag, sglang_disagg);
the trap text has no single quotes, as the enclosing srun body requires.

Tested with a stand-in container that ignores SIGTERM: on TERM the task
stops and removes it and exits 143 within a second, nothing left running;
on normal completion the exit code passes through. verify_srun_quotes
clean for both; argv_assert: 116 passed, 0 failed.
SLURM job 446997's decode workers died on "Memory access fault by GPU",
which contains neither Error nor Exception, so the CI log's first-error
lines showed only the knock-on "RuntimeError: cancelled" and the fault had
to be read from the archived node log. The first-error pattern now also
matches GPU memory-access faults and "died unexpectedly", in both
launchers. Checked against 446997's decode log.
SLURM jobs 447074 and 447442 (GLM-5.1): the first-error lines the CI log
got were forty copies of vLLM's "Failed to import Triton kernels ...
triton_kernels.matmul_ogs", a warning healthy runs print too, and the
engine and worker failures after them were cut off by the 40-line cap.

The first-error list now drops that warning and prints each distinct
message once, ignoring pid and timestamp; lines from different ranks stay
separate. Both launchers.

Checked on 447442's decode log: the EngineCore failures and the workers'
BrokenPipeErrors now fill 12 lines instead of being hidden.
argv_assert: 116 passed, 0 failed.
What has to be known before a job is submitted - the partition, GPUs per
node, whether to take nodes exclusively - had no home in MAD. The CI
pipeline carried it as SLURM_* parameters for the madengine path, while the
standalone path took the partition from SBATCH_PARTITION and otherwise ran
under each launcher's own #SBATCH lines, so one run could get two different
allocations depending on which path submitted it.

scripts/common/clusters/<name>.json holds it now, one file per cluster, in
madengine's --additional-context format. m2m.json is the OCI MI300X cluster
(amd-rccl, 8 GPUs per node, exclusive). The pipeline layers it under the
run's derived shape and ADDITIONAL_CONTEXT, and both paths submit the
result. cluster.sh keeps the facts the job needs once it is running, and now
says where the allocation defaults went.

.gitignore ignores every *.json; the profiles directory is excepted so the
next cluster's file is not silently left out of a commit.
scripts/common/README.md is the guide: what a run needs and where each piece
lives, the madengine build and run commands with a cluster profile as
--additional-context-file, the equivalent sbatch submission, what the
launchers print when a run fails, and the checks that need no GPUs. The
vllm_dissag and sglang_disagg READMEs link to it from their quick starts.

clusters/README.md and m2m.json now say how to use a profile from either
entry point, with the profile-to-sbatch option mapping.

Comments in the launchers and checkers cited internal CI build numbers, a CI
system and its mode names, which mean nothing to a reader of this
repository. Each now describes the failure itself.
Cemberk and others added 22 commits November 24, 2026 15:33
ROCm#242's review fixes: develop's USE_CX7_NICS on eight SGLang cards, no
one site's SLURM names as defaults, no hardcoded #SBATCH log path,
DeepEP pinned, no NCCL debug in the Kimi-K3 recipe, COLOCATED_EXTRA_ARGS
split with shlex, and a CI job for the offline suites. Where both sides
had merged develop, this branch's resolution is kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_moriio_build_kv_transfer_config exits 1 on a non-integer VLLM_MORIIO_*
value, but it runs inside $(...), so only that subshell ended and the
server started with --kv-transfer-config "" (no KV connector). Every
kv-config and kv_offload_wrap call site in moriio.sh and rixl.sh now ends
the launcher when its command fails. argv_assert covers
VLLM_MORIIO_NUM_WORKERS=four.

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

Object names come from the card, and replace_ours deleted any existing
object of that name labelled app=mad, so two people submitting one card
in one namespace lost the first run's Job and results volume. Submit now
refuses while a Job of that name has not finished, before deleting
anything; a finished Job is a leftover and is replaced as before.

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

name=^container_ matched any container named container_*, another
user's included, and the SGLang launcher uses the same prefix. Every
container the vLLM and SGLang disagg launchers start now carries
mad.launcher=<launcher> and mad.user=$USER labels, and start-up cleanup
stops only containers with both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
madengine joins a component's steps in one RUN, so the cwd carries over:
Mooncake's build_wheel.sh, wheel install and tebench copy ran from
build/ and failed. Both builds now end with cd .., as the Dockerfile
they come from does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With only rocm: 10.1 the base is ubuntu:24.04 with no python or pip, so
the generated Dockerfile's pip and python3 steps failed. python: 3.12
makes madengine create its venv (madengine#248 now refuses a bare-OS
spec without python).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A card with image_spec skipped the Dockerfile checks and nothing replaced
them. The validator now resolves ${image_spec} (the folder's
image_spec.yaml) and ${images.<name>} (compat/images/<name>.yaml)
through extends chains and per-GPU variants, and requires every selected
build (components: {name: key}) to exist in compat/rocm.yaml. PyYAML
only; no madengine needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The update-MAD guard only checked that the checkout has dispatch.sh, so
a slurm_multi card that calls srun itself (large-ep-benchmark) passed it
and failed on pod 0 with srun: command not found while the other pods
exited 0. The card's script must now source common/cluster.sh or
dispatch.sh, or call dispatch_run/dispatch_gather; otherwise every pod
is refused with exit 2. Identical to madengine's k8s_shim copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ROCm#242/ROCm#293/ROCm#299 review fixes. The container labels for start-up cleanup
are ported to vllm_dissag/node.sh and sglang_disagg/node.sh, where the
per-node body lives here; the k8s node entry and the launchers keep this
branch's per-pod versions; the per-model Kimi-K3 Dockerfile stays removed
(compat/images/vllm-kimi-k3.yaml pins DeepEP at the same commit). Cases
re-recorded: the labels, and USE_CX7_NICS=0 on the SGLang cards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aders say MAD patch

verify.py imported the pins module that the move to compat/ removed, so
nothing checked that upstream + carried patches == the validated fork
trees. It now reads every source build in compat/rocm.yaml that carries
patches and a fork_commit, checks each patch's recorded sha256, and
applies them to the upstream commit (all five builds: upstream + patches
== fork). --offline does the checks that need no network, and the
offline suite runs it. The patch headers no longer call themselves
pin-set patches; their recorded sha256 values follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vllm-mori121 and vllm-glm51 give a base for gfx942 only, so on an MI355X
host madengine's detected arch made the build fail. These cards now say
so (skip_gpu_arch: gfx950), as the Kimi-K3 MI300X cards already do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The harness sets USER=t, but the disagg launchers take USER_NAME from
whoami, so the cases recorded USER_NAME=root and every case differed for
a non-root user. stubs/whoami answers the harness user; cases
re-recorded (USER_NAME=t).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… of waiting until wall time

Under spur-array and k8s-indexed, rank 0 waited for every rank's run
status with no limit, and only an abort file ended the wait. A task
killed by SIGKILL, OOM, preemption, eviction or a lost node publishes
neither. Each rank now keeps a heartbeat counter while its step runs
(detached, so a node program's bare wait does not wait for it; it stops
when its task's shell is gone); rank 0 ends the run with the rank's name
once a missing rank's counter has not changed for
MAD_RENDEZVOUS_HEARTBEAT_TIMEOUT (default 300 s), timed on its own clock
so clock skew between nodes does not matter. dispatch_assert covers a
killed rank and a rank that runs longer than the timeout.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… differed there)

node_rdma_mounts mounts the host's libibverbs/libmlx5/... when present,
so on a machine with rdma-core installed (the GitHub runner) 13 cases
differed. Where it looks is now a parameter (CLUSTER_RDMA_LIBDIR,
CLUSTER_RDMA_CONFDIR; default the real paths), as CLUSTER_SYSFS_IB is,
and the harness points both at an empty directory. Cases unchanged;
with a fake library tree the mount appears, so the parameter is honoured.

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

Cemberk commented Nov 30, 2026

Copy link
Copy Markdown
Author

Thanks for going through it at this size. Changes:

On splitting: I'd prefer to keep it as one PR. The image-spec migration and the dispatcher/topology/config-layer refactor are tested together: the snapshot harness runs every card on its image-spec card definition under every dispatch, so splitting would mean reviewing and validating an intermediate state twice. Once #299 and #295 land, this diff shrinks to its own changes. I'm happy to walk through any area of it with you.

run_wideep.sh:243, AGENTS.md: Fixed in f1c58a4. The message names the DeepSeek-V4 Dockerfile that exists, and AGENTS.md documents image_spec (the forms, extends, what the validator checks).

snapshot.py:220 (USER_NAME) and CI: Fixed in 816ddfe: stubs/whoami answers the harness user, and the cases are re-recorded (USER_NAME=t), so a non-root run matches. CI: #242's launcher-offline job runs run_offline.sh, which here also runs docker/patches/verify.py --offline and the snapshot harness in each mode (plain, --spooled, --spec-file, spur-array, k8s-indexed) (24b67ab). The whole thing takes about 16 minutes.

Cemberk and others added 3 commits December 1, 2026 13:43
…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>
Brings develop's ROCm#313. Its peer hosts in kv_connector_extra_config apply
where the multi-node layout does (DeepSeek-V4, or MORIIO_MULTINODE=1),
as develop's earlier layout did here; other cards keep master-node
ranks (their images predate vLLM #65098, which the keys need). The
connector config keeps the opt-in transfer tuning and read_mode;
masters gain --enable-scale-out and keep the kv-config exit. Develop's
2P2D peer-host tests opt in with MORIIO_MULTINODE=1, and one more holds
DeepSeek-V3's default layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings develop's ROCm#313 (through ROCm#242 and ROCm#299). The per-node body lives
in node.sh here, so ROCm#313's MORI_PROXY_PING_PORT forward is added there;
the connector config keeps this branch's router address and gains the
peer hosts; the forward checks read node.sh too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings December 1, 2026 15:15

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

Startup cleanup can stop other active SGLang jobs, and a missing environment variable causes colocated NIAH runs to abort without publishing their required results CSV.

6 open issues

Review effort: Balanced

Comment on lines +9 to +12
# Leftover containers of this launcher and this user only (any earlier job), by the labels
# every container it starts carries; a container of another user or another launcher is
# not ours to stop, whatever its name.
docker ps -q --filter "label=mad.launcher=sglang_disagg" --filter "label=mad.user=${USER:-}" | xargs --no-run-if-empty docker stop;
$DOCKER_IMAGE_NAME -c "
set -o pipefail
mkdir -p /run_logs/${SLURM_JOB_ID}
SHARED_DIR=$MAD_SCRIPTS_MOUNT/vllm_dissag \
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.

5 participants