Skip to content

GLM-5.3-Flash-MXFP4 on gfx942: exact FP8-block prefill, 4-bit decode (stacked on #274) - #288

Open
raviguptaamd wants to merge 14 commits into
ROCm:developfrom
raviguptaamd:glm53flash-gfx942-mxfp4
Open

raviguptaamd wants to merge 14 commits into
ROCm:developfrom
raviguptaamd:glm53flash-gfx942-mxfp4

Conversation

@raviguptaamd

Copy link
Copy Markdown
Contributor

Adds GLM-5.3-Flash-MXFP4 (AMD Quark MXFP4 checkpoint, 173 GB vs 306 GB FP8) to the vllm_dissag harness on gfx942 (MI300X / MI325X), on the same image and recipe as the FP8 card of #274.

Stacked on #274. This branch is #274's head (1f46d80) plus two commits. Until #274 merges, the diff here also shows #274's four commits. The changes of this PR alone: MIR-AMD/MAD@glm53flash-gfx942...raviguptaamd:MAD:glm53flash-gfx942-mxfp4

Why it works on gfx942

gfx942 has no FP4 or INT4 matrix instructions. Every routed-expert matrix of this MXFP4 checkpoint converts exactly into FP8 (e4m3) 128x128 blocks with a power-of-two block scale 2^(e_max − 5): the group scale exponents inside each block span at most 8 binades (exact up to 11), checked over all 37,152 matrices / 18.6M blocks, and the conversion re-checks every value at load. One checkpoint therefore runs in two modes:

  • prefill: routed and shared experts as exact FP8 blocks on the stock FP8 block MoE / per-block linear paths (FP8 matrix cores, the FP8 model's tuned kernels)
  • decode: routed experts stay 4-bit on AITER FlyDSL W4A16 with an exact e2m1 decode: 38.84 vs 54.32 GiB weights per GPU, so +17% (MI325X) / +31% (MI300X) KV cache per GPU

Changes

  1. Dockerfile repin. Still no patch overlay; every fork branch is a linear descendant of GLM-5.3-Flash-FP8 on gfx942: disaggregated 1P/1D serving #274's pin.
    • vLLM raviguptaamd/vllm@439eabe5c (glm53-flash-gfx942-mxfp4-mad) = 6a0cb9395 + 11: DSA indexer exact causal rows under FULL graphs with MTP; SP dense-MLP replication and MoRIIO KDA-state fan-in for TP prefill (inert unless used); MXFP4 weight-only on gfx942; exact MXFP4 to FP8-block routed and shared experts; FlyDSL exact-e2m1 4-bit experts
    • AITER raviguptaamd/aiter@11a6be6e (glm53-flash-gfx942-fp4lut) = 6f65fba0 + 3: FlyDSL W4A16 exact OCP e2m1 decode, tuned GLM-5.3-Flash fused_moe configs
    • vllm-router raviguptaamd/router@076800b (glm53-flash-gfx942-hybrid) = 9b2146ec + 1: ROUTER_DECODE_DP_PIN=0, off by default
    • MoRI unchanged; 9 new build-time fix markers (29 total)
  2. connectors/moriio.sh: opt-in per-leg env, PREFILL_EXTRA_ENV / DECODE_EXTRA_ENV (KEY=VAL ...), exported only on that leg; unset for every other model.
  3. GLM-5.3-Flash-MXFP4-gfx942 in models.yaml: the FP8 card's flags plus VLLM_ROCM_MXFP4_WEIGHT_ONLY=1, AITER_FLYDSL_W4_FP4=1, VLLM_ROCM_MXFP4_DENSE_FP8BLOCK=1 and PREFILL_EXTRA_ENV=VLLM_ROCM_MXFP4_MOE_FP8BLOCK=1. Five models.json cards (MODEL_WEIGHTS_NAME=GLM-5.3-Flash-MXFP4), slurm allowlists.
  4. skills/glm53-flash-gfx942/SKILL.md: pick FP8 or MXFP4, build and check the image, submit, verify each leg's expert format from the load logs (expected weights and KV per GPU), expected results, failure signatures.
  5. results/GLM-5.3-Flash-MXFP4-gfx942_20261023.html, README entries, tests.

The FP8 card changes too. The new vLLM pin includes the DSA indexer causal-rows fix: with MTP under FULL graphs, the indexer's host-side short-row shortcut froze at capture and verification rows lost causal tokens. FP8 disaggregated GSM8K 94.2% to 97.35%, TTFT and TPOT unchanged. #274's results page was measured on the previous pin.

Validation

  • Offline: tests/run_all.sh gate_check 32/32, argv_assert 56/56. New checks: MXFP4 argv identical to the FP8 card per leg; VLLM_ROCM_MXFP4_MOE_FP8BLOCK reaches prefill only; the FP8 card gets no per-leg env; MXFP4 weights probe. bash -n, json/yaml loads clean.
  • Build: this Dockerfile built from source on MI325X: all 29 markers present, /app/versions.txt = the pins above.
  • Live, MAD harness, MI300X 1P/1D (useocpm2m-097-148 to 097-113, ConnectX-7, image from this Dockerfile, jobs 497245 / 498039):
    • Final MODEL_PATH: .../GLM-5.3-Flash-MXFP4 on both nodes
    • prefill 54.33 GiB weights (FP8 blocks), KV 3,925,274 tokens/GPU; decode 38.84 GiB (4-bit)
    • long_context: 256K/1K c1 / c8 TTFT 33.7 / 60.1 s, 512K/1K 72.8 / 125.8 s, every request completed
    • niah: 2K / 8K words 10/10 (FP8 card 9.7/10). At 20K / 35K over 10 seeds both cards occasionally return a single needle, on different seeds: 2/20 FP8 vs 3/20 MXFP4 trials, paired McNemar p = 1.0
  • Full suite (recipe harness, same image content): MI325X, three repeats: GSM8K 97.32% both, seeded random NIAH 16K-704K identical prompt by prompt, AgentX 256k / 512k within 1.2% of FP8, KV-bound load +13% tok/s and −15% TTFT. MI300X 1P/1D: GSM8K 97.35 / 97.19%, NIAH identical, KV-bound load −22% TTFT.

Known limitation: a 4-bit decode step is ~3-4% slower than FP8 (FlyDSL W4A16 ~1.6 vs ~5.2 TB/s for CK FP8 at decode batch sizes).

Made with Cursor

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

MIR-AMD commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Closing in favor of #316: the same MXFP4 card, image pins and per-leg env, rebased on develop and stacked on #274, without the hybrid-prefill cards and the docs. #316 has live gate results for both cards (three runs each) and an MXFP4 vs FP8 throughput sweep. Hybrid prefill (PREFILL_TP and the -hyb cards) can follow as its own PR once #316 lands. Thanks @raviguptaamd, you are co-author on the commit.

@MIR-AMD MIR-AMD closed this Nov 18, 2026
@MIR-AMD MIR-AMD reopened this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants