mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 19:04:50 +07:00
[PR #634] gfx1151: the fused prompt experts at 3 blocks a multiprocessor (prefill +3.5% on Strix Halo) #638
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#638
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/634
Author: @mrsirg97-rgb
Created: 10/28/2026
Status: 🔄 Open
Base:
main← Head:fused-moe-speed📝 Commits (1)
b894045gfx1151: the fused prompt experts at 3 blocks a multiprocessor for every type pair📊 Changes
3 files changed (+138 additions, -3 deletions)
View changed files
📝
CMakeLists.txt(+4 -0)📝
src/prefill/moe_fused_rdna4.cu(+7 -3)➕
tests/hip/prefill_fused_bench.cpp(+127 -0)📄 Description
On gfx1151 (Strix / Gorgon Halo), the fused GLM prompt experts now size their persistent grid at 3 blocks per multiprocessor for every type pair. It's a one-line change in
moe_fused_rdna4.cu'sexperts(). gfx1100 and RDNA4 keep their current factors, since I can't measure them.Why. The grid was 4 blocks per multiprocessor, except 3 for IQ2_S / IQ2_XS. On a Radeon 8060S, 3 is faster or equal for every supported pair; 4 and 5 are the slowest, and 6 falls in between. HIP's occupancy query reports 2 resident blocks per multiprocessor for these kernels (LDS-bound), and that doesn't explain the curve: 2 blocks measures about as slow as 4. So this is a measured constant, the same way the existing 3 and 4 were chosen. Each output is still computed by one block in the same order, so the results are bit-for-bit identical.
New microbenchmark.
tests/hip/prefill_fused_bench.cpp(hip_prefill_fused_bench,EXCLUDE_FROM_ALL) runs one GLM layer's fused experts at a real shape: 288 experts, 8 routed per token, IQ2_XXS gate/up and IQ3_XXS down by default, random valid blocks. It prints the median time, int8 TOPS, and a hash of the output's bits. Usage:hip_prefill_fused_bench [tokens] [reps] [gu_type] [down_type].Measured. Radeon 8060S (Ryzen AI MAX+ 395, ROCm 7.15, hipBLASLt 1.4.1).
hip_prefill_fused_bench, IQ2_XXS / IQ3_XXS:Other pairs at 9K tokens:
The sweep of 3 / 4 / 5 / 6 blocks was repeated at 2K, 9K and 16K tokens. 3 won at every size.
./maya.sh --benchused unsloth's GLM-5.3-Flash UD-IQ2_XXS at 512K context, with a hipBLASLt table retuned for this hipBLASLt (#631). Two runs each, alternating, with only the engine binary differing:STRATA_GLM_PREFILL_PROF=1, ~9K-token prompts):moe_fused0.815 → 0.717 ms/token.hip_prefill_fused_parityandtools/check_hip_compat.pypass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.