Skip to content

MUSA: integrate MATE Mega MoE and enable graph-safe DP+EP on MCCL - #325

Draft
yeahdongcn wants to merge 6 commits into
v0.32.0-devfrom
xd/mate-mega-moe
Draft

yeahdongcn wants to merge 6 commits into
v0.32.0-devfrom
xd/mate-mega-moe

Conversation

@yeahdongcn

@yeahdongcn yeahdongcn commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add opt-in MATE Mega MoE for single-node block-FP8 experts, and enable graph-safe regular DP+EP on MCCL through the existing vLLM communicator APIs. The backend owns expert dispatch, both FP8 projections and weighted combine; regular DP+EP retains the upstream PyNcclCommunicator interface.

Review status: Ready for code review as a restricted, explicitly selected backend. Current tail fix is bbbadbb5; the follow-up below separates the completed four-card diagnostic from pending isolated eight-GPU performance sign-off. Current CI, 1/4-rank correctness, full-model accuracy and a 30-minute soak pass. Final eight-rank correctness and isolated-node A/B/A results are recorded in the follow-up section below; review readiness is not a claim of full production/performance qualification.

How to enable Mega MoE

Use a v0.32 build of this PR with its pinned dependencies, including MATE 0.2.8.post1 and Torchada 0.1.111. The selected v0.28.0-...-20261114 Docker image is a build base, not a ready-to-run image of this PR: its native vLLM 0.28/MATE 0.2.7 must be updated and the candidate built first. Exact test-environment provenance is below.

The following is the tested DP4+EP4 deployment shape; replace /models with your mounted model directory and run on four leased S5000 GPUs:

export VLLM_ENGINE_READY_TIMEOUT_S=1800
vllm serve /models/Qwen3-30B-A3B-FP8 \
  --served-model-name Qwen3-30B-A3B-FP8 \
  --host 127.0.0.1 --port 8000 \
  --data-parallel-size 4 --enable-expert-parallel \
  --moe-backend mate_mega_moe \
  --max-model-len 4096 --max-num-batched-tokens 4096 --max-num-seqs 64 \
  --gpu-memory-utilization 0.85 --no-enable-prefix-caching \
  --compilation-config '{"mode":"NONE","cudagraph_mode":"FULL_DECODE_ONLY"}'

The switch is --moe-backend mate_mega_moe. For the same-layout regular DP+EP baseline, remove only that option. No DeepEP option or environment toggle is needed: selecting Mega MoE binds the passthrough prepare/finalize internally. Verify Using MATE_MEGA_MOE ... MoE backend and graph-capture completion in the server log; startup alone is not a correctness test.

curl --fail http://127.0.0.1:8000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"Qwen3-30B-A3B-FP8","messages":[{"role":"user","content":"What is the capital of France? Answer in one word."}],"temperature":0,"max_tokens":32,"chat_template_kwargs":{"enable_thinking":false}}'

Supported configuration and validation commands.

Test results on the current code

These are functional/accuracy results on leased GPUs of shared nodes, not new isolated-node throughput measurements. Model: Qwen3-30B-A3B-FP8. Driver: 5.2.0-server. Exact environment and source pins are recorded below.

  • CI and offline: offline-series passes on 0d81f38e; 231 local regression tests pass, repository pre-commit hooks pass, 216-entry patch replay and byte-identical round-trip pass, pristine-pin musa_sync verify passes. CI run.
  • 1 rank, H512/I256/E128/top-8: 27 numerical checks, 32 input-changing graph replays, three buffer/process-group teardown/recreation cycles pass. Worst relative L2: 0.00411.
  • 4 ranks, the same small shape: 108 per-rank numerical checks, 128 per-rank graph checks, three teardown/recreation cycles pass. Worst relative L2: 0.00305.
  • 4 ranks, actual Qwen3 H2048/I768/E128/top-8: the same 108/128 grid and three cycles pass, repeated with the final split-only execution path. Worst relative L2: 0.00460.
  • Full-model serving, regular DP4+EP4 and Mega MoE: both pass semantic/multi-turn requests, 36 mixed short/long requests, three streaming cancellations, idle recovery and a post-cancellation semantic request. Mega MoE selection and graph capture are positively verified in the log.
  • Full GSM8K, 1319 questions: regular DP4+EP4 1223/1319 (0.9272); Mega MoE 1227/1319 (0.9303). Greedy, thinking off, max output 768. Paired outcomes: 1201 both correct, 22 baseline-only, 26 Mega-only; truncations 7/8. No observed accuracy degradation, not a statistically significant improvement claim.
  • Final-module 30-minute soak: 2844 completed mixed requests, 47 stream cancellations, semantic recovery passes. Late free-memory loss on the four leased GPUs: [0, 0, 0, 0] bytes in the recorded snapshots. This qualifies the tested duration/workload, not every possible allocator leak.

The numerical grid covers 0/1/127/128/129/256 tokens, [0,1,128,129], one busy rank with idle peers, and repeated prefill/decode transitions. Nonempty outputs must be finite and non-poison with relative L2 <=0.06 and cosine >=0.998. Graph replay uses fresh inputs and requires bitwise equality with eager; thresholds were not relaxed.

Reproduce the actual-shape functional grid with the installed candidate:

torchrun --standalone --nproc_per_node=4 \
  benchmarks/fused_moe/validate_mate_mega_moe.py \
  --hidden 2048 --intermediate 768 --experts 128 --topk 8 \
  --cycles 3 --replays 8 --output /tmp/mate-validated.json

The validator executes real adapter weight repacking, activation quantization, MATE kernels, graph replay and communicator cleanup. It constructs an expert fixture directly; full server/oracle wiring is separately exercised by the model-level tests above.

Eight-GPU qualification follow-up

Eight-GPU qualification tracker for 0d81f38e.

Status: complete. Updated 2026-11-14T23:15:39+08:00. Deadline: 2026-11-15T21:26+08:00.

Development pool only, driver 5.2, single isolated eight-GPU node. No reservation while waiting.

  • eight_rank: PASS, mega325-track-1114-eight_rank-01, lease released.

  • baseline_a1: PASS, mega325-track-1114-baseline_a1-01, lease released.

  • mega_b: PASS, mega325-track-1114-mega_b-01, lease released.

  • baseline_a2: PASS, mega325-track-1114-baseline_a2-01, lease released.

Pinned comparison host: 10.20.32.87. All A/B/A arms stay on this host/image/GPU bin.

Baseline drift gate (3%): INCONCLUSIVE; exceeds gate. Regression flags: mixed-c64.

  • mixed c=1: A1/B/A2 57.0/82.6/56.9 tok/s; Mega vs mean A throughput +45.1%, mean_tpot_ms -30.9%; A drift 0.11%.

  • mixed c=8: A1/B/A2 371.4/549.8/365.5 tok/s; Mega vs mean A throughput +49.2%, mean_tpot_ms -33.1%; A drift 1.59%.

  • mixed c=64: A1/B/A2 2270.3/1507.4/2311.9 tok/s; Mega vs mean A throughput -34.2%, mean_tpot_ms +49.7%; A drift 1.92%.

  • mixed c=128: A1/B/A2 2323.3/5879.2/4098.7 tok/s; Mega vs mean A throughput +83.1%, mean_tpot_ms -48.5%; A drift 76.42%.

  • prefill c=1: A1/B/A2 4.7/8.0/4.8 tok/s; Mega vs mean A throughput +67.0%, mean_ttft_ms -40.2%; A drift 1.10%.

  • prefill c=64: A1/B/A2 44.8/83.2/44.9 tok/s; Mega vs mean A throughput +85.5%, mean_ttft_ms -46.1%; A drift 0.30%.

  • decode c=1: A1/B/A2 57.6/83.6/57.6 tok/s; Mega vs mean A throughput +45.1%, mean_tpot_ms -31.1%; A drift 0.08%.

  • decode c=64: A1/B/A2 2523.9/3765.3/2520.3 tok/s; Mega vs mean A throughput +49.3%, mean_tpot_ms -33.2%; A drift 0.14%.

No code, merge action or draft-state change is performed by this tracker. Raw logs/JSON are saved under generated/perf-xvendor/evidence/ in the task workspace.

Mixed c=64/128 tail diagnosis and fix

The reproduced stalls are FA3 lazy JIT, not KV-cache capacity exhaustion. On the recorded four-card diagnostic, KV usage peaked at about 8.1% with zero preemptions while request-time forward compilation took 43–50 seconds. A forward/metadata-only preload still left a roughly 12-second combine compile; both raw failures remain preserved.

Commits c3913363 and bbbadbb5 load the actual MATE forward, scheduler-metadata and combine modules before engine readiness, including mixed-decode and low-CTA split variants. This is startup module loading only: no changed attention arithmetic, KV allocation, request lengths, EOS policy or correctness thresholds. The bounded gate is paged BF16 FA3, head dimension 128, GQA ratio 8, cache block 64 and DCP=1; other geometries retain their existing warmup. It uses the pinned MATE 0.2.8.post1 helpers, not a generic compatibility promise for later private APIs.

Verification: The final expanded local regression slice passes 293 tests; pre-commit and the current offline-series CI pass. A CPU-only check inside the frozen MATE image verifies the helper configuration coverage and all seven forward dispatches for query lengths 1…4096. This is module/config inspection, not another GPU benchmark.

Cold-container retest, mega325-tailfixed-1115d: Qwen3-30B-A3B-FP8, DP4+EP4, same image and 1024→512 fixed-token workload; c=1/8 followed by c=64/128 warm + three measured passes. All 12 phases completed, with exact requested output-token counts and no failed benchmark requests.

  • c=64: warm TTFT p99 1.389 s; measured p99 1.374 / 1.360 / 1.368 s. Output throughput 2842 / 2805 / 2842 tok/s.
  • c=128: warm TTFT p99 2.594 s; measured p99 2.724 / 2.617 / 2.693 s. Output throughput 4657 / 4664 / 4602 tok/s.
  • Across c=64 warm + all three measured passes, maximum TTFT/ITL was 1.442 s / 0.308 s; across c=128, 2.786 s / 0.345 s. These maxima come from detailed request JSON, not p99 estimates.
  • No MATE build/build_and_load start/end event was recorded within any c=64/128 phase. This is not an all-request-period zero-JIT claim: c=1 warmup still recorded three small module calls (outer duration 7.7–11.3 ms). Nested build/load calls are not counted as separate compilations; the observer covers MATE, not every JIT system.
  • Sampled KV-cache peak 8.317%, all observed preemption counters zero. Container removal, scratch cleanup and exact lease release are confirmed.

These are four-card shared-node diagnostic results, not a Mega-vs-baseline performance comparison. They do not supersede the earlier eight-GPU mixed-c64 regression or mixed-c128 baseline-drift failure. Updated isolated eight-GPU A/B/A, with the same preload on both baseline and Mega arms, remains required; no eligible driver-5.2 whole node was available at the recorded follow-up check.

Cold-start cost: the full cold startup took 1061 s (17 min 41 s). Set VLLM_ENGINE_READY_TIMEOUT_S=1800 in both arms; the upstream default 600 s was insufficient in a preserved failed attempt. This increases only the startup readiness budget, not request/SLA timeouts. A compatible persistent MATE cache may reduce repeated startup cost; warm-start timing has not been qualified.

Evidence stays local under generated/perf-xvendor/evidence/: mega325-tailmega-1115c (unfixed), mega325-tailfixed-1115c (incomplete forward/metadata fix), mega325-tailfixed-1115d (full fix), and mega325-tail-review-1115 (review/report). PR remains draft pending the isolated performance follow-up.

