Repository navigation
cuda: use the vector lightning indexer kernel on MUSA - #29990
Merged
ServeurpersoCom merged 2 commits intoOct 5, 2026
Merged
ServeurpersoCom merged 2 commits into
ServeurpersoCom merged 2 commits into
Conversation
MUSA archs 21 and 22 cap static shared memory at 28 KB, and the tile kernel staged the queries of all four heads next to the key tile for 33 KB. The queries are now staged in passes of LIGHTNING_INDEXER_TILE_HEADS_PER_PASS heads: two on MUSA for 25 KB, four elsewhere where the single pass folds to the previous kernel.
am17an
reviewed
Oct 5, 2026
am17an
left a comment
Contributor
There was a problem hiding this comment.
we can just use the vec kernel for this arch
Address review from am17an: the tile kernel stays off MUSA, whose archs 21 and 22 cap static shared memory at 28 KB, below the 33 KB the tile needs, so MUSA keeps the vector kernel it ran before. This replaces the head passes, CUDA and ROCm run the merged kernel unchanged.
Contributor
Author
Done |
CISC
approved these changes
Oct 5, 2026
am17an
approved these changes
Oct 5, 2026
1 task
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.
Overview
Follow up to #29901, which broke the MUSA Docker build: MUSA archs 21 and 22 allow only 28 KB of static shared memory, and the new tile kernel needs 33 KB.
As suggested by @am17an, MUSA now skips the tile kernel and keeps the vector kernel it used before #29901, so the tile kernel is never compiled for MUSA. CUDA and ROCm run the merged kernel unchanged.
Tested on an R9700 with the MUSA path simulated: the 4 head cases fall back to the vector kernel and test-backend-ops passes. I don't have MUSA hardware, so @yeahdongcn can test the head pass version later, which fits the tile under 28 KB: 8b84aec. The regular MUSA CI only builds arch 31, so only a Docker run will show the fix.
Additional information
cc @CISC
Follow-up #29901
Requirements