Repository navigation
fix(dsv4): use vec_size=32 for dim=1024 rotate-quant kernels - #4438
Merged
Merged
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
Contributor
There was a problem hiding this comment.
Pull request overview
Restores correct tile geometry for DeepSeek-V4 rotate / RoPE rotate quantization kernels at dim=1024 by selecting vec_size based on runtime WARP_SIZE (wave32 vs wave64), avoiding invalid vec_size * warp_size % dim configurations.
Changes:
- Extend
hadamard_rotate_activation_fp4quant_kernelto parameterize alogical_warp_sizeused in the tile geometry (m_block) static checks/computation. - Add a
*_KERNEL_IMPL_WARPlauncher macro to instantiate the kernel with explicit(vec_size, logical_warp_size)fordim=1024. - Update
dim=1024dispatch sites to choosevec_size=32for wave32 (block_size==32) and keepvec_size=16for wave64.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR ROCm#4029 refactored inplace rotate-quant into out-of-place kernels but unconditionally used vec_size=16 for dim=1024. On wave32 targets this violates vec_size * warp_size % dim == 0 (16*32=512), breaking JIT build and producing wrong tile geometry. Dispatch by runtime WARP_SIZE: wave32 uses (vec=32, logical_warp=32), wave64 keeps (vec=16, logical_warp=64). Co-authored-by: Cursor <[email protected]>
XiaobingSuper
force-pushed
the
fix/dsv4-rotate-wave32
branch
from
July 29, 2026 12:47
4c7be55 to
6917d1b
Compare
XiaobingSuper
marked this pull request as draft
July 29, 2026 12:49
PR ROCm#4029 switched dim=1024 launch sites to vec_size=16, which breaks wave32 targets where 16*32=512 is not divisible by 1024. Use vec_size=32 instead (32*32=1024 on gfx1250, 32*64=2048 on wave64). Co-authored-by: Cursor <[email protected]>
XiaobingSuper
marked this pull request as ready for review
July 29, 2026 13:03
valarLip
approved these changes
Jul 29, 2026
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.
Problem
PR #4029 switched all
dim=1024launch sites tovec_size=16. On wave32 targets (gfx1250),16 × 32 = 512is not divisible by 1024, causing JIT build failure formodule_dsv4_rotate_quant.Solution
Use
vec_size=32for alldim=1024entry points:Affected paths:
rotate_activation,rope_rotate_activation,rope_rotate_activation_fp8quant,rmsnorm_rope_rotate_activation_fp4quant_kvcache.Test plan
module_dsv4_rotate_quanton gfx1250dim=128,512,1024