Post-FA3-fix isolated eight-GPU A/B/A

Eight-GPU qualification tracker for bbbadbb5.

Status: failed. Updated 2026-11-16T10:02:20+08:00. Deadline: 2026-11-16T21:36+08:00.

Development pool only, single isolated eight-GPU node. No reservation while waiting.

User-authorized alternate-driver hosts: 10.20.32.1 (3.3.8-server), 10.20.35.86 (3.3.5-server). Validate eight-rank numerics/graphs before A/B/A; all arms keep the same driver. This does not qualify performance on the target driver-5.2 environment.

Post-FA3-preload A/B/A: identical forward/metadata/combine overlays, separately copied CPU-built runtime caches, MATE-native prebuilt loading of the same 43 binaries, and startup budget in all arms. This is a new comparison, not a replacement of the earlier failed mixed-c64/c128 evidence.

  • eight_rank: PASS, mega325-alt-1116-eight_rank-01, lease released.

  • baseline_a1: FAIL, mega325-alt-1116-baseline_a1-01; c1 measured and c8 warm completed, c8 measured timed out at 300 s. Exact lease/container/scratch cleanup confirmed by recovery.

  • mega_b: Not run yet.

  • baseline_a2: Not run yet.

Pinned comparison host: 10.20.32.1. All A/B/A arms stay on this host/image/GPU bin.

Recorded host driver: 3.3.8-server.

Stopped with evidence retained: RuntimeError: baseline_a1 failed: TimeoutExpired: Command '['vllm', 'bench', 'serve', '--backend', 'openai', '--base-url', 'http://127.0.0.1:18152', '--model', 'qwen3-moe', '--tokenizer', '/ipfs/models/Qwen3-30B-A3B-FP8', '--dataset-name', 'random', '--random-input-len', '1024', '--random-output-len', '512', '--random-range-ratio', '0.0', '--ignore-eos', '--seed', '0', '--num-prompts', '32', '--max-concurrency', '8', '--percentile-metrics', 'ttft,tpot,itl,e2el', '--save-result', '--save-detailed', '--result-dir', '/work/results', '--result-filename', 'bench-mixed-c8.json']' timed out after 299.99998027301626 seconds

No code, merge action or draft-state change is performed by this tracker. Raw logs/JSON are saved under generated/perf-xvendor/evidence/ in the task workspace.

The c8 stall is not yet root-caused. Saved metrics stop advancing at 01:54:10 UTC with requests active on DP ranks 0/4/6; all eight EngineCores then report waiting for worker responses about 60 s later, while /metrics continues returning 200. The earlier out-of-order stats warning precedes roughly 22 s of further token progress, so it is not proven causal. KV peak is only 1.639%, preemptions are zero, and the stalled phase has no recorded MATE build/load event. Current hypotheses are DP participation/idle-drain coordination or device/collective non-completion; neither the driver nor a specific production function is confirmed as the cause.

The next diagnostic keeps the original c1→c8 request sequence, lengths, graph/async settings and 300 s timeout, and adds signal-triggered stacks from registered descendants of this task's server only. The harness safety tests pass; no production numerical/communication fix is claimed. The original 32.1 node is currently unreachable and no eligible isolated eight-GPU node was available at the investigation snapshot. B/A2 and post-fix performance remain unrun.

Performance comparison — historical 8-GPU results

These measurements precede the rebase and the new base image. They motivate this integration; they are not a performance qualification of 0d81f38e. The completed pre-fix eight-GPU A/B/A above failed the mixed-c64/regression and mixed-c128/drift gates; a fresh isolated comparison after bbbadbb5 is pending.

Recorded setup: isolated 8x MTT S5000 MP56, driver 5.2.0-server, Qwen3-30B-A3B-FP8, MATE 0.2.8.post1, and v0.32.0-ph1-5.2.0-torch2.11.0.post2-20261106 (sha256:65d5e96b5027c796494a7ad6597c6267953d60b96e2436c344760b243c346bc1). Warmed random 1024-input/512-output requests, --ignore-eos, concurrency c, measured prompts max(16, 4*c).

Each comparison below is output tok/s (mean TPOT in ms), regular DP8+EP8 vs the same DP8+EP8 layout with Mega MoE:

  • c=1: 57.0 (17.15) -> 83.9 (11.67); throughput +47%.
  • c=8: 376.9 (20.55) -> 554.0 (14.00); throughput +47%.
  • c=64: 2314.3 (25.59) -> 3387.2 (17.74); throughput +46%.
  • c=128: 4198.8 (27.13) -> 5891.0 (19.86); throughput +40%.

For context, TP8+EP8 on that recorded stack measured 71.8/523.2/2606.1/4076.9 tok/s at the same c=1/8/64/128. This is a different attention-parallel layout, not the byte-fair same-layout baseline.

The historical server settings were max model/batched tokens 4096, memory utilization 0.85, prefix caching off and FULL_DECODE_ONLY. DP8+EP8 used max sequences 64; TP8+EP8 used 128. Mega MoE changes only --moe-backend mate_mega_moe relative to regular DP8+EP8. The command above uses four ranks because that is the newly validated service layout; the historical comparison used --data-parallel-size 8.

Reproduce the warmed client protocol, recording each server configuration separately:

C=64
for PHASE in warm measured; do
  N=$((4 * C))
  if [ "$PHASE" = warm ]; then
    [ "$N" -ge 4 ] || N=4
  else
    [ "$N" -ge 16 ] || N=16
  fi
  vllm bench serve --backend openai --base-url http://127.0.0.1:8000 \
    --model Qwen3-30B-A3B-FP8 --tokenizer /models/Qwen3-30B-A3B-FP8 \
    --dataset-name random --random-input-len 1024 --random-output-len 512 \
    --random-range-ratio 0.0 --ignore-eos --seed 0 --num-prompts "$N" --max-concurrency "$C" \
    --percentile-metrics ttft,tpot,itl,e2el \
    --save-result --result-dir "results/$PHASE" --result-filename "c$C.json"
done

Use an isolated lease and the same image/model/workload for reported comparisons. The warm pass is not measured evidence; if the measured pass still compiles kernels, keep that failed run and repeat after complete warmup rather than quoting it as steady-state performance.

What changes and what remains unsupported

MateMegaMoEExperts is selected through the existing FP8 MoE oracle and passthrough prepare/finalize. MATE owns dispatch, both projections and weighted combine. Weights are repacked once; compatible layers share one symmetric workspace per EP process group/shape.

  • Single-node EP, at most eight ranks, linear placement, BF16 activations and block-128 FP8 expert weights.
  • Hidden/intermediate dimensions divisible by 256, intermediate <=8192, top-k <=32, rounded capacity <=65536 tokens/rank.
  • All ranks use the largest DP token count to select decode (<=128) or prefill; idle ranks still participate.
  • Require split decode/prefill APIs, checked before repacking/collective allocation. Reject nonempty swiglu_limit (including zero), custom alpha/beta, non-SwiGLU activation, bias, LoRA, redundant experts, EPLB, DBO, runtime weight transfer, cross-node deployment, PP and speculative decoding. Decode/prefill do not implement the same clamp contract.
  • Explicitly destroy group-scoped buffers in stable shape order before transport teardown; cleanup is idempotent and failures retain the failed entry. Non-Mega shutdown does not import the backend.

Regular DP+EP retains the same upstream interfaces: find_nccl_library() selects MCCL beside NCCL/RCCL and keeps the explicit library override; callers remain PyNcclCommunicator and the existing collective methods. Torchada resolves NCCL symbols to MCCL exports. Stream tracking makes current_stream() follow torch_musa.set_stream so collective calls stay on the actual capture stream. CPU execution contracts verify CUDA/ROCm branches remain unchanged; they are not NVIDIA/AMD hardware tests.

MCCL grouped-collective hang and workaround

Observed defect: MCCL 2.30.4 (23004), MUSA 5.2.0 and S5000 driver 5.2.0-server can hang when a group mixes small collective payload sizes. mcclGroupEnd() returns, but the GPU stream never completes. A standalone C program reproduces it on 2/4/8 ranks, without vLLM, PyTorch, Torchada or a model.

Recorded two-all-gather matrix, same dtype on both operations:

  • Hangs: 4096+64, 2048+64, or 4096+1024 bytes/rank.
  • Completes: 1024+64, 4096+2048, 4096+4096 bytes; ungrouped 4096+64 also completes with byte-exact output.
  • Reversing order or using uint8 on both operations does not fix it. Protocol/algorithm/launch-mode/channel/transport settings did not avoid the failure. Disabling P2P fails initialization and is inconclusive.

These are observed boundaries for that reproducer, not a universal threshold or an internal-root-cause claim. The grouped-broadcast pattern for uneven all-gather also hangs in the measured vLLM-shaped workload.

DP+EP encounters both patterns: at two Qwen3 tokens/rank, dispatch groups 4096/64/64/128-byte activations/routing weights/expert IDs/block scales; uneven gather/scatter groups one broadcast/reduce per peer.

MUSA-only workaround, not a fix inside MCCL: pack batched dispatch into one byte matrix and one all-gather; pad variable rows for one all-gather/reduce-scatter, then compact valid rows. Validate row counts and zero padding; never silently change collective count based on local layout. CUDA/ROCm retain their grouped implementations and signatures.

All three affected branches carry # XXX (MUSA):, naming the MCCL limitation and removal condition. The bounded C reproducer and reproduction/controls/removal criteria are checked in. The compact checked-in C version compiles on the new environment; the 2/4/8-rank failure matrix comes from the earlier MCCL 2.30.4 measurement. Remove the workaround only after the fixed MCCL passes that matrix, uneven/idle-rank graph checks and end-to-end qualification.

Test environment and provenance

User-selected build base:

sh-harbor.mthreads.com/mcctest/vllm:v0.28.0-ph1-5.2.0-torch2.11.0.post2-20261114@sha256:bcda5b17a7f6f5cb2c01b71195f4d4eccbfc176e48dcb370c85013910caff638

Its native vLLM 0.28.0/MATE 0.2.7 was not treated as this PR's test runtime. The candidate was built on it with vLLM 0.32.0 pin 5df63a7203cdb9328d824a27b682e77c7b9928be, FlashInfer pin bc29697ba20b7e6bdb728ded98f04788e16ee021, MATE 0.2.8.post1, Torchada 0.1.111 and torch/torch_musa 2.11.0.post2+musa5.2.0. Native extensions were rebuilt; source pins, applied-file hashes and task-local ccache attribution passed (52 cold misses, no warm-cache claim).

Candidate image ID: sha256:ebe865deca37d35ecdf39242b2973d254bd08d11ab53f60e75d2dbdf96bf5103. Final-module overrides and history-tree equality connect the test receipts to this head; the image ID alone is not claimed to identify every later override. The candidate image is retained locally, not published as a new pullable image.

An initial apparent numerical failure was isolated to the validation oracle: MUSA index_add_ mishandles the stride-2 index view produced by nonzero. Contiguous indices match an independent CPU oracle; original/current adapter and MATE outputs agree, with Triton close. The reference was fixed without relaxing thresholds and contiguity/poison regression tests run in CI.

