Repository navigation
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
|
@aiter-bot review Trying the review bot on a few representative PRs across different areas, so the team can see what it actually produces on real diffs. How to use it — just comment on any PR:
What it is: advisory only. It surfaces hints for a human reviewer — perf regressions, silent correctness bugs, dispatch-gate holes, AI-generated code patterns. Its judgement is stochastic, it never blocks a merge, and every verdict (✅ / It runs on a self-hosted box against a local model, so a pass takes roughly 25–30 min. Who can trigger it: the logins in |
[ROCm/aiter] PR #6119 — [HIP] [Bugfix] mxfp4 moe sort skip invalid ids (-1s)Teaches the gfx950 MXFP4 MoE aux kernels (one-CTA and three-stage sorts, the fused sort+quant, and both scatter-reduces) to drop routes whose expert id falls outside [0, E) — vLLM's -1 CUDA-graph padding rows — instead of indexing arrays with -1 and crashing, marking dropped routes reverse_sorted = -1 and adding exactly 0 for them in the scatter-reduce. Review (advisory): 🔴 HIGH RISK 🔴 [verified] The three changed kernels (moe_sort_quant.cuh, moe_3stage_sort.cuh, moe_scatter_reduce.cuh) are the default a4w4 fused-MoE path on gfx950 that vLLM and SGLang consume — this PR exists to fix a vLLM crash — yet the PR carries only the HIP label, so every downstream job (ci:sglang, ci:vllm) skips and a post-merge breakage in GPT-OSS-120B or DeepSeek-R1-MXFP4 would be invisible while aiter CI stays green. Reviewer should ask for ci:sglang + ci:vllm (or ci:all) and require them green before merge. |
|
please resolve conflicts |
|
No activity for 15 days, so this is now labelled |
| # MXFP4 aux sorts and scatter-reduce with invalid expert ids: correctness only, | ||
| # each case asserts. gfx950 only, like the MXFP4 fused-MoE paths that use | ||
| # `module_moe_mxfp4_aux`. | ||
| if get_gfx() == "gfx950": |
There was a problem hiding this comment.
Please use the runtime architecture for the new gfx950-only aux regression gate. get_gfx() follows the last entry in GPU_ARCHS: with GPU_ARCHS="gfx950;gfx942" these cases are silently skipped on gfx950, and with the reverse ordering they can run on gfx942, which this aux module does not support. get_gfx_runtime() (or the actual device properties) makes the gate independent of wheel build targets. The kernel checks themselves passed in my gfx950 run: 96 sort cases, 16 fused sort/quant cases, 32 scatter cases, plus 4 diagnostics with NaN/invalid data in row 0.
Motivation
VLLM_MOE_SKIP_PADDING set from vllm (on by default), vllm uses -1 expert id for the filler rows. However, moe_mxfp4_aux path crashes as it tries to read -1 as valid row.
This PR adds a skip mechanism, so all modules involved in this process skips -1s safely.
Routes with an id outside
[0, E)are dropped, as opus does.reverse_sortedis -1 for them, and the scatter-reduce adds 0 for them.Similar idea as #5295
Technical Details
After the fix, VLLM starts the server succesfully for dsv41-flash on MI355 with a4w4 MoE enabled:
Performace change:
Test Plan
New unit tests are added while matching the existing style.
op_tests/test_moe_sorting_mxfp4.py is extended.
Test Result
All tests pass.