Feat/rdna4 gfx1201 rocwmma v2 - #744
Open
bestbug456 wants to merge 7 commits into
Open
Conversation
- Default ROCM_ARCH to gfx1201 (RDNA4/RX 9070) - Add `make rx9070` target for explicit RDNA4 builds - Simplified CUDA arch detection (removed sm_120/121 specific flags) - Removed mxfp4/nnq test targets - Updated DSPARK support GGUF path - Added rx9070 to help text
- Add g_wmma_v1 and g_is_gfx12 runtime detection flags in runtime.cuh - Conditional dispatch: gfx12xx uses wide-K WMMA v2 kernel, gfx11xx uses WMMA v1 - Guard __builtin_amdgcn_wmma_* calls with #if !defined(__gfx1200__) && !defined(__gfx1201__) - Make rocwmma.hpp include conditional for gfx12xx only - Preserve existing WMMA v1 code for RDNA3/3.5 architectures
- Add matmul_q8_0_f32_batch_wmma_v2_4w_kernel for RDNA4 (gfx12xx) - Fuses two 16-K WMMA mma_sync per loop to saturate 128-bit memory bus - Uses rocWMMA v2 fragments with BK=16 tiles - Guarded by #if defined(__gfx1200__) || defined(__gfx1201__) || defined(__gfx1202__)
…fo, rx9070 target
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello (again!), while I was looking around I found out #599 and #521 . Both of them where reporting no support for WMMA v2 introduced with the new RDNA4. Looking around I found the documentation on it at https://gpuopen.com/learn/wmma-guide-amd-rdna-4-gpus-part-2/ and decided to give it a try (of course assisted by an LLM), with this change I was able to reach a whopping 0.3 tkn/s in prefill and generation. Down a more structured PR message
This PR adds a WMMA v2 fused double-K matmul kernel for RDNA4 (gfx1200/1201/1202) and improves the ROCm build system.
Changes
GPU Kernel
Build System
Tests
Files changed
Testing
$ make clean && make rocm # builds successfully on gfx1201
$ ./tests/test_rocm_make.sh # PASS=20 FAIL=0