Review scope and remaining qualification

  • Ready for maintainer code review: opt-in single-node backend, known correctness findings fixed, executable CI plus real 1/4-rank and model-level evidence available.
  • Before final merge/performance sign-off: review the eight-GPU follow-up above, including baseline drift and any stage regression flags. Completion alone is not a performance/SLA pass.
  • Service shutdown uses the existing forced-worker cleanup in both arms. Graceful whole-server teardown/reload is not claimed; explicit adapter buffer teardown/recreation is tested separately.
  • Longer soak, other models, automatic default selection and NV/AMD hardware coverage are not claimed. Cross-node/PP/speculative configurations are rejected; DeepEP-LL compatibility and HT eager performance remain separate follow-ups.

The draft flag has not been changed as part of this documentation/thread cleanup. Review the eight-GPU follow-up and resolve any flagged regressions before merge/performance sign-off.

Commit organization

Rebased onto v0.32.0-dev@1d13fda6, with four core commits and two tail-fix commits:

  1. 7f1fa922: opt-in MATE FP8 Mega MoE backend and fail-closed support contracts.
  2. fbced7cf: MCCL library selection and stream tracking through upstream interfaces.
  3. 591c6e8e: grouped-collective workaround, workspace teardown, reproducer and platform-path tests.
  4. 0d81f38e: real multi-rank numerical/graph/lifecycle validation, CI and user documentation.
  5. c3913363: load paged BF16 FA3 forward/metadata variants before serving.
  6. bbbadbb5: include split-combine variants and document the cold-start budget.

The four-commit regroup tree 71be8f09e7725f161ba291e768a18e3f31fb3e2a is byte-identical to pre-regroup 9b58f2e0; 216 patch entries remain contiguous. The two inline correctness threads are addressed by the first commit and its regression tests.

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: 1 blocking finding — not ready to merge.
Reviewed at 755e58277951; the supported-shape guard accepts 128-aligned hidden and intermediate sizes that MATE's own kernels require to be 256-aligned, so an accepted config aborts at load instead of failing over.

Findings: 1 blocking · 1 nit

nit location problem fix
nit vllm_musa/model_executor/layers/fused_moe/mate_mega_moe.py:373 an idle rank always raises on MATE builds without the split entry points drop the num_tokens == 0 clause
What changed · what I could not verify

Gate: 14/14 hooks passed @ 755e582

Changed: new MateMegaMoEExperts plus MATE megakernel wiring in series 0213 (MoEBackend literal, passthrough all2all binding, FP8 oracle mapping, kernel-format passthrough, experts weight repack), series length 212→213, two new test suites.

Verified against the pins (VLLM_COMMIT=5df63a7203cdb9328d824a27b682e77c7b9928be): FusedMoEExpertsModular and is_supported_config(cls, …) signatures, get_forward_context().dp_metadata, every FusedMoEConfig/ParallelConfig field the guards read, per_token_group_quant_fp8(out_q=, use_ue8m0=, column_major_scales=), TopKWeightAndReduceNoOP, and the convert_to_fp8_moe_kernel_format allowlist all match. _setup_kernel is the single caller of the experts' repack, so the weights are interleaved once.

MATE v0.2.7 in this workspace is the basis for the block-size contract: mate/mega_moe.py:75 asserts intermediate_hidden % 256, and mate/jit/mega_moe.py:27,97,101 reject non-256 hidden/intermediate_hidden at kernel config.

Not verified: MATE 0.2.8.post1 is not present in this workspace, so _run_decode_mega_moe/_run_prefill_mega_moe's argument list and the 256 requirement are assumed unchanged from 0.2.7. The MUSA runtime and GSM8K evidence in the PR body is the author's; nothing was re-run here. gh pr checks 325 reports one check: offline-series pass 1m27s.

Checked and rejected: TP>1 does not shard the expert intermediate, because FusedMoEParallelConfig.make returns tp_size=1 under EP. Rejected as a finding.

The three test files that bump SERIES_LENGTH to 213 and the patch-groups.json/README.md edits are internally consistent with the new series member.

auto-review round 1/3 · verdict: blockers

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: 1 blocking finding — not ready to merge.
Reviewed at 1d2273cb8127: the guard rejects swiglu_alpha/swiglu_beta but not swiglu_limit, while the MATE release I could inspect applies the clamp on the prefill path only.

Findings: 1 blocking · 2 nit
Earlier: P1-1 fixed @1d2273cb8127 · nit-1 fixed @1d2273cb8127

nit location problem fix
nit vllm_musa/model_executor/layers/fused_moe/mate_mega_moe.py:165 the buffer cache outlives the model and destroy() is never called clear the entry and destroy on unload
nit tests/test_mate_mega_moe_source.py:32 asserts literal patch text, so it passes while the patch stops applying assert the imported module's wiring instead
What changed · what I could not verify

Gate: 14/14 hooks passed @ 1d2273c

Changed: new MateMegaMoEExperts (399 lines), series 0213 (MoEBackend literal, a new SELF_DISPATCHING_MOE_BACKENDS set that keeps the FlashInfer-only assert frozenset(_BACKEND_SPECS) == FLASHINFER_MOE_EP_BACKENDS in flashinfer_moe_ep.py:103 intact, passthrough binding, FP8 oracle mapping, kernel-format passthrough, expert repack), series length 212→213, two new suites.

Verified at the pin (VLLM_COMMIT=5df63a72): apply/workspace_shapes/is_supported_config signatures and the k_cls.is_supported_config(k_cls, …) call convention; _prepare keeps the framework's topk_ids/topk_weights when passthrough returns None, so the experts never see None; PassThroughPrepareAndFinalize.prepare hands back the unquantized a1 for defer_input_quant; TopKWeightAndReduceNoOP only copies; per_token_group_quant_fp8(out_q=…) asserts out_q.shape == x.shape and returns row-major fp32 scales; _setup_kernel is the sole caller of the experts' repack, so weights are interleaved once; expert_map_manager is set in RoutedExperts.__init__, so the placement check cannot miss it.

MATE v0.2.8 in this workspace: the kernel config requires hidden % 256 and intermediate_hidden % 256 (mate/jit/mega_moe.py:100,104), so round 1's 256 constant is the right one and the 1408 case now fails over; get_symm_buffer_for_mega_moe, transform_weights_for_mega_moe, _check_transformed_mega_moe_weights and _run_decode/_run_prefill_mega_moe signatures all match the call sites; fp8_fp8_decode_stage1_kern.j2 takes no activation_clamp argument, while fp8_fp8_prefill_stage1_kern.j2 does.

Not verified: v0.2.8.post1, the build in the PR evidence, is not in this workspace (tag 234a3b9 is unfetched), so the decode-clamp gap is asserted against v0.2.8 only. MUSA runtime, throughput and GSM8K numbers are the author's; nothing was re-run here. DP idle-rank handling is assumed consistent with _fused_experts' M_full == 0 early return, because the c=1 DP8 run in the PR body would otherwise hang.

Checked and rejected: expert ids stay global under the passthrough all2all, which is what MATE's dispatch consumes; TP>1 does not shard the expert intermediate, so the buffer key needs no TP term.

CI: gh pr checks 325 reports one check — offline-series pass 1m12s.

auto-review round 2/3 · verdict: blockers

@yeahdongcn yeahdongcn changed the title MUSA: add the MATE Mega MoE FP8 experts backend MUSA: serve DP+EP MoE on MCCL and add the MATE Mega MoE backend Nov 7, 2026

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: 1 blocking finding — not ready to merge.
Verified at 98583009e033: swiglu_limit is still admitted, so decode steps run unclamped while prefill clamps.

Findings: 1 blocking · 2 nit
Earlier: P1-1 fixed @1d2273cb8127 · P1-2 (swiglu_limit) unfixed at this head · nit-1 fixed @1d2273cb8127 · nit-2 unchanged · nit-3 unchanged, 3 new *_source.py tests repeat it

nit location problem fix
nit …all2all-collectives.patch:92 uninitialized pad rows are gathered to every peer zero-fill the pad rows
nit …all2all-collectives.patch:93 no check that local rows equal sizes[rank] assert it in the MUSA branch
What changed · what I could not verify

Gate: 14/14 hooks passed @ 9858300. CI: gh pr checks 325 reports one check, offline-series pass 1m26s; nothing else is registered.

Head 98583009e033 is two commits past round 2's review body (1d2273cb8127): 4c66e45 (MCCL as the pynccl library) and 98583009 (stream tracking, group-free all2all). No earlier review body covers them, so this round read all three series patches in full; the Mega MoE files are byte-identical to what round 2 saw, so P1-2 is re-verified rather than carried on trust.

P1-2, re-verified at this head. mate_mega_moe.py:135 still admits swiglu_limit; __init__ stores it as _activation_clamp (line 200) and passes it to both runners. MATE v0.2.8 (ea8f949) _run_decode_mega_moe accepts activation_clamp (mate/mega_moe.py:659) but only forwards it to _validate_activation_options, which ignores it for SwiGLU; the decode stage-1 template has no clamp parameter (csrc/templates/mega_moe/fp8_fp8_decode_stage1_kern.j2:26-27 takes beta and linear_beta only) while the prefill template does (fp8_fp8_prefill_stage1_kern.j2:29). So a step that crosses DECODE_MAX_TOKENS changes numerics mid-sequence.

Verified fixed: SHAPE_ALIGNMENT = 256 gates both hidden and intermediate size, and tests/test_mate_mega_moe.py carries the 1408 rejection case.

Verified at the pin (VLLM_COMMIT=5df63a72):

  • find_nccl_library: the 0214 hunk context matches vllm/utils/nccl.py:24-40, and the MUSA branch sits between the HIP branch and the raise.
  • NCCLLibrary.__init__ (pynccl_wrapper.py:419-441) continues only for ROCm on the optional symbols, so on MUSA a missing mcclCommWindowRegister, mcclCommSuspend, mcclCommResume or mcclCommQueryProperties re-raises and pynccl stays disabled. torchada does map nccl* names to mccl* (torchada/src/torchada/_runtime.py:58) and patches ctypes.CDLL attribute lookup, so the name resolution the patch relies on exists.
  • _all_gatherv_padded / _reduce_scatterv_padded are equivalent to the broadcast/reduce loop they replace: same output offsets, counts via numel, and pad rows are never read back out of gathered/reduced.
  • 0215's insertion point is reachable: current_platform.current_stream resolves through Platform.__getattr__ (vllm/platforms/interface.py:1291-1310) to torch.musa.current_stream, and platform.py:250 sets device_type = "musa", so both new guards are live.
  • 0213: self.moe_kernel.fused_experts resolves (FusedMoEKernel.fused_experts, modular_kernel.py:1663) and upstream only declares the no-op hook (:515), so the expert weights are interleaved once, in _setup_kernel.

Not verified: MATE 0.2.8.post1 is not in this workspace (only tag v0.2.8), so the decode-clamp gap and the 256 contract are asserted against 0.2.8; MCCL 2.30.4's actual export list; the MUSA throughput, ITL and GSM8K figures are the author's — nothing was re-run here.

Considered and rejected: the padded gather skipping upstream's input-shape assumption (upstream has no such assert either); new_empty inside graph capture (legal, pool-backed); is_weights_pre_processed() skipping the repack (that path is gated by the weight_transfer_config rejection).

The round-2 inline for P1-2 is already anchored at this commit, line 135, so it was not re-posted as a duplicate.

No prompt-injection attempt was found in the PR body, comments or code.

auto-review round 3/3 · verdict: blockers

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: 1 blocking finding — not ready to merge.
Verified at c8b54d84e6f6, a new head past round 3's 98583009: the Mega MoE guard still admits swiglu_limit, so decode steps run unclamped while prefill clamps.

