mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #581] HIP: gfx950 (MI350X / MI355X) support and EXL3 decode without a per-block L2 flush #606
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#606
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/581
Author: @yagop
Created: 10/28/2026
Status: 🔄 Open
Base:
main← Head:mi350x-gfx950📝 Commits (8)
11a4876HIP: experimental gfx942 (Instinct MI300X / MI325X, wave64) supporteaf9612HIP: gfx942 hipBLASLt tuning table for hipBLASLt 100401 (ROCm 7.14)8014acfdocs: shorter MI300X / MI325X sectionf81a260Add gfx950 (MI350X / MI355X, CDNA4) to the wave64 HIP pathaf8c9c2HIP: add up split / paired EXL3 GEMV results in kernels of their ownd9c76d4HIP: mv_reduce_kernel, a block per output block and activation1d471e0HIP: optional input split for the routed experts (EXL3_XSPLIT)da6adf2HIP: keep the experts input split out of the CUDA build📊 Changes
8 files changed (+542 additions, -15 deletions)
View changed files
📝
cmake/hip_backend.cmake(+17 -1)📝
docs/AMD_MAYA.md(+17 -0)📝
include/strata/hip_compat/intrinsics.hpp(+4 -2)📝
maya.py(+4 -2)📝
src/kernels/cuda/exl3.cu(+314 -4)📝
src/kernels/cuda/glm_lat8.cuh(+3 -2)📝
tests/exl3_test.cu(+85 -4)➕
tools/hip/gfx942-glm-hipblaslt-100401.txt(+98 -0)📄 Description
Stacked on #468 (gfx942). The first three commits are #468's; this PR adds two:
27fd39c): the same compat path as gfx908 and gfx942, with packed FP32 and the sdot4 builtin, and the CUDA lat8 kernel path kept as on gfx942. Experimental: tested on one MI350X (288 GB).bde4bd2). The details follow.The problem
On HIP,
mv_kernel,moe_gate_up/moe_down(and their mixed variants) andwin_gupass work between blocks the CUDA way. Each block writes its partial rows, calls__threadfence()and bumps a counter, and the last block adds the rows up. On gfx942 / gfx950,__threadfence()at agent scope compiles tobuffer_wbl2 sc1+buffer_inv sc1. That writes back and invalidates the XCD's whole L2, once per block.On the MI350X, a rocprofv3 thread trace of
mv_kernel<12, 2>(DeepSeek-V4.1's 6-bit attention and shared expert) puts ~72% of its latency on thes_waitcnt/s_barrieraround those fences. That made the 6-bit GEMVs about half of decode time. Splitting K more made it worse, because each block paid the same fixed cost.The change (HIP only; CUDA is unchanged)
On HIP, the GEMV blocks only write their partial rows. Four small kernels finish them after the launch:
mv_reduce_kernel,moe_swiglu_kernel,moe_combine_kernelandwin_swiglu_kernel. The kernel boundary orders the writes once per launch instead of once per block. They compute the same sums in the same split / plan order, with the same epilogue, swiglu and combine, so the output bits are the same.win_expertsalready combined in a kernel of its own (win_combine_kernel); now its swiglu does too.Results: MI350X, ROCm 7.14, DeepSeek-V4.1 Flash EXL3 3.5 bpw (LibertAIDAI)
exl3_test --bench-mv)wq_b1280 → 32768wo_b8192 → 5120exl3_test --bench)maya-ds4decode with DSpark (479-token prompt, 384 tokens)maya-ds4decode without drafting (256 tokens)--bench-mvand--benchoutput checksums are identical before and after, and the DSpark run generates the same 384 tokens.exl3_testandexl3_test --exllamav3 data/exl3-exllamav3pass, including every check that windows match the token path ("0 of N differ from the token path").Tests
exl3_testgains--bench-mv: the dense GEMVs at DeepSeek-V4.1's widths (K2 12, mul1), with µs per call, the trellis read rate and a checksum of the outputs' bits.BENCH_MV_ONLY=<name>andBENCH_MV_ITERS=<n>pick one shape and the iteration count, for profilers.--benchprints the same kind of checksum.Not measured
glm_fast.cuandmm3_exl3.cuuse the same last-block pattern (GLM's path and the prompt path), and probably have the same cost on CDNA.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.