Repository navigation
[HIP] Fix/7534 moe sorting opus gfx1250 - #7540
Conversation
(cherry picked from commit 74b30b297862f9af8b697d00a212fb9c78f7ffb4)
(cherry picked from commit 183701ecb3cefd13ac9bd04ca46aa5e55c0be0a3)
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
WAITING ON AUTHORPR Self-ReviewRevision 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
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
* 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)
* 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)
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]>
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]>
Motivation
Fixes #7534:
module_moe_sorting_opusfails to build for gfx1250(
Invalid dpp_ctrl value: broadcasts are not supported on GFX10+).Technical Details
dpp_inclusive_scan_waveused DPProw_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_metadataassumed 64-lane waves (tid & 63,lane == 63,wave_totals[16]). It now uses the compile-time wave size (32 on gfx1250),with a
static_assertthat the wave totals fit in one wave scan.<hip/hip_bfloat16.h>explicitly. Newer ROCm images do not pull it inthrough 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.
(E=512/513/385, 1–4096 tokens, invalid ids): 29/29 pass. A deliberately broken
scan fails 29/29.
__hip_cuidhash differs).