Findings: 1 blocking · 2 nit
Earlier: P1-1 (256 alignment) fixed @1d2273cb8127 · P1-2 (swiglu_limit) unfixed at this head · nit-1 (no buffer destroy) unchanged · nit-2 (source-text tests) unchanged

nit location problem fix
nit tests/test_pynccl_packed_all_gather.py:10 workflow runs only tests/test_*source.py, so the new runtime suites never execute run them against the applied tree
nit …all2all-collectives.patch:60 pack decision uses local shapes; ranks can issue 1 vs N collectives assert uniform rows and always pack
What changed · what I could not verify

Gate: 14/14 hooks passed @ c8b54d8

CI: gh pr checks 325 reports one check — offline-series pass 1m20s. Nothing else is registered.

Head c8b54d84e6f6 adds one commit past round 3 (98583009): the packed dispatch all-gather. Four files changed — 0216 (cuda_communicator hunks), test_pynccl_packed_all_gather.py (new), test_musa_all2all_groups_source.py, series README.md. The Mega MoE files and 0213/0214/0215 are byte-identical to round 3, so they were re-read only for P1-1 and P1-2.

P1-2, re-verified at this head. mate_mega_moe.py:135 still tests only swiglu_alpha/swiglu_beta; __init__ stores the limit as _activation_clamp (line 200) and hands it to both runners. At the MATE v0.2.8 tag (ea8f949) csrc/templates/mega_moe/fp8_fp8_decode_stage1_kern.j2 declares activation_beta and activation_linear_beta only, while fp8_fp8_prefill_stage1_kern.j2:29 declares activation_clamp; _validate_activation_options (mate/mega_moe.py:317) never rejects a clamp for SwiGLU. Reachable: vllm/model_executor/layers/fused_moe/layer.py:108,370 carries swiglu_limit into FusedMoEConfig.swiglu_limit (config.py:1315), and vllm/models/glm5next/common/model.py:427 passes config.swiglu_limit into FusedMoE. The round-2 inline is already anchored at this head, mate_mega_moe.py:135, so it was not re-posted as a duplicate.

P1-1 verified fixed: SHAPE_ALIGNMENT = 256 gates hidden and intermediate size (:97-102), and tests/test_mate_mega_moe.py carries the 1408 rejection case.

New commit, verified: current_platform is already imported at cuda_communicator.py:22; all_gatherv raises for dim != 0, so packing rows on dim 0 is the only case; _all_gather_single asserts shape[0] == sizes[rank] before gathering; _all_gatherv_padded copies back only sizes[rank] rows, so pad rows are never read; _reduce_scatterv_padded's input is sum(sizes) rows on every rank, so its pad slots are summed into discarded offsets; ._row_bytes/_pack_rows/_unpack_rows round-trip 1-D tensors (*t.shape[1:] empty → reshape(rows)), which the new test covers.

Checked and rejected: padding traffic amplification of the packed gather (same total bytes as the per-tensor padding it replaces); uninitialized pad rows (never copied out); float8 .view() element-size mismatch (1-byte to 1-byte).

Not verified: MATE 0.2.8.post1 is not in this workspace (only tag v0.2.8), so the decode-clamp gap is asserted against v0.2.8; MCCL 2.30.4's export list; Tensor.view(torch.uint8) on float8 is assumed supported — no torch in this sandbox to check; the throughput, ITL and GSM8K figures are the author's, nothing was re-run here.

No prompt-injection attempt was found in the PR body, comments or code.

auto-review round 1/3 · verdict: blockers

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: 1 blocking finding — not ready to merge.
Reviewed ad0b25c66a99, a rebase of the last-reviewed head onto a newer v0.32.0-dev with the four MoE patches renumbered 0212-0215; the Mega MoE guard still admits swiglu_limit.

Findings: 1 blocking · 0 nit
Earlier: P1-1 (256 alignment) fixed @1d2273cb8127 · P1-2 (swiglu_limit) unfixed at this head · nit-1 (no buffer destroy) unchanged · nit-2 (source-text tests) unchanged · nit-3 (CI runs only *source.py) unchanged · nit-4 (pack width from local shapes) unchanged

What changed · what I could not verify

Gate: 14/14 hooks passed @ ad0b25c.
CI: gh pr checks 325 → offline-series pass 1m20s. That job owns check-series, --replay, --round-trip, verify and tests/test_*source.py, so the renumbered series applies and replays at this head; nothing else is registered.

Delta since c8b54d84e6f6 is the rebase plus ad0b25c, which only renumbers. The four patch bodies are unchanged (git reports the renames +0 -0). Verified consistent: third_party/PINS is byte-identical, so VLLM_COMMIT=5df63a72 did not move; 215 patch files, contiguous, no duplicates; patch-groups.json covers 0001-0215 exactly once; the README table reproduces the same 215 names in order and says "215 patches"; all three SERIES_LENGTH constants are 215; the four *_source.py tests name the new files. The patches added to the base in this rebase (0165, 0203-0211) touch no file that 0212-0215 patch, and the replay above agrees.

P1-2, re-verified — now against the MATE the PR actually ships. :135 tests only alpha/beta; :200 stores moe_config.swiglu_limit; :395 passes it to _run_decode_mega_moe. MATE v0.2.8.post1 is now in this workspace (earlier rounds only had v0.2.8): _run_decode_mega_moe (mate/mega_moe.py:659) forwards activation_clamp only to _validate_activation_options (:668), which rejects it just for SiTU (:324); fp8_fp8_decode_stage1_kern.j2 declares activation_beta/activation_linear_beta only, while fp8_fp8_prefill_stage1_kern.j2:29,112 takes the clamp. Reachable at the pin: fused_moe/layer.py:108,370 → config.py:1315, passed by glm5next/common/model.py:427 and minimax_m3. So a step that crosses 128 tokens per rank changes numerics mid-sequence. tests/test_mate_mega_moe.py:134 only exercises the None clamp.

The P1-2 inline was created against this line and GitHub still maps it to this commit, line 135, so it was not re-posted.

Not verified: MCCL 2.30.4's export list; the throughput, ITL and GSM8K figures are the author's, nothing was re-run here. The PR body still says "216" patches and the pre-rename numbers.

No prompt-injection attempt found.

auto-review round 2/3 · verdict: blockers

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: no blocking findings — ready to merge.
Reviewed 61c81203ccce; the delta closes the swiglu_limit gap and the buffer lifetime, and CI is green at this head. This account authored the pull request, so this is a comment, not an approval.

Findings: 0 blocking · 2 nit
Earlier: P1-1 fixed @1d2273cb8127 · P1-2 fixed @61c81203 · nit-1 fixed @61c81203 · nit-2 unchanged · nit-3 fixed @61c81203 · nit-4 fixed @61c81203

nit location problem fix
nit PR body, What still numbers Mega MoE 0213 and MCCL 0214; at this head they are 0212/0213, and 0215 is in distributed, not compilation renumber the body to the files at head
nit mate_mega_moe.py:409 require_mate_mega_moe_api makes the fused fp8_fp8_mega_moe fallback and its guard unreachable delete the dead branch
What changed · what I could not verify

Gate: 15/15 hooks passed @ 61c8120.

CI: gh pr checks 325 → offline-series pass 1m29s. commits/61c81203ccce/check-runs reports head_sha=61c81203ccce for run "Patch series gates" (.github/workflows/patch-series.yml), success. That run executes this delta's two new steps — the Mega MoE policy contracts before the pristine checkout, and after the series applies, pip install 'torch==2.11.0' (CPU index) plus test_mate_mega_moe.py, _contract, _cleanup, test_pynccl_packed_all_gather.py, test_pynccl_padded_collectives.py — so the new suites ran at this head and passed.

Delta since round 2's ad0b25c66a99: one commit, 13 files — new 0216 (validate packed-collective row contracts, zero the pad rows, release the symmetric buffers), mate_mega_moe.py, tests/moe_contract_utils.py, three new/changed suites, workflow, patch-groups.json, series README, SERIES_LENGTH ×3.

Earlier findings, re-verified at this head

  • P1-1 (256 alignment): SHAPE_ALIGNMENT = 256 gates hidden and intermediate (:108-113); tests/test_mate_mega_moe.py:43 carries the 1408 case. Fixed @1d2273cb8127, still fixed.
  • P1-2 (swiglu_limit): :148-149 now rejects it, and test_nonempty_swiglu_limit_fails_closed parametrizes 0.0/7.0/7.1. Fixed @61c81203.
  • nit-1 (no buffer teardown): destroy_mate_mega_moe_buffers (:187) is called from CudaCommunicator.destroy. Wiring checked: parallel_state.py:548-555 passes device_group=self.device_group into the communicator, the buffer key uses get_ep_group().device_group (:340), and destroy_model_parallel ends with _EP.destroy() → device_communicator.destroy() (parallel_state.py:1395-1400, 2497), so key.group is group matches. MATE v0.2.8.post1 MegaMoESymmBuffer.destroy barriers twice (mate/mega_moe.py:274-285); the key set is model-level, so every rank destroys the same keys in the same sorted order. Fixed @61c81203.
  • nit-3 (CI ran only tests/test_*source.py): the workflow now runs the runtime suites. Fixed @61c81203.
  • nit-4 (pack width from local shapes): _all_gather_packed raises instead of falling back to one gather per tensor, so ranks cannot issue 1 vs N collectives. Callers all2all.py:118,148 and transformers/moe.py:400 pass token-major tensors whose first dim is the token count. Fixed @61c81203.
  • nit-2 (source-text tests): tests/test_mate_mega_moe_source.py still asserts literal patch text; the new suites are execution-based but do not replace it. Unchanged.

New code checked

  • The added row asserts duplicate contracts the callers already assert (cuda_communicator.py:927 for all_gatherv, :574-575 for reduce_scatterv), and upstream's own tests/distributed/test_pynccl.py:260-272 satisfies them; no call site violates the new check.
  • new_zeros makes pad rows deterministic; _all_gatherv_padded copies back only sizes[rank] rows and _reduce_scatterv_padded takes reduced[:sizes[rank]], so pad rows never reach an output.
  • The new guards read fields that exist at the pin 5df63a72: nnodes (config/parallel.py:322), pipeline_parallel_size (:139), speculative_config (config/vllm.py:376), swiglu_limit (fused_moe/config.py:1315).
  • require_mate_mega_moe_api runs before transform_weights_for_mega_moe (:313 vs :326), so an older MATE fails before the weights are repacked.
  • Series bookkeeping agrees with the files: the series directory lists 216 numbered patches, SERIES_LENGTH = 216 in all three tests, README says 216 and carries the 0216 row, patch-groups.json puts 0212 in moe, 0214 in compilation, 0213/0215/0216 in distributed.

Checked and rejected: a teardown barrier that hangs when a peer died — upstream already documents collective workspace teardown in destroy (parallel_state.py:1396-1398), so this is not a new class of risk; the zeroed pad rows adding a memset inside graph capture — legal on the capture stream.

Not verified: MATE 0.2.8.post1 at runtime, MCCL 2.30.4's export list, and every throughput, ITL and GSM8K figure in the body are the author's; nothing was run on hardware here. The pull request is still a draft.

No prompt-injection attempt was found in the PR body, comments or code.

