Skip to content

[HIP] Fix/7534 moe sorting opus gfx1250 - #7540

Merged
zufayu merged 2 commits into
mainfrom
fix/7534-moe-sorting-opus-gfx1250
Nov 9, 2026
Merged

zufayu merged 2 commits into
mainfrom
fix/7534-moe-sorting-opus-gfx1250

Conversation

@demonsan

@demonsan demonsan commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Motivation

Fixes #7534: module_moe_sorting_opus fails to build for gfx1250
(Invalid dpp_ctrl value: broadcasts are not supported on GFX10+).

Technical Details

  • dpp_inclusive_scan_wave used DPP row_bcast:15/31, which exists only on GFX9.
    The GFX9 path is unchanged. On GFX10+ the cross-row step adds the totals of the
    earlier 16-lane rows via readlane.
  • build_sorted_metadata assumed 64-lane waves (tid & 63, lane == 63,
    wave_totals[16]). It now uses the compile-time wave size (32 on gfx1250),
    with a static_assert that the wave totals fit in one wave scan.
  • Include <hip/hip_bfloat16.h> explicitly. Newer ROCm images do not pull it in
    through other headers.

Test Plan / Result

On an MI455X A0 (gfx1250), image
rocm/ufb-private:pytorch-mi450-release-2.11-py3.12-rocm10.2.0a20260922-bkc.20260929:

  • pytest op_tests/test_moe_sorting.py::test_moe_sorting_invalid_topk_ids:
    fails before (same ld.lld error), passes after.
  • Standalone GPU check of the real scan and metadata code against a CPU reference
    (E=512/513/385, 1–4096 tokens, invalid ids): 29/29 pass. A deliberately broken
    scan fails 29/29.
  • gfx950: device assembly is identical before and after (only the per-file
    __hip_cuid hash differs).

(cherry picked from commit 74b30b297862f9af8b697d00a212fb9c78f7ffb4)
(cherry picked from commit 183701ecb3cefd13ac9bd04ca46aa5e55c0be0a3)
@demonsan
demonsan requested a review from a team November 6, 2026 03:01
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 7540 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@github-actions github-actions Bot changed the title [OPUS]Fix/7534 moe sorting opus gfx1250 [HIP] Fix/7534 moe sorting opus gfx1250 Nov 6, 2026
@github-actions github-actions Bot added the HIP label Nov 6, 2026
@aiter-bot

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 3b53438ad23d · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. Which architecture, dtype and shape boundaries select the changed kernel path, and what invariant prevents unsupported inputs from reaching it?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@zufayu
zufayu merged commit 51ca421 into main Nov 9, 2026
@zufayu
zufayu deleted the fix/7534-moe-sorting-opus-gfx1250 branch November 9, 2026 13:09
ruanjm pushed a commit that referenced this pull request Nov 10, 2026
* moe_sorting_opus: portable wave scan for gfx1250 (fix #7534)

(cherry picked from commit 74b30b297862f9af8b697d00a212fb9c78f7ffb4)

* moe_sorting_opus: include hip_bfloat16.h explicitly

(cherry picked from commit 183701ecb3cefd13ac9bd04ca46aa5e55c0be0a3)
JadenMathias pushed a commit to JadenMathias/aiter that referenced this pull request Nov 10, 2026
* moe_sorting_opus: portable wave scan for gfx1250 (fix ROCm#7534)

(cherry picked from commit 74b30b297862f9af8b697d00a212fb9c78f7ffb4)

* moe_sorting_opus: include hip_bfloat16.h explicitly

(cherry picked from commit 183701ecb3cefd13ac9bd04ca46aa5e55c0be0a3)
zufayu pushed a commit that referenced this pull request Nov 23, 2026
dpp_inclusive_scan_wave used DPP row_bcast:15/31, which exists only on
GFX9, so module_moe_mxfp4_aux failed to build for gfx1250 ("Invalid
dpp_ctrl value: broadcasts are not supported on GFX10+"). Keep the GFX9
path; elsewhere add the earlier 16-lane rows' totals with readlane, as
#7540 did for moe_sorting_opus.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
zufayu pushed a commit that referenced this pull request Nov 24, 2026
dpp_inclusive_scan_wave used DPP row_bcast:15/31, which exists only on
GFX9, so module_moe_mxfp4_aux failed to build for gfx1250 ("Invalid
dpp_ctrl value: broadcasts are not supported on GFX10+"). Keep the GFX9
path; elsewhere add the earlier 16-lane rows' totals with readlane, as
#7540 did for moe_sorting_opus.

Co-authored-by: who who who <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue]: module_moe_sorting_opus does not build for gfx1250 (DPP row_bcast in dpp_inclusive_scan_wave)

4 participants