feat: add AMD ROCm support via AITER CK flash attention backend#67
Open
ZJLi2013 wants to merge 1 commit intoSkyworkAI:mainfrom
Open
feat: add AMD ROCm support via AITER CK flash attention backend#67ZJLi2013 wants to merge 1 commit intoSkyworkAI:mainfrom
ZJLi2013 wants to merge 1 commit intoSkyworkAI:mainfrom
Conversation
Add AMD Instinct MI300X GPU support using AITER Composable Kernel (CK) flash attention backend, which compiles to native AMD ISA and delivers ~25% better steady-state performance than Triton kernels. Dispatch priority: FA3 > AITER CK > FA2 > RuntimeError. Tested on MI300X (gfx942) with ROCm 7.2 + AITER 0.1.13, producing identical outputs to the NVIDIA FA3 path. Made-with: Cursor
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.
Summary
Add AMD Instinct MI300X GPU support to Matrix-Game-3.0 using AITER (AI Tensor Engine for ROCm) Composable Kernel (CK) flash attention backend.
attention.py: Add AITER CK dispatch path between FA3 and FA2. Dispatch priority:FA3 → AITER CK → FA2 → RuntimeError. No changes to existing NVIDIA code paths.README.md: Add AMD ROCm installation section with ROCm 7.x + AITER setup instructions.Motivation
The original code hard-asserts
flash_attnavailability, which fails on AMD GPUs. This PR adds native AMD support via AITER's CK backend, which compiles flash attention kernels to native AMD ISA (hipcc → LLVM → GCN).Test Results (MI300X, gfx942, ROCm 7.2)
rocm/pytorch:rocm7.2.1_ubuntu22.04_py3.10_pytorch_release_2.9.1+amd-aiter 0.1.13Changes
Matrix-Game-3/wan/modules/attention.pyMatrix-Game-3/README.mdCompatibility
flash-attnwithFLASH_ATTENTION_TRITON_AMD_ENABLE=TRUERuntimeErrorwith install instructions (replaces silentAssertionError)