Repository navigation
Sglang render - #312
Open
vdar25 wants to merge 228 commits into
Open
Sglang render#312vdar25 wants to merge 228 commits into
vdar25 wants to merge 228 commits into
Conversation
… 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>
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>
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>
mori_ep_env.sh:72-73 sets
export NCCL_DEBUG="${NCCL_DEBUG:-INFO}"
export NCCL_DEBUG_SUBSYS="${NCCL_DEBUG_SUBSYS:-INIT,NET,GRAPH}"
The ${VAR:-default} idiom advertises that a caller can override these. No
caller can. run_xPyD_models.slurm hands the container a fixed 22-name -e
list, and NCCL_DEBUG is not on it, so whatever the submitter exports is
dropped at the container boundary and the default always wins. The override
contract in mori_ep_env.sh is dead code as far as anything outside the
container is concerned.
Two things follow from that, and neither is hypothetical -- both come from
job 246618, a Qwen3-32B 1P1D run that completed successfully:
1. Log volume. That run archived 19 MB of per-rank logs (decode_NODE1.log
9.6M, prefill_NODE0.log 4.4M, proxy_NODE0.log 2.7M), overwhelmingly NCCL
channel-tuning triples -- pre-adjustment / minNChannels / post-adjustment
-- emitted by all 8 ranks for every collective size.
2. Corrupted lines. Those 8 ranks share one stdout with no line atomicity,
so at INFO volume the writes interleave mid-token:
useocp[2026-09-07 16:09:52 TP0] Prefill batch, ...
justment based on threadThreshold
80 nc:112
Any grep-based marker extraction over these logs is unreliable, which
matters because CI reads them to decide pass/fail.
Narrowing NCCL_DEBUG_SUBSYS is not the fix. This run already had the
narrowed value INIT,NET,GRAPH and still produced all of the above; the
channel-tuning lines are GRAPH. Only NCCL_DEBUG=WARN suppresses them.
Forward the three NCCL debug knobs conditionally, using the same
${VAR:+-e VAR=$VAR} idiom vllm_dissag/run_xPyD_models.slurm already uses for
AITER_JIT_DIR and VLLM_ROCM_USE_AITER_MLA. When the variable is unset the
expansion is empty and the docker run is byte-identical to before, so the
default INFO behaviour is unchanged for anyone who does not opt out. Add the
same treatment for any further knob by adding one line.
The submitter's environment reaches the compute node because sbatch defaults
to --export=ALL and srun propagates it, so an `export NCCL_DEBUG=WARN` before
sbatch is now enough.
Deliberately not changing the INFO default here. INFO is a poor default for a
benchmark harness that archives its logs, but that is a call for the people
who use this interactively; this commit only makes the documented override
work.
models.json forced USE_CX7_NICS=0 on every sglang_disagg entry, which sends prefill->decode KV transfer over mlx5_1, the 100G management NIC, instead of the 8x 400G CX7 rail NICs that mori_ep_env.sh defaults to. That is the critical path of a disaggregated run, so the measured throughput does not represent the hardware. Two runs on different node pairs (AMD-internal 247073 and 247580) both show --disaggregation-ib-device mlx5_1. Flipped to 1 on the four models this evidence covers: llama-3.1-8b, qwen3-32b, llama-3.3-70b-fp8 and llama-3.1-405b-fp8. The remaining twelve entries keep 0 until someone benchmarks them. The rail NICs require same-rail nodes, and the file header has been citing select_same_rail_nodes() as the thing that enforces that -- a function which was never written. Written now: it maps each allocated node to its Level=0 switch via scontrol show topology and aborts before any container starts if they do not share one. A cross-rail pair hangs in NCCL ibv_modify_qp rather than failing, and base_flags sets --watchdog-timeout 1000000, so without this the job burns its whole allocation instead of failing in seconds. The check is skipped entirely when USE_CX7_NICS != 1, degrades to a warning when no topology is configured, and can be bypassed with REQUIRE_SAME_RAIL=0 -- topology.conf may describe the management network rather than the CX7 fabric, in which case the check is conservative rather than correct. --switches=2 is deliberately unchanged: both observed allocations were already single-leaf, so constraining placement is the one change here that could move the numbers.
decode.tp asked for --cuda-graph-bs $(seq 1 512), so 512 CUDA graphs were captured at startup while benchmark_xPyD.sh only ever sweeps CON="8 16 32 64 128 256 512". Startup was 51-52% of wall clock across two runs (426s of 810s, then 401s of 784s). Set the list to those seven values on the three models that used the full range. Llama-3.1-405B keeps $(seq 1 8): it is already small and raising it has memory implications this evidence does not cover.
py-spy, flask and pyyaml were installed from PyPI on every node at the start of every run, so the pinned image was mutated before each benchmark: two runs of the same tag are not the same environment, resolution can pick a different version than the one requested, and a PyPI outage fails the run. Observed in AMD-internal 247073/247580, where pip resolved click 8.5.0 and installed 8.4.1, and the force-reinstall surfaced an unrelated xgrammar / apache-tvm-ffi conflict in the log on both nodes. Baked into docker/sglang_disagg_inference.ubuntu.amd.Dockerfile. The launcher scripts now install only what is genuinely missing, so a MAD-built image does no work there while an image supplied through DOCKER_IMAGE_NAME still self-heals. --ignore-installed --force-reinstall is dropped.
Brings the branch onto current develop (652bad5) so the sglang_disagg fixes and the kimi-k3 work can ship in one PR. Eight files conflicted: models.json develop's 61b5301 migrated the registry from the root file to per-directory models.json. Took develop's empty root and moved this branch's four entries to where they now belong: pyt_vllm_disagg_mori_kimi-k3 into scripts/vllm_dissag/models.json, and the three pyt_vllm_kimi-k3_mi300x_* entries into a new scripts/vllm_multinode/models.json. The 26 jax_maxtext and primus_train entries in the old root file were NOT migrated: develop generates those from scripts/{jax-maxtext,primus_train}/get_models_json.py. scripts/sglang_disagg/run_xPyD_models.slurm Union of develop's 25 conditional -e forwards and this branch's three NCCL_DEBUG forwards (28 total). The CX7 flip that was applied to the old root models.json is re-applied to scripts/sglang_disagg/models.json here. scripts/vllm_dissag/models.yaml Append/append. Kept both recipe blocks (develop's GLM-5.1-FP8, this branch's Kimi-K3). scripts/vllm_dissag/connectors/moriio.sh Took develop's argument order (model_args last) from a33b622/b33923b, so recipe flags win over connector defaults. Compatible with the Kimi-K3 recipe. scripts/vllm_dissag/benchmark_niah.py and .sh The two sides added orthogonal features: develop added multi-seed sweeps with mean/min/max plus a warmup pass, this branch added finish_reason so a truncated answer is distinguishable from a retrieval miss. Combined both: _request now returns (message, finish, error) and the cross-seed summary flags TRUNCATED. Kept develop's NIAH_MAXTOK=2048 default -- the truncation detector makes the smaller default safe, and NIAH_MAXTOK is -e forwarded for models that need more. scripts/vllm_dissag/parse_to_csv.py The auto-merge left two parse_niah_log and two save_niah_perf_csv definitions; the later pair (this branch's found= parser) silently shadowed develop's. Since the merged summary emits develop's mean=/min=/max= format, dropped this branch's pair and kept develop's parser. Kept the --narrow flag. scripts/vllm_dissag/run_xPyD_models.slurm Six hunks, all unions: MORI_EP_VALID_MODELS and WIDE_EP_ONLY_MODELS gain both GLM-5.1-FP8 and Kimi-K3; the BENCHMARK_SCRIPT case gains both agentic and niah; the -e list gains develop's NIAH_SEEDS/NIAH_WARMUP/SHAPE_WARMUP/ USE_INDUCTOR_GRAPH_PARTITION alongside this branch's NIAH_* forwards. Verified: no conflict markers; bash -n on all eight touched shell/slurm files; py_compile on both Python files; json.load on all 21 registries and yaml.safe_load on both models.yaml; benchmark_niah.py run against a stub server on both the scoring and truncation paths and its log fed through parse_to_csv.py --niah to a valid perf.csv; and the sglang rail guard replayed against the real job-247580 topology across all six cases.
…d step Loading Qwen3-32B off /shared_inference measured 683s in job 249926 -- 67% of a 1015s bring-up, ~92 MB/s per node with both nodes pulling the same 63 GB through the same NFS mount. scripts/common/preflight_weights.sh:2-5 records what the other path is: /mnt/m2m_nobackup/models_blog is per-node local NVMe, non-uniform, while /shared_inference is the uniform NFS share. An earlier commit on this branch reordered the sglang launcher to probe NFS first, to avoid a wasted srun round trip and the "<jobid>.N bash FAILED 1:0" row a missed probe leaves in sacct. That trade is backwards: it spends 683s of NFS reads to save a few seconds of probing, and it means a node that does have the weights locally can never use them. Restored local-NVMe-first. The sacct noise that motivated the reorder is fixed properly instead. check_model_path now runs a probe that always exits 0 and decides from its output, so a miss in a fallback chain is not recorded as a step failure. Two latent bugs fall out of the same rewrite -- the old version read srun's exit code alone, so an srun that exited 0 while reporting from fewer nodes than were allocated, or one that exited 0 with no output at all, both returned "available on ALL nodes" and sent the job on to load weights from a path some rank cannot see. The new version requires one Found line per allocated node. Applied to both scripts/sglang_disagg and scripts/vllm_dissag; only sglang needed the ordering change, vllm_dissag was already local-NVMe-first. Verified by extracting the function and replaying it against a stubbed srun across five cases (all-found, one-node-miss, srun-fails, short output, silent exit-0). New: 0,1,1,1,1. Old, same stub: 0,-,1,0,0 -- it accepts short and silent. Note this does not by itself make Qwen3-32B load fast: jobs 247073, 247580 and 249926 all fell through to NFS, so that model is not currently staged on the local NVMe of the nodes CI draws from. This makes the fast path reachable and cheap to probe; the staging itself is a cluster-side action.
The merge moved four entries out of the root models.json into the per-directory registries develop's 61b5301 introduced, but kept their root-relative paths. All twenty pre-existing per-directory registries resolve dockerfile as ../../docker/X and scripts as a bare filename, so the migrated entries pointed at scripts/vllm_multinode/scripts/vllm_multinode/run_multinode.slurm and would not have resolved at all. All 117 entries across the 21 registries now resolve from their own directory.
…t Kimi-K3 offline The merge brought develop's multi-seed NIAH support into benchmark_niah.sh, which now reads NIAH_SEEDS and NIAH_WARMUP alongside NIAH_WORDS/MAXTOK/TIMEOUT. scripts/vllm_dissag forwards all of them; scripts/vllm_multinode forwarded only three, so a colocated niah run silently fell back to the defaults for seeds and warmup no matter what was set at submit time. Also forwards SHAPE_WARMUP, which benchmark_xPyD.sh reads and which is reachable from the colocated path via BENCHMARK_SCRIPT=sweep. Both launchers now forward every NIAH_* the benchmark reads. Kimi-K3 is the model this branch adds and the only cell argv_assert.sh did not cover -- it tested moriio+TP on Llama and moriio+wideEP on DeepSeek-V3. Added a Kimi-K3 section over both roles: the int4_per_group_32 requant (without which gfx942 cannot codegen the a16w4 SiTUv2 kernel and vLLM dies with "LLVM ERROR: Do not know how to expand this operator's operand!" in determine_available_memory, per benchmark/kimi_k3/mi300x/README.md:160), exactly one --compilation-config per role, the kimi_k3 reasoning parser, the prefill/decode split across cudagraph_mode (NONE vs PIECEWISE), all2all backend (mori_high_throughput vs mori_low_latency) and kv_role, and the two model-gate arrays. The gate assertions are scoped to the arrays themselves rather than grepped over the whole file: "Kimi-K3" appears in both MORI_EP_VALID_MODELS and WIDE_EP_ONLY_MODELS, so a file-wide grep passed even with the model removed from one of them. MORI_EP_VALID_MODELS is line-continued, so it is extracted as a block. 49 passed, 0 failed. Each new assertion group was mutation-checked against the merged tree: removing --quantization-config from the Kimi-K3 recipe fails 3, swapping the decode all2all backend fails 2, dropping Kimi-K3 from either gate array fails 1 each. The first version of the gate assertion did not fail under its mutation and was rewritten.
benchmark_xPyD.sh looped over "{1..$BENCHMARK_ITR}". Brace expansion runs before
parameter expansion, so that is the literal 6-character string, and the loop body
executed exactly once no matter what the variable held. Job 252775 ran with
BENCHMARK_ITR=2, printed "iter: {1..2}" into its own benchmark log, and swept each
concurrency once. scripts/vllm_dissag/benchmark_xPyD.sh already used seq.
The fix uncovers a second bug that the first one had been hiding. parse_to_csv.py
starts at "RUNNING: the benchserving script for iter: 1" and pairs each result block
with the RUNNING line in the section before it -- but an `if i > 1` guard skipped the
very first pairing. That was invisible while the marker never appeared: the search
failed, parsing began at byte 0, and the skipped section was the pre-warmup preamble,
which carries no RUNNING line anyway. Restore the marker and the skipped section
becomes the first sweep cell. Replaying job 252775's log with the loop fixed and the
parser untouched gives 6 rows instead of 7, silently missing con=8.
So: seq for the loop, drop the guard, and accept an optional prompt count in the
RUNNING regex so archived logs in the older format still parse. Replayed against
job 252775's benchmark log, the fixed parser reproduces the CSV that build 44
published, byte for byte, from a log in either format.
Fixing the loop alone would also have doubled every sglang_disagg sweep, since
run_xPyD_models.slurm defaulted the knob to 2. That default was only ever decorative,
so it moves to 1: observed behaviour is unchanged and the knob now works.
These comments cite the job IDs and measurements that motivated each fix. On a long-lived branch those numbers are unresolvable -- a reader six months from now cannot look up job 252775 -- while the mechanism they illustrate is permanent. Keep the mechanism, drop the identifiers. Comment-only: no changed line is code.
run_multinode.slurm runs under `set -euo pipefail` and expands COLOCATED_FORWARD_ENV at line 153 and again inside the srun body. Nothing assigns it - not the pipeline, not any model card - and `export NAME` on an unset variable marks the name for export without giving it a value, so it stays unset. Under `set -u` that expansion is fatal. It is an optional knob, so unset is the normal case, and the launcher aborted on the normal case: SLURM job 354061 printed its banner and died with "COLOCATED_FORWARD_ENV: unbound variable" before touching a model. Every vllm_multinode run has been failing this way, which is every Kimi card. Introduced in db276a6, which added the forwarding mechanism and both use sites but no default. Reproduced under `set -euo pipefail`: unset -> exit 1 with that exact message; with the default -> exit 0 and an empty forward list, and a set value still forwards, single and comma-separated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
run_multinode.slurm hardcoded MODEL_DIR=/shared_inference/models_blog, so a colocated run always pulled its checkpoint over NFS -- even on nodes that already held a local NVMe copy. It is the only one of the three launchers that did this; sglang_disagg/run_xPyD_models.slurm and vllm_dissag/run_xPyD_models.slurm have both probed /mnt/m2m_nobackup first for a while. It also never bind-mounted /mnt/m2m_nobackup into the container, so pointing MODEL_PATH there by hand could not have worked either. This matters most for exactly the models people complain about. A cluster survey found Kimi-K3 staged on local NVMe on all ten nodes that answered, at full size, while every colocated run read it over NFS. Small models hide the difference because they fit in page cache; a 1.5 TB checkpoint cannot. The probe requires the path on EVERY allocated node -- ranks share one MODEL_PATH, so a partial hit is useless -- and falls back to NFS otherwise. An explicit MODEL_DIR or MODEL_PATH still wins. The srun body always exits 0 so a miss does not leave a FAILED step in sacct, and the mount is guarded on -d because docker auto-creates a directory at a missing bind source, which would shadow the model with an empty one. Verified against the real function with per-node fake roots: NVMe on both nodes -> NVMe; on one node only -> NFS; on neither -> NFS; explicit MODEL_DIR and MODEL_PATH both bypass the probe; srun failing -> NFS. bash -n clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
We are about to run the same cards two ways -- STANDALONE (the pipeline sbatches the card's script) and MADENGINE (madengine generates the sbatch). Today the two agree only by coincidence, because each launcher hardcodes the site's facts separately. That drift has already cost real runs: run_multinode.slurm hardcoded the NFS model dir and never probed local NVMe, so every colocated run read its checkpoint over NFS while a full local copy sat on the node. Both siblings had probed NVMe for a while; counting m2m_nobackup across the three gave 5/6/1, and the odd one out was the bug. scripts/common/cluster.sh follows the pattern vLLM uses at .buildkite/amd-disagg/cluster.sh: sourced, every value defaulted with :-, so the layering is always "environment beats site default". That single property is what makes the two paths interchangeable, because both speak only environment variables -- STANDALONE through standalone_env.sh and sbatch --export=ALL, MADENGINE through deployment/slurm.py merging the card's env_vars into the sbatch it writes. cluster.sh only fills what neither set, so neither path changes. It also absorbs the two byte-identical copies of check_model_path, and drops a default of SLURM_SUBMIT_DIR that named one person's home directory. Card schema: the node count lived in one of two mutually exclusive places -- 39 cards had it only in args (the -N flag), which madengine never parses, and 4 had distributed.nnodes + slurm.nodes with args empty. madengine reads distributed.nnodes (deployment/slurm.py:677), so on that path the 39 fell back to a default and pyt_large_ep_bench_1n/_2n/_4n would all have run on the same node count. nnodes is DERIVED from the -N already in args, never invented; args is untouched, and the pipeline only consults nnodes when args is blank, so STANDALONE is unaffected. Verified locally, no cluster needed: - both-paths-agree: for all 43 multinode cards, the env STANDALONE produces and the env MADENGINE produces resolve identically through cluster.sh -- with no overrides, with image/model overrides, and with site overrides. - resolver replayed against per-node fake roots under both shell regimes (set -euo pipefail, and no flags at all): NVMe on all nodes picks NVMe; on a subset falls back to NFS; on neither is fatal; an empty staged directory loses to a working NFS copy; an explicit MODEL_PATH bypasses the probe; a distinct MODEL_DIR is honoured last; srun failing moves to the next candidate. - orphan-variable scan across all three launchers is clean, and re-introducing the COLOCATED_FORWARD_ENV bug makes it fail, so it would have caught d9a22b7. - every name a launcher stopped defining is provided by cluster.sh; the six that are not are function-local scratch from the deleted duplicates, with zero remaining references. - the -N in args equals distributed.nnodes equals slurm.nodes for all 43 cards; every models.json round-trips byte-exactly, so the diff is additive only. - bash -n on all four shell/slurm files. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
benchmark_xPyD.sh sweeps CON="8 16 32 64 128 256 512" -- seven concurrencies.
Mixtral-8x7B, DeepSeek-V3 and DeepSeek-R1 still declared
decode.tp: --cuda-graph-bs $(seq 1 512), so the server captured 512 CUDA graphs
at startup and used seven of them.
Measured on a 2-node DeepSeek-V3 run in tp mode (DP_MODE=0, so decode.tp is the
line in play), from the decode node's own log:
Init torch distributed ends 30 s 5%
Load weight end 83 s 13%
Memory pool end 22 s 3%
Capture cuda graph end 512 s 79% <-- 511.58 s, 512 sizes
----------------------------------------
total to ready 651 s
Capture was four fifths of bring-up. The three sibling models at the top of this
file (Llama-3.1-8B, Qwen3-32B, Llama-3.3-70B-FP8) already ship exactly this seven
-value list in the same slot, and the decode.dp variants already use a short
explicit list too, so this makes the file internally consistent rather than
introducing a new convention.
Llama-3.1-405B-Instruct-FP8-KV keeps $(seq 1 8) deliberately: it is already small
and raising it has memory implications on a 405B model that this evidence does
not cover.
Safe for batch sizes that are not captured: sglang pads a running batch up to the
nearest captured size, which is why the seven-value list already works for the
three models using it.
Verified: every decode.tp capture list now equals CON exactly except the 405B
entry; models.yaml still parses; no $(seq 1 512) remains.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
models.yaml is now layered --flag: value maps with backends, overlays and compat, and the model lists and sglang_compat.sh are gone. The vLLM recipe keeps its flag strings, so docs/configuration.md describes the two formats separately. The SGLang unit tests and the compat assert join the offline checks. Co-authored-by: Cursor <cursoragent@cursor.com>
…iver hosts The gfx950 base image (rocm/sgl-dev v0.5.20 mi35x) loads Broadcom's bnxt-rocelib 235.2.86.0 from /usr/local/lib, which accepts only kernel ABI 7-8 (Broadcom's out-of-tree bnxt_re driver), and keeps rdma-core's own provider (ABI 1) only as libbnxt_re-rdmav34.so-inbox. On a host with the in-kernel bnxt_re driver (ABI 1), libibverbs skips all eight NICs and MoRI fails at start-up with "no active RDMA device on this host". Seen on an MI350X cluster (Thor2 bnxt_re0..7, in-kernel driver): a run died in prefill during MoRI create_backend. No setting can change which provider the container loads: node.sh has no hook for extra mounts or env, IBV_DRIVERS cannot name a "-inbox" file, and the host's provider (/usr/lib64, rdma-core rdmav59) needs the host's libibverbs. mori_ep_env.sh is sourced in every container before the servers start. It now restores the inbox provider only when ibv_devices reports the bnxt_re ABI mismatch, so hosts where Broadcom's library works are unchanged.
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>
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>
The agent on every pod runs any command sent to its port, and with host networking anyone who could reach that port could run commands in the pod. The submitter now puts a random per-run token (MAD_K8S_AGENT_TOKEN) in every pod's environment; the agent refuses to start without one and refuses any request that does not carry it. Same files as madengine's k8s_shim. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 5f4c642)
…the container It mounted a caller-set JIT_CACHE_HOST but did not pass the variable in, so _clear_stale_jit_locks in vllm_disagg.sh took the cache for the job's own and removed every AITER lock, including fresh ones of another job sharing the cache. Both values now go in as the batch launchers pass them. Checked in jit_lock_assert.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The _way4 card keeps MODEL_NAME and its other values in MAD_CONFIG, which madengine resolves. submit.py reads only env_vars, so its pods started without them and the launcher stopped on "set MODEL_NAME". It now refuses such a card (MAD_CONFIG, or a mad-config.yaml next to the script) and says madengine is needed. Tested in test_submit.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…alue The per-architecture stack left `ARG BASE_DOCKER=` empty and chose the base through stage names. Tools that read the base image from that ARG got nothing: the mad-validate workflow's Dockerfile renderer stopped with "no base image ... could not read ARG BASE_DOCKER from docker/sglang_disagg_inference.ubuntu.amd.Dockerfile", and tools/utils.py get_base_docker returned "". BASE_DOCKER now holds the gfx942 base (the default architecture, the same image as before the split) and BASE_DOCKER_GFX950 the gfx950 one; MAD_SYSTEM_GPU_ARCHITECTURE still picks between them. Checked with `docker buildx build --check` for both architectures and by rendering every template on a merge with develop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit put the JIT_CACHE_HOST and JIT_LOCK_STALE_MIN options on the EP_TP_SIZE line. Same options, one per continuation line like the rest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
The colocated launcher (from ROCm#242 through the spurupdate merge) refuses a MAD_CONFIG card that has no MODEL_NAME and says madengine resolves the file; the golden recorded the old "set MODEL_NAME" failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RCCL CI parses these files by name. Checked against ROCm/MAD develop: every launcher writes the same names in the same place after the refactor. The node programs (node.sh) tee to pd_vllm_bench_NODE<rank>.log / pd_sglang_bench_serving.sh_NODE<rank>.log as the launchers' srun bodies did, the role scripts name prefill_/decode_/proxy_/vllm_router_/ agentic_models_shim_NODE<rank>.log with the same expressions, LOG_PATH is still mounted at /run_logs, and NODE_RANK is still SLURM_PROCID; the job array and Kubernetes dispatchers export SLURM_JOB_ID / SLURM_PROCID for the run, and their snapshot equivalence runs give the same docker commands. The only additions are new files (gpu_fault_NODE<rank>.log, the opt-in gpu_mem_trace); the removed sglang_disagg_server.sh was not run by any launcher. The colocated launcher is new in this stack; its names are pinned as ROCm#242 added them. log_names_assert.sh checks every rank of every snapshot golden (mount, NODE_RANK, the node log's name) and the exact expressions in the role scripts, so a rename fails a test. docs/multinode-running.md says the names are a contract and lists the pattern. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No textual conflicts once spurupdate (which carries ROCm#242's merge of develop) was in. One semantic one: develop's mad-validate workflow renders every Dockerfile template with a default base image read from a reference Dockerfile, and this branch retires two of them (docker/sglang_disagg_inference, docker/vllm_disagg_inference) for docker/di_sglang / docker/di_vllm built from pin sets. render_dockerfile.py now reads those two frameworks' default base image from their pin set's gfx942 base (docker/pins/sglang-disagg.json, vllm-mori121.json, the sets that replace them), and the skill's table says so. Checked by running the workflow's steps (model validator, skill linter, every template rendered and validated, madengine discover --tags all) on the merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ernel-driver hosts" This reverts commit 924a1e8. Restoring the base image's rdma-core 39 provider lets the bnxt_re devices open, but that provider cannot create QPs on Thor2 under the in-kernel driver (ibv_rc_pingpong: "Couldn't create QP"), so MoRI KV transfers stall instead of failing at start-up: one run hung for 15 minutes. rdma-core v54.0 is the first release that works there; the image now takes it as a build arg instead.
The gfx950 base (rocm/sgl-dev v0.5.20 mi35x) ships rdma-core 39 plus
Broadcom's bnxt-rocelib 235.2.86.0, which only works with Broadcom's
out-of-tree bnxt_re driver. On an MI350X cluster (Thor2 BCM57608,
in-kernel bnxt_re driver) no RDMA works in
the container: bnxt-rocelib rejects every NIC ("does not support the
kernel ABI of 1 (supports 7 to 8)"), and the base's own rdma-core 39
provider opens them but cannot create QPs. Cross-node ibv_rc_pingpong
in the image fails with rdma-core 39, 50 and 53 and passes with 54.0
and 61.0 (likely 5f008dbf, variable-size send WQEs, first in v54.0).
With v61.0, MoRI IO GPU-memory batch writes validate at 40.9 GB/s over
one NIC.
rdma_core is a pin component like MoRI: pins.py emits RDMA_CORE_BUILD,
_REPO and _COMMIT, and the Dockerfile builds it over the base's stack
where the pin set enables it (gfx950 here; gfx942's base is unchanged).
linux-rdma is rdma-core's upstream, so the no-fork test accepts it.
Hosts on Broadcom's out-of-tree driver need the base's stack, which
this replaces; that trade-off is open with the image's owners.
MoRI's start-up only opens the RDMA devices, and the recipes carry --watchdog-timeout 1000000, so an image whose RDMA user space cannot create QPs on the host's NICs started both servers and then hung on the first KV transfer: one run (rdma-core 39 on Thor2 under the in-kernel bnxt_re driver) aborted 72 transfers and was cancelled after 15 minutes. Before the container barrier, each node now runs a loopback ibv_rc_pingpong on every IB_DEVICES NIC at MORI_IB_GID_INDEX. A failure goes through _job_fail, so the peers' barrier sees the abort file and the whole job stops in seconds with the device and the reason. With the base gfx950 image it reports "IB device bnxt_reN not found"; with rdma-core 39's provider, "Couldn't create QP"; rdma-core v61.0 passes. Skipped under DRY_RUN and when the image has no ibv_rc_pingpong. RDMA_PREFLIGHT=0 skips it; node.sh forwards it only when set, so the rendered docker flags are unchanged otherwise (snapshot: 18 cards, 0 differ).
node.sh hard-coded --privileged, and a Docker daemon whose policy refuses
privileged containers then refuses every node's container, with no setting to
change it. CONTAINER_PRIVILEGE_ARGS (cluster.sh, default --privileged) is what the
container gets instead; on such a site, the capability RDMA needs:
CONTAINER_PRIVILEGE_ARGS="--cap-add IPC_LOCK --ulimit memlock=-1:-1"
The default leaves every card's docker run unchanged (goldens identical).
Co-authored-by: Cursor <cursoragent@cursor.com>
docs/configuration.md still had SGLang composing PREFILL_MODEL_CONFIG / DECODE_MODEL_CONFIG and the launcher owning --tp-size and the transfer backend; render.py and models.yaml do both now. One role-script comment still named DECODE_NODE_RANK. node.sh does not source cluster.sh, so it now defaults CONTAINER_PRIVILEGE_ARGS to --privileged itself: a dispatcher that does not forward the variable would otherwise start the containers unprivileged. Comments the port added are trimmed to what the code does not say. Snapshot: 18 cards, 0 differ. Co-authored-by: Cursor <cursoragent@cursor.com>
run_benchmark.sbatch ran `docker stop $(docker ps -aq) && docker rm $(docker ps -aq)` on every node before starting, which stops and deletes every container on the node, including other users' on a shared cluster. The lines before it already stop and remove the ep-bench container this script starts, and the cleanup step at the end does the same, so only the node-wide one is removed.
The launcher assumed one CX7 cluster and could not be told otherwise: it runs a fixed docker command with no environment passthrough. On an MI350X cluster (Thor2 bnxt_re, fenic0, multi-homed nodes, FQDN hostnames, root-squashed /home) it could not run: - run_node.sh forced GLOO_SOCKET_IFNAME=eth0; there is no eth0; - each node mapped its name to its first `hostname -I` address, a /31 RDMA rail the peer cannot reach over TCP; - role detection compared the short Slurm name with an FQDN `hostname`, so neither node took the target role; - the MoRI backend only looked for MoRI in /workspace/mori; - `set +x` above the #SBATCH lines made sbatch ignore every directive (-N 2, --output), and there was no madengine card. Inside MAD the launcher now sources common/cluster.sh and launcher_lib.sh like the other multinode launchers: --ibdevice defaults to mlx5_0 on cx7/unknown and the first detected rail on thor2/ainic; caller-set fabric values always reach the container, and on thor2/ainic the detected ones too, so cx7 keeps its container defaults; both nodes resolve both names to the FABRIC_SUBNET_PREFIX address. Run standalone (no MAD around it) it behaves as before. run_node.sh honours a forwarded GLOO_SOCKET_IFNAME and compares short names; the MoRI backend takes MORI_ROOT or the first of /workspace/mori, /sgl-workspace/mori, /app/mori with MoRI's IO benchmark, and installs prettytable if missing. For madengine: the launcher falls back to DOCKER_IMAGE_NAME for the image, pre-creates the results directory writable for a root-squashed container, merge_results.py --perf-csv writes the perf schema, and cluster_job_verdict publishes perf_kvcache_transfer_bench.csv (the new card pyt_kvcache_transfer_bench_mori's multiple_results) and fails the job on a node failure or a size with no throughput.
run_benchmark.sbatch assumed one CX7 cluster: IBDEVICES defaulted to mlx5_0, each node was addressed by its first `hostname -I` address (a /31 RDMA rail on multi-homed nodes, which the peer cannot reach over TCP), /shared_inference/models was bind-mounted unconditionally (docker creates a missing source as an empty root-owned directory), and the perf.csv run_ep_bench.sh writes was never handed to madengine, so the cards reported nothing. Like the other multinode launchers it now resolves its directory under sbatch's spool copy and, inside MAD, sources common/cluster.sh and launcher_lib.sh: IBDEVICES defaults to mlx5_0 on cx7/unknown and the first detected rail on thor2/ainic; caller-set fabric values always reach the container, and on thor2/ainic the detected ones too, so cx7 keeps its container defaults; nodes are addressed on FABRIC_SUBNET_PREFIX. The models share is mounted only where it exists, the job log directory is writable for a root-squashed container, and cluster_job_verdict publishes perf_large_ep_bench.csv, which every card now declares as multiple_results, and fails the job on a node failure or an empty result.
ROCm#300 brings ROCm#269, which moved the KV cache transfer benchmark to run.slurm, NIXL, its own madengine cards and to_perf_csv.py. The fabric commit on this branch was written against the old launcher; its changes are kept on ROCm#269's: the cluster.sh fabric (ibdevice, forwarded NCCL / GLOO / MoRI settings), node addresses on FABRIC_SUBNET_PREFIX, the project directory under sbatch from the MAD root, result directories writable for a root-squashed container, short-name roles and the MoRI root. Its own card and perf.csv writer give way to ROCm#269's. The cards drop IBDEVICE=mlx5_0 so the fabric picks the NIC; CX7 still gets mlx5_0. Co-authored-by: Cursor <cursoragent@cursor.com>
vdar25
requested review from
Cemberk,
amathews-amd,
coketaste,
gargrahul,
itej89,
lcskrishna and
leconcio
as code owners
November 17, 2026 00:44
render.py passes the same server flags as before in another order, and once a flag the old command gave twice (with the value that took effect), so re-recording rewrote all 18 SGLang goldens for no change in what runs. The snapshot now compares SGLang server commands as argparse reads them: option order is free, and a repeated option counts once with its last value. The goldens stay ROCm#300's. Docker runs, router commands and every vLLM command are still compared exactly, and a changed or dropped flag still fails. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #300 (
di-refactor): this branch merges its current head (a967711). The changes below are only what this PR adds on top.Summary
The SGLang disaggregated recipe's server and router commands now come from data:
models.yamlholds every model's flags, andrender.pyturns them into each node's command lines. Adding a model, changing a flag, or moving to a newer SGLang no longer means editing shell. The PR also carries two fixes found bringing the recipe up on Broadcom Thor2 NICs (MI350X), a site setting for Docker daemons that refuse--privileged, and the same fabric portability for the KV cache transfer and large-EP benchmarks.Changes
Recipes as data (
scripts/sglang_disagg/render.py,models.yaml)models.yamlis layered:defaultsand per-model entries (base->modes.<tp|dp_ep>->roles.<prefill|decode>, withextends), thenbackends(KV transfer),overlays(agentic radix cache and metrics) andcompat.render.py shell --rank Ngives a node its role, server argv and router argv. The role script runs those as arrays; its three hand-built command strings, the inline YAML reader and the parallel-size math are gone.render.py validatereplaces the hard-coded model lists (VALID_MODELS,MORI_EP_VALID_MODELS, andMORI_DP_MODE1_ALLOWED_MODELS, which the role script duplicated). A model runsDP_MODE=1if its entry has amodes.dp_epblock.render.py planpreviews every node's commands without GPUs;render.py checkreports any flag an image's SGLang does not accept.SGLang version compat (replaces
sglang_compat.sh)compatinmodels.yamllists renamed and removed flags.render.pyapplies them only when the installed SGLang's--helpno longer accepts the name in the recipe. For SGLang 0.5.20:--cuda-graph-bs->--cuda-graph-bs-decode,--prefill-round-robin-balancedropped. On 0.5.12 the commands are unchanged.Broadcom Thor2 under the in-kernel
bnxt_redriver (MI350X)rdma_corepin component). The base stack rejects the NICs (kernel ABI 1) or cannot create QPs; v54.0 is the first release that can. Hosts on Broadcom's out-of-tree driver need the base stack instead; that trade-off is open with the image's owners.ibv_rc_pingpongon everyIB_DEVICESNIC. A NIC that cannot create a working QP fails the job in seconds with the device and the reason, instead of hanging the first KV transfer behind--watchdog-timeout.RDMA_PREFLIGHT=0skips it.Site setting
CONTAINER_PRIVILEGE_ARGS(cluster.sh, default--privileged) replaces the hard-coded--privilegedinnode.sh. Where Docker refuses privileged containers:--cap-add IPC_LOCK --ulimit memlock=-1:-1.Benchmarks on any fabric (the KV cache transfer and large-EP benchmarks hit the same multi-homed Thor2 nodes)
kvcache_transfer_bench, on Integrating KV Cache Transfer Benchmark with madengine #269's launcher: NIC, GID and interfaces fromcluster.sh(Thor2 and AINIC detected; CX7 unchanged), node addresses onFABRIC_SUBNET_PREFIX, roles matched on short hostnames, MoRI found in the SGLang and large-EP images too, result directories writable on root-squashed storage, andsbatchfrom the MAD root. The cards no longer pinIBDEVICE=mlx5_0, so the fabric picks the NIC.large-ep-benchmark: the same fabric and addressing; the models share is mounted only where it exists;perf_large_ep_bench.csvis published so its cards report through madengine; cleanup stops only the benchmark's own container.Smaller
common/topology/specs/sglang_disagg_2p2d_tp8.json.whoami, so the goldens do not depend on who runs them.docs/sglang-disagg.md(recipes, compat,RDMA_PREFLIGHT),configuration.md,adding-a-model.md, the recipe README.Compatibility
Snapshot goldens (18 SGLang cards) were re-recorded. Compared with #300's goldens: every card's
docker run(flags, mounts, environment) is identical, and every server and router command has the same flags with the same effective values, in a different order. The one textual difference beyond order: DeepSeek prefill passed--mem-fraction-statictwice (0.73, then0.65, the value that took effect) and now passes it once.Testing
Offline (on the merged head)
snapshot.py --catalog sglang_disagg: 18 cards, 0 differscripts/sglang_disagg/tests:test_render.py20 tests OK;prr_flag_assert13,parse_to_csv_assert19,fault_capture_assert6,mori_env_assert6,forward_env_assert4 passedscripts/common/tests:dispatch27,launcher_verdict35,log_names25,config_layers27,node_lib16,launcher_lib15,cluster_fabric7 passed, and topology, config and pin-set unit tests OKGPU: DeepSeek-V3, 1 prefill + 1 decode node,
DP_MODE=1(MoRI EP, DP attention), 1024/1024 sweepMI300X (OCI, CX7 RoCE), image built from this branch's pin set (SGLang 0.5.12.post1, MoRI 158c7e8).
run_xPyD_models.slurmin the allocation, no madengine)madengine runofpyt_sglang_disagg_mori_dp_deepseek-v3,slurm_multi)Total token throughput (tok/s) by concurrency, against the same card from
developCI on this cluster (imageci-sglang_disagg_..._sglang_disagg_inference, SGLang 0.5.12.post1):GPU: Broadcom Thor2, MI350X