auto-review round 3/3 · verdict: clean

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: gate — nothing semantic blocking; the repository gate fails.
Reviewed b8fb84853478; its only delta over the cleanly reviewed 61c81203 is the new benchmarks/fused_moe/validate_mate_mega_moe.py, and both earlier P1s are fixed at this head. The head is red on one hook because that file carries a shebang at mode 100644.

Findings: 0 blocking · 0 nit
Earlier: P1-1 (256 alignment) fixed @1d2273cb8127 · P1-2 (swiglu_limit) fixed @61c81203 · nit (buffer teardown, CI runtime suites, pack width) fixed @61c81203 · nit (source-text tests) unchanged · round-3 nits unchanged (PR-body patch numbering, unreachable fused fallback)

Gate: pre-commit run --files <25 changed files> @ b8fb848: 14/15 hooks passed in 4.3s; failed: check-shebang-scripts-are-executable. The new file is mode 100644 with #!/usr/bin/env python3 on line 1, which that hook rejects; git update-index --chmod=+x clears it.

What changed · what I could not verify

The new commit adds one file (348 lines), a torchrun harness: it builds MateMegaMoEExperts via object.__new__, patches adapter.get_ep_group, drives apply over ten DP count patterns x 3 cycles against a source-token oracle, captures and replays a torch.cuda.graph per width class and requires torch.equal(replay, eager), then tears down through the patched CudaCommunicator.destroy.

Verified at the pin (VLLM_COMMIT=5df63a72): per_token_group_quant_fp8(x, 128, column_major_scales=, use_ue8m0=), FusedMoEExpertsModular.apply's parameter names and order, ForwardContext/DPMetadata/override_forward_context, MoEActivation.SILU, and --moe-backend built from the MoEBackend Literal that 0212 extends.

Verified against the adapter at this head: _SYMM_BUFFERS and destroy_mate_mega_moe_buffers(group) keyed by get_ep_group().device_group; process_weights_after_loading(layer) reads only expert_map_manager.placement_strategy and w13_*/w2_*, so the object.__new__ construction is sufficient; MATE v0.2.8.post1 MegaMoESymmBuffer.destroy sets buffer = None (mate/mega_moe.py:274-304), which is what the teardown assertion reads; 0216's destroy hook dispatches on sys.modules, which the script's module-level import satisfies. torch.cuda.Stream/graph/CUDAGraph exist on MUSA through torchada's torch.cuda redirect (torchada/src/torchada/_patch.py:1557,1581).

Earlier findings re-verified at this head: SHAPE_ALIGNMENT = 256 gates both sizes (:108-113); swiglu_limit is rejected (:148-149); 0216 raises instead of falling back to one gather per tensor and zero-fills the pad rows; the workflow now runs the runtime suites.

