[gfx1201] Enable RMSNorm support for gfx1201#2352
Open
[gfx1201] Enable RMSNorm support for gfx1201#2352
Conversation
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.
Motivation
The RMSNorm kernels in
csrc/kernels/rmsnorm_quant_kernels.cuuse CDNA-specific inline assembly instructions that are not supported on RDNA4 (gfx1201) architecture. This prevents the RMSNorm operation from working on gfx1201 GPUs. This PR aims to enable RMSNorm support on gfx1201 by replacing unsupported assembly instructions with portable HIP/C++ alternatives.Technical Details
Changes Overview
Modified
csrc/kernels/rmsnorm_quant_kernels.cuto replace CDNA-specific inline assembly with portable implementations for gfx11/gfx12:Replaced
v_pk_mul_f32inline assembly (lines 146-151, 196-201)asm volatile("v_pk_mul_f32 %0, %1, %2" ...)__gfx11__ || __gfx12__guardReplaced bf16 unpacking inline assembly (lines 162-176)
v_lshlrev_b32_e32andv_and_b32_e32instructionsck_tile::bit_castwith shift operations for unpacking bf16 valuesReplaced fp16 unpacking inline assembly (lines 180-194)
v_cvt_f32_f16_e32andv_cvt_f32_f16_sdwainstructionsck_tile::bit_castwith shift operations for unpacking fp16 valuesCompatibility
#if defined(__gfx11__) || defined(__gfx12__)) to ensure optimal performance on both architecturesTest Plan
Run the RMSNorm test suites to validate the changes:
Tests cover:
Test Result
Submission Checklist