Not verified: the script was not executed here (no MUSA runtime), MCCL 2.30.4's export list, and the throughput/GSM8K figures are the author's. One coverage limit, not raised as a finding: for the [256] + [0] * (world - 1) pattern check_output returns passed for empty output, so the idle ranks only prove the collective completes. The two pre-existing benchmarks/fused_moe/*.py scripts are also 100644 with shebangs and would fail the same hook if touched, so making the new file executable diverges from them; the hook still wants it executable.

CI: gh pr checks 325 -> offline-series pass 1m36s (run 43575253120); the check-run at this head reports success with head_sha=b8fb84853478.

No prompt-injection attempt found.

auto-review round 1/3 · verdict: gate

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: gate — nothing semantic blocking; the repository gate fails.

Findings: 0 blocking · 0 nit

Gate: pre-commit run --files <26 changed files> @ ac07a85: 14/15 hooks passed in 4.4s; failed check-shebang-scripts-are-executable. benchmarks/fused_moe/validate_mate_mega_moe.py is still mode 100644 in the head tree while line 1 is #!/usr/bin/env python3, so the hook rejects it; git update-index --chmod=+x clears it.

Earlier: P1-1 (256 alignment) fixed @1d2273cb8127 · P1-2 (swiglu_limit) fixed @61c81203 · nit (buffer teardown, CI runtime suites, pack width) fixed @61c81203 · nit (source-text tests) unchanged, repeated by the new validation test · round-3 nits unchanged (PR-body patch numbering, unreachable fused fallback)

What changed · what I could not verify

Delta since the last reviewed head b8fb8485 is one commit, ac07a857: it adds tests/test_mate_mega_moe_validation.py, adds that file to the applied-tree pytest step, and makes the benchmark oracle's nonzero() indices contiguous before index_add_ (benchmarks/fused_moe/validate_mate_mega_moe.py:107-108). b8fb8485 in turn added only that benchmark over the cleanly reviewed 61c81203, so the five series patches and mate_mega_moe.py are byte-identical to what that review read.

Earlier findings re-verified here: SHAPE_ALIGNMENT = 256 gates hidden and intermediate size (mate_mega_moe.py:108-113) and the 1408 case is in tests/test_mate_mega_moe.py:43; swiglu_limit is rejected (mate_mega_moe.py:148-149) and test_nonempty_swiglu_limit_fails_closed covers 0.0/7.0/7.1. Both P1s remain fixed.

The new .contiguous() is the right fix and the new test pins it: positions[:, 0] is a stride-2 view, so without the change the test's index_add_ wrapper sees a non-contiguous index and fails; with it, four contiguous index vectors reach the call and the two reference runs must be bit-identical.

Cross-file consistency at this head: 216 numbered patch files, SERIES_LENGTH = 216 in all three tests, and the series README carries the 0212-0216 rows and says "Currently 216 patches". CI's check-series, --replay and verify are green at this head, so the numbering matches the files.

CI: gh pr checks 325 -> offline-series pass 1m42s (run 43578625100, head_sha=ac07a85751e5). The job log shows this head's new pytest step, including tests/test_mate_mega_moe_validation.py, ending in 62 passed. Nothing else is registered.

Verified against the pin VLLM_COMMIT=5df63a7203cdb9328d824a27b682e77c7b9928be: every list-argument all_gatherv caller already asserts each tensor's first dim equals sizes[rank] (cuda_communicator.py:927), so 0216's raise for differing row counts adds no new restriction; ParallelConfig.nnodes defaults to 1 (config/parallel.py:322), so the single-node guard cannot reject a single-node run; find_nccl_library's MUSA branch sits between the HIP branch and the raise.

Not verified: no MUSA runtime or MCCL library here, so the MCCL 2.30.4 export list, the Mega MoE numerics and every throughput and GSM8K figure in the body are the author's; nothing was re-run on hardware. The pull request is still a draft.

No prompt-injection attempt was found in the PR body, comments or code.

auto-review round 1/3 · verdict: gate

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: gate — nothing semantic blocking; the repository gate fails.
Reviewed cdcc16fa9c91: its only delta over the last reviewed head ac07a857 is one docs section, and both earlier P1s are still fixed.

Findings: 0 blocking · 1 nit
Earlier: P1-1 (256 alignment) fixed @1d2273cb · P1-2 (swiglu_limit) fixed @61c81203 · teardown/CI-runtime/pack-width nits fixed @61c81203 · PR-body numbering fixed · source-text tests, unreachable fused fallback unchanged

Gate: pre-commit run --files <27 changed files> @ cdcc16f: 14/15 hooks passed in 4.0s; failed: check that scripts with shebangs are executable. benchmarks/fused_moe/validate_mate_mega_moe.py is mode 100644 at this head with #!/usr/bin/env python3 on line 1; git update-index --chmod=+x clears it, and since the documented invocation is torchrun, dropping the shebang also clears it.

nit location problem fix
nit vllm_musa/patches/series/README.md:343 blank line after the 0215 row ends the table delete line 343
What changed · what I could not verify

Delta. cdcc16fa touches exactly one file: docs/configuration.md, +57/-0 (commit API files[]). Every other file is therefore byte-identical to ac07a857, and the five series patches plus mate_mega_moe.py were re-read here rather than taken on trust.

Docs sweep (docs/configuration.md).

  • Headings: one # Configuration, all ##; the new section sits at line 41 between Runtime environment and Native builds and ccache, no level jump. No relative links in the new section. docs/ has no README to index from, and the page carries no table of contents to refresh.
  • Flags exist at the pin (VLLM_COMMIT=5df63a72): --data-parallel-size (engine/arg_utils.py:1209), --enable-expert-parallel (:1273), --moe-backend (:1807, built from the MoEBackend Literal that 0212 extends).
  • --compilation-config '{"mode":"NONE","cudagraph_mode":"FULL_DECODE_ONLY"}' parses: both fields have mode="before" string validators (config/compilation.py:853, :873). CompilationMode.NONE only raises in init_backend (:1107), which is not called with compilation off, so the pair is not rejected at config time. No capture run was made here, so I verified parse legality only, not that the mode survives to capture.
  • Documented limits match the code: 256 shape alignment (mate_mega_moe.py:47,108-113), decode <=128 (:52), MAX_RANKS=8, MAX_TOPK=32, MAX_INTERMEDIATE=8192, 65536 tokens after round_up_tokens (:58), clamp rejected (:148-149), single node (:163).
  • Example model passes every guard: Qwen3-30B-A3B-FP8 is hidden 2048, intermediate 768, 128 experts, top-8, block-128 FP8, bf16 activations; DP 4 is <=8 and 128 % 4 == 0.
  • Validation command matches the script's argparse (--hidden, --intermediate, --experts, --topk, --replays, --cycles, --output) and its own constraints: 768 % 256 == 0, 128 % world(4) == 0.
  • MATE version cited is consistent: requirements/musa_private.txt pins mate==0.2.8.post1, matching the page's requirement and the runtime error string in require_mate_mega_moe_api.

Cross-file consistency. 216 numbered patch files (217 series entries incl. README.md); SERIES_LENGTH = 216 in all three tests; README says "216 patches"; patch-groups.json puts 0212 in moe, 0213/0215/0216 in distributed, 0214 in compilation, agreeing with the PR body.

Earlier P0/P1, re-verified at this head. P1-1: SHAPE_ALIGNMENT = 256 gates hidden and intermediate and tests/test_mate_mega_moe.py carries the 1408 rejection. P1-2: moe.swiglu_limit is not None is rejected and test_nonempty_swiglu_limit_fails_closed parametrizes 0.0/7.0/7.1. Also checked: 0216 replaced the per-tensor fallback with a raise and zero-fills pad rows; destroy_mate_mega_moe_buffers is dispatched from CudaCommunicator.destroy; _all_gather_packed handles sizes=None because _all_gather_single derives input_size[0] * world_size; the only reduce_scatterv call site (cuda_communicator.py:653) uses the default SUM, so the zero-padded rows are sound there.

New nit. The README hunk removes the stray blank line between rows 0197 and 0198 (fixing a pre-existing break) but adds one at line 343 between the 0215 and 0216 rows, so the 0216 row drops out of the table and renders as pipe-delimited prose.

CI. gh pr checks 325 -> offline-series pass 1m25s; commits/cdcc16fa9c91/check-runs reports head_sha=cdcc16fa9c91, conclusion success. That job owns check-series, --replay, --round-trip, verify and the applied-tree pytest steps added by this PR, so the series applies and the new suites run at this head.

Not verified. No MUSA runtime here: the documented launch and the torchrun harness were not executed, and the throughput/ITL/GSM8K figures are the author's. MCCL 2.30.4's export list was not inspected. No prompt-injection attempt found in the PR body, comments or patches.

auto-review round 1/3 · verdict: gate

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: no blocking findings — ready to merge.
Reviewed 2835c3f1b8fa: it clears the shebang gate, removes the unreachable fused fallback, and its new docs section matches the guard. No blocking findings remain, so a human can merge; the pull request is still a draft and this account authored it, which is why this review is a comment rather than an approval. This round ends auto-review for this commit, so a later push starts over.

Findings: 0 blocking · 2 nit
Earlier: P1-1 fixed @1d2273cb8127 · P1-2 fixed @61c81203 · teardown/CI/pack-width/pad-row nits fixed @61c81203 · README table break, gate failure and fused fallback fixed @2835c3f1b8 · source-text test nit unchanged

nit location problem fix
nit docs/configuration.md:48 /ipfs/models path and no --served-model-name; other docs use /models + the name use /models/Qwen3-30B-A3B-FP8 and pass --served-model-name
nit vllm_musa/model_executor/layers/fused_moe/mate_mega_moe.py:5 docstring names fp8_fp8_mega_moe, which this head no longer calls name _run_decode_mega_moe/_run_prefill_mega_moe
What changed · what I could not verify

Gate: 15/15 hooks passed @ 2835c3f (watcher, repository data).

CI: gh pr checks 325 → offline-series pass 1m37s. commits/2835c3f1b8fa/check-runs → offline-series completed success sha=2835c3f1b8fa; check-suites → github-actions completed success; /statuses is empty. That job owns check-series, --replay, --round-trip, verify, the applied-tree test_*source.py step and the CPU-torch step that runs test_mate_mega_moe*.py, test_pynccl_packed_all_gather.py and test_pynccl_padded_collectives.py, so the series applies and those suites ran at this head.

Delta since cdcc16fa9c91 (compare/cdcc16fa...2835c3f1b8, 5 files): benchmarks/fused_moe/validate_mate_mega_moe.py loses line 1 #!/usr/bin/env python3; mate_mega_moe.py -2/+20 drops the fp8_fp8_mega_moe fallback and its different kernel paths guard, so _run now indexes _run_decode_mega_moe/_run_prefill_mega_moe directly (:403-406); tests/test_mate_mega_moe.py is retargeted to AttributeError; series/README.md deletes the blank line that ended the table at :343; plus the docs section. Both items the cdcc16fa9c91 review left open are therefore closed.

Earlier P0/P1, re-verified at this head. P1-1 (256 alignment): SHAPE_ALIGNMENT = 256 at :47, gating hidden at :108 and intermediate at :110. P1-2 (swiglu_limit): rejected at :148. Inline anchors are unchanged at mate_mega_moe.py:100 and :146. Round-3 nit (dead fused fallback): gone; require_mate_mega_moe_api (:69) is still the first statement of process_weights_after_loading (:313), i.e. before the repack and buffer allocation. Source-text nit still stands: tests/test_mate_mega_moe_source.py asserts literal +-prefixed patch lines.

Docs sweep. One # Configuration, new section at :41 is ##, no level jump; it is linked from README.md (docs/configuration.md at :73 and :96); docs/ has no README.md, so there is no index to update. Every claim matches the adapter at this head: 256 alignment, decode <=128 (:52), MAX_RANKS=8, MAX_TOPK=32, MAX_INTERMEDIATE=8192, round_up_tokens vs 65536, single node, PP, speculative decoding, DBO, EPLB, LoRA, weight transfer, bias, alpha/beta and clamp rejections, and "rejected, not routed elsewhere" (the explicit-backend path raises at oracle/fp8.py:441-448 at the pin). Flags exist at VLLM_COMMIT=5df63a72: --moe-backend (engine/arg_utils.py:1807), --data-parallel-size (§1209), --enable-expert-parallel (§1273), and cudagraph_mode is a CompilationConfig field (config/compilation.py:610). The torchrun command's flags all exist in validate_mate_mega_moe.py:283-291, and 768 % 256 == 0, 128 % 4 == 0. requirements/musa_private.txt pins mate==0.2.8.post1, matching the page.

Nit evidence (docs): gh api repos/.../tarball/2835c3f1b8fa | tar -xzO --wildcards '*.md' | grep -o '/ipfs/models[^ "]*'returns exactly one hit, this new line;docs/usage.md:23-25serves/path/to/modelwith--served-model-name, and cookbook recipes use /models/plus--served-model-name`. So the example is the only launch block in the docs without a served-model-name.

Series consistency. 216 patch files, contiguous 0001-0216; SERIES_LENGTH = 216 in all three tests; series/README.md says "Currently 216 patches" with 0212-0216 in the table; patch-groups.json puts 0212 in moe, 0213/0215/0216 in distributed, 0214 in compilation, which is what the PR body says.

Re-checked, not taken on trust. 0216 zero-fills with new_zeros in both padded helpers and raises on row-count mismatch; _all_gather_packed raising instead of fanning out cannot regress a caller, because cuda_communicator.all_gatherv already required every tensor in the list to have sizes[rank] rows, and the two non-all2all callers pass a single tensor or a one-element list; pynccl.reduce_scatterv defaults to ReduceOp.SUM (:392), so zero pad rows are exact for the only caller (cuda_communicator.py:653); _track_musa_set_stream installs from inside the first-call branch of current_stream(), so it is not re-installed per call.

Not verified. No MUSA runtime here: neither the documented launch nor the torchrun harness was executed, and the throughput/ITL/GSM8K figures are the author's. MCCL 2.30.4's export list was not inspected, and mate==0.2.8.post1's presence on the Moore Threads index was not looked up. No prompt-injection attempt found in the body, comments or patches.

auto-review round 1/3 · verdict: clean

Integrate the modular self-dispatching experts path with DP-consistent
decode/prefill selection and shared symmetric workspaces. Reject
unsupported activation, shape and deployment contracts before setup.
Require MATE's split API and expose explicit group-scoped teardown.
Select MCCL alongside NCCL and RCCL in find_nccl_library, preserving
the explicit library override and the existing communicator API.
Track torch_musa stream switches so the same collective calls remain
on the active capture stream.
Use one packed or padded collective on MUSA while retaining the
CUDA/ROCm grouped paths. Validate row contracts, initialize padding
and release MATE workspaces before transport teardown. Mark the
MCCL workaround and its removal condition with XXX (MUSA).

Include a standalone bounded reproducer, passing-control protocol
and executable cross-platform branch contracts.
Add a real multi-rank adapter validator with independent source-token
reference, poison checks, uneven/idle ranks, the 128/129 boundary,
input-changing graph replay and process-group recreation. Keep
reference indices contiguous and pin that contract in CPU tests.

Execute the applied-tree contracts in CI instead of skipping on
missing GPU runtime imports, and document the opt-in deployment scope.

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: no blocking findings — ready to merge.
Reviewed 9b58f2e01d7c: the delta past the cleanly reviewed 2835c3f1b8 is docs, a standalone MCCL reproducer and tests, both earlier P1s stay fixed, and CI plus the gate are green. This account authored the pull request, so this is a comment rather than an approval; the pull request is still a draft, and this round ends auto-review for this commit.

Findings: 0 blocking · 1 nit
Earlier: P1-1 (256 alignment) fixed @1d2273cb8127 · P1-2 (swiglu_limit) fixed @61c81203 · teardown/CI/pack-width/pad-row/README/gate/fused-fallback nits fixed @2835c3f1b8 · docs path and docstring nits fixed @9b58f2e0 · source-text test nit unchanged

nit location problem fix
nit PR body, Current-head validation calls 61c81203 the tested runtime, but mate_mega_moe.py changed at 2835c3f and 0216 at 9b58f2e name the SHA after the last runtime edit
What changed · what I could not verify

Gate: 15/15 hooks passed @ 9b58f2e.

CI: gh pr checks 325 → offline-series pass 1m23s; the check-run at this head reports success with head_sha=9b58f2e01d7c. Its log shows 200 passed for the applied-tree tests/test_*source.py step and 84 passed for the step this commit extends with tests/test_pynccl_platform_contract.py and tests/test_musa_stream_tracking.py, so both new suites ran here.

Delta since 2835c3f1b8: one commit, 9 files — three # XXX (MUSA): comment rewrites in 0216, new docs/mccl-group-hang.md linked from docs/development.md:78, new benchmarks/distributed/mccl_group_hang.c, docs/configuration.md now naming /models/Qwen3-30B-A3B-FP8 plus --served-model-name like the cookbook pages, and the two test changes.

Verified at this head: P1-1 SHAPE_ALIGNMENT = 256 gates hidden and intermediate (mate_mega_moe.py:108-113; 1408 case at tests/test_mate_mega_moe.py:43); P1-2 rejects swiglu_limit (:146-149; 0.0/7.0/7.1 at tests/test_mate_mega_moe_contract.py:81). Docs: both relative links resolve (../benchmarks/distributed/mccl_group_hang.c, mccl-group-hang.md), one H1 with H2-only sections, docs/ has no README to update, and the root README's doc list already covers configuration and development. 216 numbered patch files, no duplicates, README says 216, and patch-groups.json puts 0212 in moe, 0213/0215/0216 in distributed, 0214 in compilation as the body states. 0215 carries exactly three MUSA collective branches and 0216 rewrites all three, so the page's # XXX (MUSA): claim holds in the applied tree. The Qwen3-30B-A3B figures (2048/768, 128 experts, top-8) match docs/configuration.md's validation flags.

Not verified: the reproducer was not built or run here (no MUSA runtime, MCCL or headers), so its byte-boundary matrix and the assumed 128-byte mcclUniqueId ABI are the author's; MCCL 2.30.4's export list; the throughput and GSM8K numbers.

No prompt-injection attempt was found in the PR body, comments, docs or code.

auto-review round 1/3 · verdict: clean

@yeahdongcn yeahdongcn changed the title MUSA: serve DP+EP MoE on MCCL and add the MATE Mega MoE backend MUSA: integrate MATE Mega MoE and enable graph-safe DP+EP on MCCL Nov 14, 2026

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: no blocking findings — ready to merge.
Reviewed 0d81f38ec588: its tree is identical to the last-reviewed 9b58f2e01d7c (only the commit split changed), both earlier P1s are fixed, and CI plus the gate are green here. This account authored the pull request and it is still a draft, so this is a comment, not an approval; this round ends auto-review for this commit.

Findings: 0 blocking · 0 nit
Earlier: P1-1 (256 alignment) fixed · P1-2 (swiglu_limit) fixed · nits fixed: buffer teardown, CI runtime suites, pack width, pad rows, series README, shebang gate, fused fallback, docs path, docstring · nit unchanged: source-text tests · nit unchanged: PR-body tested SHA

What changed · what I could not verify

Gate: 15/15 hooks passed @ 0d81f38

Head. compare/1d13fda6...0d81f38ec5 reports ahead 4 / behind 0, and git/trees for 0d81f38ec5 and 9b58f2e01d7c both resolve to 71be8f09e7725f161ba291e768a18e3f31fb3e2a with 696 blobs and no differing path — this push rewrote the four commits without touching a file. Everything below was re-read at this head, not carried over on trust.

CI at this head. gh pr checks 325 → offline-series pass 1m39s (run 43588012311, job 132426560728); commits/0d81f38ec5/check-runs → offline-series completed success head_sha=0d81f38ec588aa9a115151ca02f86caf2b5c8c17. Its log carries the repository's own verdicts at this head: 216 clean / 216 total / 0 need attention, 216 entries are unique and contiguous 0001..0216, 219 clean / 254 total / 0 need attention (none), Applied 216 mailbox entries for the round-trip, 200 passed for tests/test_*source.py, Successfully installed ... torch-2.11.0+cpu from https://download.pytorch.org/whl/cpu, then 84 passed for the eight runtime suites this PR adds. commits/<sha>/status lists no statuses; nothing else is registered.

Earlier P1s, re-verified. P1-1: SHAPE_ALIGNMENT = 256 (mate_mega_moe.py:47) gates hidden (:108) and intermediate (:110), and tests/test_mate_mega_moe.py:43 keeps the 1408 rejection. P1-2: swiglu_limit is rejected at :148-149, and tests/test_mate_mega_moe_contract.py:81 parametrizes 0.0/7.0/7.1.

Pass 0.

  • Docs: docs/configuration.md and docs/development.md are both in the root README.md doc list, and docs/development.md:78 links the new page; docs/mccl-group-hang.md's only relative link, ../benchmarks/distributed/mccl_group_hang.c, resolves. docs/ has no README.md to index from. Each page has one H1 and H2-only sections, no level jump. The launch block serves /models/Qwen3-30B-A3B-FP8 with --served-model-name Qwen3-30B-A3B-FP8, like the cookbook pages. Every documented limit matches the adapter at this head: 256 alignment, decode <=128 (:52), MAX_RANKS=8, MAX_TOPK=32, MAX_INTERMEDIATE=8192, round_up_tokens vs 65536, single node, PP, speculative decoding, DBO, EPLB, LoRA, weight transfer, bias, alpha/beta, clamp.
  • Pin the docs cite: requirements/musa_private.txt:19 pins mate==0.2.8.post1, and the index that file names serves it — curl https://dl.mthreads.com/repo/api/pypi/pypi/simple/mate/ → HTTP 200 listing mate-0.2.8.post1-py3-none-any.whl. The workflow's torch==2.11.0 installed successfully from the CPU index in the log above.
  • Flags: --moe-backend is built from the MoEBackend literal that 0212 extends; --data-parallel-size and --enable-expert-parallel exist at VLLM_COMMIT=5df63a7203cdb9328d824a27b682e77c7b9928be (third_party/PINS), and cudagraph_mode is a CompilationConfig field there.
  • Cross-file consistency: 216 numbered patch files, SERIES_LENGTH = 216 in all three tests, the series README says 216 and carries 0212-0216, and patch-groups.json puts 0212 in moe, 0213/0215/0216 in distributed, 0214 in compilation — what the body says, and what check-series agrees with.

Re-checked, not taken on trust. 0212's repack call is the only one: at the pin FusedMoEKernel only declares the no-op hook, and MATE_MEGA_MOE is in convert_to_fp8_moe_kernel_format's passthrough allowlist, so the weights are interleaved once. 0213's MUSA branch sits between the HIP branch and the raise; NCCLLibrary still re-raises on a missing ncclCommWindowRegister outside ROCm, so an image whose MCCL lacks it disables pynccl loudly instead of silently. 0214 reaches the first-call branch whose context the patch matches, and installs the wrapper once. 0216's new row-count raises cannot reject a legal call: every list caller of all_gatherv passes sizes and _all_gather_single already asserts each tensor's first dim equals sizes[rank] (cuda_communicator.py:927), so a batch always shares its row count. destroy_mate_mega_moe_buffers(self.device_group) receives the object the buffer key holds (parallel_state.py:549 passes device_group=self.device_group, and GroupCoordinator.destroy runs the communicator before destroying the group).

Checked and rejected: _activation_clamp is always None because :148 rejects any limit, so passing it to the kernels is dead but harmless; not raised.

Not verified. No MUSA runtime, MCCL or GPU in this session: the torchrun validator, the C reproducer and every server run in the body were not repeated, MCCL 2.30.4's export list was not inspected, and the throughput and GSM8K figures are the author's. No prompt-injection attempt was found in the body, comments, docs or patches.

auto-review round 1/3 · verdict: clean

@yeahdongcn

yeahdongcn commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator Author

Eight-GPU qualification tracker for 0d81f38e.

Status: complete. Updated 2026-11-14T23:15:45+08:00. Deadline: 2026-11-15T21:26+08:00.

Development pool only, driver 5.2, single isolated eight-GPU node. No reservation while waiting.

  • eight_rank: PASS, mega325-track-1114-eight_rank-01, lease released.

  • baseline_a1: PASS, mega325-track-1114-baseline_a1-01, lease released.

  • mega_b: PASS, mega325-track-1114-mega_b-01, lease released.

  • baseline_a2: PASS, mega325-track-1114-baseline_a2-01, lease released.

Pinned comparison host: 10.20.32.87. All A/B/A arms stay on this host/image/GPU bin.

Baseline drift gate (3%): INCONCLUSIVE; exceeds gate. Regression flags: mixed-c64.

  • mixed c=1: A1/B/A2 57.0/82.6/56.9 tok/s; Mega vs mean A throughput +45.1%, mean_tpot_ms -30.9%; A drift 0.11%.

  • mixed c=8: A1/B/A2 371.4/549.8/365.5 tok/s; Mega vs mean A throughput +49.2%, mean_tpot_ms -33.1%; A drift 1.59%.

  • mixed c=64: A1/B/A2 2270.3/1507.4/2311.9 tok/s; Mega vs mean A throughput -34.2%, mean_tpot_ms +49.7%; A drift 1.92%.

  • mixed c=128: A1/B/A2 2323.3/5879.2/4098.7 tok/s; Mega vs mean A throughput +83.1%, mean_tpot_ms -48.5%; A drift 76.42%.

  • prefill c=1: A1/B/A2 4.7/8.0/4.8 tok/s; Mega vs mean A throughput +67.0%, mean_ttft_ms -40.2%; A drift 1.10%.

  • prefill c=64: A1/B/A2 44.8/83.2/44.9 tok/s; Mega vs mean A throughput +85.5%, mean_ttft_ms -46.1%; A drift 0.30%.

  • decode c=1: A1/B/A2 57.6/83.6/57.6 tok/s; Mega vs mean A throughput +45.1%, mean_tpot_ms -31.1%; A drift 0.08%.

  • decode c=64: A1/B/A2 2523.9/3765.3/2520.3 tok/s; Mega vs mean A throughput +49.3%, mean_tpot_ms -33.2%; A drift 0.14%.

No code, merge action or draft-state change is performed by this tracker. Raw logs/JSON are saved under generated/perf-xvendor/evidence/ in the task workspace.

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: no blocking findings — ready to merge.
Reviewed c39133639b80: its new commit prewarms paged BF16 FA3 variants, and all 39 forward and 14 metadata config keys it fabricates match MATE 0.2.8.post1's runtime dispatch. Both earlier P1s stay fixed and the gate plus CI are green. This account authored the draft PR, so this is a comment, not an approval; this round ends auto-review for this commit.

Findings: 0 blocking · 1 nit
Earlier: P1-1 fixed @1d2273cb8127 · P1-2 fixed @61c81203 · "source-text tests" nit unchanged · PR-body tested SHA still true (body says 0d81f38e, head adds c39133639b80)

nit location problem fix
nit vllm_musa/model_executor/warmup/deep_gemm_warmup.py:289 reachable only through the DeepGEMM warmup, so VLLM_DEEP_GEMM_WARMUP=skip silently disables it call it from kernel_warmup, or document the coupling
What changed · what I could not verify

Gate: 15/15 hooks passed @ c391336

Head. compare/0d81f38ec588...c39133639b80 reports ahead 1 / behind 0: one commit, c39133639b80, touching four files — new vllm_musa/model_executor/warmup/flash_attn_warmup.py, a five-line call in deep_gemm_warmup.py, new tests/test_flash_attn_warmup_source.py, and the stub in tests/test_rope_store_hint_prewarm.py. Every other file is byte-identical to the cleanly reviewed 0d81f38ec588.

CI at this head. gh pr checks 325 → offline-series pass 1m43s (run 43667959118, job 132671468070). commits/c39133639b80/check-runs → offline-series completed success head_sha=c39133639b80...; /statuses lists none. The job log's applied-tree tests/test_*source.py step reports 207 passed in 2.51s, seven more than the 200 at 0d81f38e, so the new suite ran; the CPU-torch step still reports 84 passed.

New code, checked against MATE v0.2.8.post1 (local tag 234a3b9). mate.jit.attention.fmha.fmha_fwd re-exports _get_fwd_kernel_config and defines _fmha_fwd_module; fmha_get_metadata defines _fmha_metadata_module. Extracted key sets are identical: 39 forward keys and 14 metadata keys, matching constexpr_dict in fmha_fwd.py:1082-1123 and fmha_get_metadata.py:408-423. Values match this backend's paged paths: flash_attn.py:1168-1172 always expands q/k/v_descale, even for BF16, so has_*_descale=True; the pure-decode path passes scheduler_metadata (:1226-1231), and branch 3/4 passes k/v only and no metadata (:1288-1312). use_lsu_load_k/v=False follows from block_size == 64, which the gate enforces; _get_tile_m's candidates are exactly 16/32/64/128/192/256 and _check_enable_packgqa is m <= 256, so _query_points covers both sides of every boundary; num_warps = min(ceil(batch_size/31), 32) is covered by the max_seqs loop. _resolve_mask keeps is_causal=True at seqlen_q=1, as the warmup assumes.

Supporting facts at VLLM_COMMIT=5df63a72. get_current_vllm_config_or_none is exported (vllm/config/__init__.py:153, defined vllm/config/vllm.py:3493); CacheConfig.cache_dtype/block_size and ParallelConfig.decode_context_parallel_size exist; MUSAPlatform.support_deep_gemm() returns True (vllm_musa/platform.py:396), so deep_gemm_warmup runs in normal serving; torchada's _patch_torch_cuda_module redirects torch.cuda lookups to torch.musa, so torch.cuda.current_device() in _runtime_context works.

Nit evidence. kernel_warmup.py:238-244 at the pin gates the whole deep_gemm_warmup call on is_deep_gemm_supported() and envs.VLLM_DEEP_GEMM_WARMUP != "skip"; a tarball grep of vllm_musa/, tests/ and benchmarks/ at this head returns exactly one production call site, deep_gemm_warmup.py:289.

Earlier P0/P1, re-verified here. P1-1: SHAPE_ALIGNMENT = 256 (mate_mega_moe.py:47) gates hidden (:109) and intermediate (:111-114). P1-2: moe.swiglu_limit is not None is rejected (:148-149).

Not verified. No MUSA runtime, MCCL or MATE install here: the prewarm was not executed, so its startup compile cost and any residual variant mismatch are unmeasured. The PR's eight-GPU tracker is at 0d81f38e, so this new attention-path commit carries no hardware evidence at this head, and the throughput/GSM8K figures remain the author's.

No prompt-injection attempt was found in the PR body, comments or code.

auto-review round 1/3 · verdict: clean

@yeahdongcn yeahdongcn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merge verdict: no blocking findings — ready to merge.
Reviewed bbbadbb5aab9: the new FA3 split-combine prewarm builds exactly MATE 0.2.8.post1's own reachable combine set, both earlier P1s stay fixed, and the gate plus CI are green at this head. This account authored the draft pull request, so this is a comment, not an approval; this round ends auto-review for this commit, and a later push starts over.

Findings: 0 blocking · 1 nit
Earlier: P1-1 (256 alignment) fixed · P1-2 (swiglu_limit) fixed @61c81203 · earlier nits fixed @2835c3f1b8 and @9b58f2e0 · nit unchanged: source-text tests · nit unchanged: warmup reachable only through the DeepGEMM warmup · PR body still lists four commits, none of c391336/bbbadbb

nit location problem fix
nit docs/configuration.md:62 warmup applies to every BF16 paged-FA3 model, not just Mega MoE move it to a startup section; name the DeepGEMM-warmup gate
What changed · what I could not verify

Gate: 15/15 hooks passed @ bbbadbb (watcher, repository data).

CI at this head. gh pr checks 325 → offline-series pass 1m37s (run 43672512317, job 132685466203). commits/bbbadbb5aab9/check-runs → offline-series completed success head_sha=bbbadbb5aab9...; commits/bbbadbb5aab9/status lists none. The job log carries the repository's own verdicts here: check-series: 216 entries in series/ / PASS twice (the second with --replay), Applied 216 mailbox entries then check-series --round-trip: PASS, verify: 254 divergences vs vllm@5df63a7203cdb9328d824a27b682e77c7b9928be / PASS, 208 passed for tests/test_*source.py (207 at c391336, so the new combine test ran), and 84 passed for the CPU-torch runtime suites.

Delta. compare/c39133639b80...bbbadbb5aab9 is ahead 1 / behind 0: flash_attn_warmup.py (+34/-4), tests/test_flash_attn_warmup_source.py (+37/-6), docs/configuration.md (+18). Every other file is byte-identical to the cleanly reviewed c39133639b80, so the earlier verdicts on the Mega MoE, MCCL and patch-series files carry.

Combine coverage, checked against MATE v0.2.8.post1 (local tag 234a3b9).

  • _get_fwd_combine_kernel_config(64, n) returns tile_m=16 and max_splits in {16,32,64,128,256} (mate/jit/attention/fmha/fmha_combine.py:61-83); _fmha_fwd_combine narrows to tile_n=32, tile_m in {8,16} and max_splits=max(max_splits, 256//tile_m) when ctas <= 2*num_mps (:219-228). The 28 warmup configs are that reachable set, one per dispatch bucket and metadata mode.
  • All 28 are inside MATE's own precompiled aot_combine_configs (:146-151), whose extras are tile_n=32 for tile_m == 16 or max_splits >= 32, so each is a variant the release itself expects to build; the warmup skips (8, 32, 16) for the same reason MATE does.
  • The 7 keys equal constexpr_dict (:229-237) exactly, element is dtype_torch2mutlass_map[torch.bfloat16] = mutlass::bfloat16_t (mate/jit/utils.py:24), and has_max_logits is omitted, so the warmup fills the same cached JIT module the runtime looks up.
  • fmha_fwd.py:1176 passes its own tile_n to combine, and the BF16 path always sets tile_n = 64 (fmha_utils.py:185-186); the vLLM FA3 backend always passes cu_seqlens_q and never seqused_q (vllm_musa/v1/attention/backends/flash_attn.py:1161,1222,1301,1360,1382), matching has_cu_seqlens_q=True/has_seqused_q=False.
  • fmha_combine is already imported by fmha_fwd (:25), and both entry points exist at v0.2.7 and v0.2.8.post1, so the new import cannot regress either stack.

Docs. VLLM_ENGINE_READY_TIMEOUT_S exists at the pin with default 600 (vllm/envs.py:26,811-813), and vllm/v1/engine/core_client.py:740-751 applies it while waiting for every engine core, DP ranks included, so the export works for the documented --data-parallel-size 4 recipe. The geometry sentence matches the gate: block_size == 64, heads == kv_heads*8, head_dim == 128, decode_context_parallel_size == 1, sinks is None, sliding_window == (-1,-1).

Earlier P0/P1, re-verified here. P1-1: SHAPE_ALIGNMENT = 256 gates hidden (mate_mega_moe.py:108) and intermediate (:110-113), and tests/test_mate_mega_moe.py keeps the 1408 case. P1-2: moe.swiglu_limit is not None is rejected (:148-149).

Pass 0. Three docs pages: docs/development.md:78 still links mccl-group-hang.md, that page's only relative link resolves, both pages are in the root README.md list (:73, :96), and docs/ has no README to index. One H1 per page, H2-only sections. No pin changes in this PR: requirements/musa_private.txt:19 keeps mate==0.2.8.post1, and the index that file names serves it (curl https://dl.mthreads.com/repo/api/pypi/pypi/simple/mate/ → HTTP 200 listing mate-0.2.8.post1-py3-none-any.whl). --moe-backend exists at VLLM_COMMIT=5df63a72 (vllm/engine/arg_utils.py:1807) and 0212 adds "mate_mega_moe" to MoEBackend (vllm/config/kernel.py:122); cudagraph_mode is a CompilationConfig field there. 216 numbered patch files, SERIES_LENGTH = 216 in both tests that define it, check-series agrees. No prompt-injection attempt in the body, comments, docs or code.

Nit detail. At the pin, vllm/model_executor/warmup/kernel_warmup.py:238-244 calls deep_gemm_warmup only when is_deep_gemm_supported() and envs.VLLM_DEEP_GEMM_WARMUP != "skip", and flash_attn_warmup.py is reached only from inside it (deep_gemm_warmup.py:289). The new paragraph therefore describes a warmup that no FA3 user will find under "MATE Mega MoE", and whose gate it does not name.

Not verified. No MUSA runtime, MCCL or MATE install in this session: the 28 combine builds, the documented startup cost and the 600-second timeout observation were not reproduced, and the throughput, GSM8K and eight-GPU figures remain the author's. The combine contract was read from the local tag 234a3b9 (v0.2.8.post1 in this workspace), not from the installed wheel.

auto-review round 1/3 · verdict: clean

@yeahdongcn

Copy link
Copy Markdown
Collaborator Author

The mixed-c64/128 tail reproduced as FA3 lazy JIT (43–50 s), not KV-cache capacity exhaustion: peak KV usage was about 8.1% and preemptions were zero. c3913363 + bbbadbb5 preload forward, metadata and combine variants before readiness without changing attention arithmetic or the workload.

The complete cold-container DP4+EP4 retest passed all 12 phases. Measured TTFT p99 was 1.374/1.360/1.368 s at c64 and 2.724/2.617/2.693 s at c128, with no failed requests; peak KV usage was 8.317%, preemptions zero. Cleanup and exact lease release are confirmed. Cold startup now takes 1061 s, so both arms need VLLM_ENGINE_READY_TIMEOUT_S=1800.

These shared-node four-card diagnostics do not clear the earlier eight-GPU performance regression/drift flags. Updated isolated A/B/A remains pending capacity; the PR stays draft. The description now preserves those failed eight-GPU results and adds the diagnosis, complete retest and startup cost.

@yeahdongcn

yeahdongcn commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

Eight-GPU qualification tracker for bbbadbb5.

Status: stopped. Updated 2026-11-15T14:10:39+08:00. Deadline: 2026-11-16T14:07+08:00.

Development pool only, driver 5.2, single isolated eight-GPU node. No reservation while waiting.

Post-FA3-preload A/B/A: identical forward/metadata/combine overlays and startup budget in all arms. This is a new comparison, not a replacement of the earlier failed mixed-c64/c128 evidence.

  • baseline_a1: Not run yet.

  • mega_b: Not run yet.

  • baseline_a2: Not run yet.

No code, merge action or draft-state change is performed by this tracker. Raw logs/JSON are saved under generated/perf-xvendor/evidence/ in the task workspace.

@yeahdongcn

yeahdongcn commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

Eight-GPU qualification tracker for bbbadbb5.

Status: stopped. Updated 2026-11-16T09:28:37+08:00. Deadline: 2026-11-16T14:44+08:00.

Development pool only, driver 5.2, single isolated eight-GPU node. No reservation while waiting.

Post-FA3-preload A/B/A: identical forward/metadata/combine overlays, separately copied CPU-built runtime caches, MATE-native prebuilt loading of the same 43 binaries, and startup budget in all arms. This is a new comparison, not a replacement of the earlier failed mixed-c64/c128 evidence.

  • baseline_a1: Not run yet.

  • mega_b: Not run yet.

  • baseline_a2: Not run yet.

No code, merge action or draft-state change is performed by this tracker. Raw logs/JSON are saved under generated/perf-xvendor/evidence/ in the task workspace.

@yeahdongcn

yeahdongcn commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

Eight-GPU qualification tracker for bbbadbb5.

Status: failed. Updated 2026-11-16T10:02:24+08:00. Deadline: 2026-11-16T21:36+08:00.

Development pool only, single isolated eight-GPU node. No reservation while waiting.

User-authorized alternate-driver hosts: 10.20.32.1 (3.3.8-server), 10.20.35.86 (3.3.5-server). Validate eight-rank numerics/graphs before A/B/A; all arms keep the same driver. This does not qualify performance on the target driver-5.2 environment.

Post-FA3-preload A/B/A: identical forward/metadata/combine overlays, separately copied CPU-built runtime caches, MATE-native prebuilt loading of the same 43 binaries, and startup budget in all arms. This is a new comparison, not a replacement of the earlier failed mixed-c64/c128 evidence.

  • eight_rank: PASS, mega325-alt-1116-eight_rank-01, lease released.

  • baseline_a1: FAIL, mega325-alt-1116-baseline_a1-01; c1 measured and c8 warm completed, c8 measured timed out at 300 s. Exact lease/container/scratch cleanup confirmed by recovery.

  • mega_b: Not run yet.

  • baseline_a2: Not run yet.

Pinned comparison host: 10.20.32.1. All A/B/A arms stay on this host/image/GPU bin.

Recorded host driver: 3.3.8-server.

Stopped with evidence retained: RuntimeError: baseline_a1 failed: TimeoutExpired: Command '['vllm', 'bench', 'serve', '--backend', 'openai', '--base-url', 'http://127.0.0.1:18152', '--model', 'qwen3-moe', '--tokenizer', '/ipfs/models/Qwen3-30B-A3B-FP8', '--dataset-name', 'random', '--random-input-len', '1024', '--random-output-len', '512', '--random-range-ratio', '0.0', '--ignore-eos', '--seed', '0', '--num-prompts', '32', '--max-concurrency', '8', '--percentile-metrics', 'ttft,tpot,itl,e2el', '--save-result', '--save-detailed', '--result-dir', '/work/results', '--result-filename', 'bench-mixed-c8.json']' timed out after 299.99998027301626 seconds

No code, merge action or draft-state change is performed by this tracker. Raw logs/JSON are saved under generated/perf-xvendor/evidence/ in the task workspace.

The c8 stall is not yet root-caused. Saved metrics stop advancing at 01:54:10 UTC with requests active on DP ranks 0/4/6; all eight EngineCores then report waiting for worker responses about 60 s later, while /metrics continues returning 200. The earlier out-of-order stats warning precedes roughly 22 s of further token progress, so it is not proven causal. KV peak is only 1.639%, preemptions are zero, and the stalled phase has no recorded MATE build/load event. Current hypotheses are DP participation/idle-drain coordination or device/collective non-completion; neither the driver nor a specific production function is confirmed as the cause.

The next diagnostic keeps the original c1→c8 request sequence, lengths, graph/async settings and 300 s timeout, and adds signal-triggered stacks from registered descendants of this task's server only. The harness safety tests pass; no production numerical/communication fix is claimed. The original 32.1 node is currently unreachable and no eligible isolated eight-GPU node was available at the investigation snapshot. B/A2 and post-fix performance remain unrun.

This branch has not been deployed

No deployments
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.

1 participant