Repository navigation
Conversation
This branch has not been deployed
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.
_multi_row_decode_launchhalvesBLOCK_Nwhile the Q and K/V tiles exceed the opt-in shared memory, and skips that check when the budget is 0. Torch readsshared_memory_per_block_optinonly on CUDA, so on ROCm the budget is always 0 and multi-row decode (#900) can pick tiles over the 64 KiB LDS. Reported by @TashaSkyUp in #897 (comment): the BF16 head_dim 256 case oftest_decode_triton_attention_multi_row_matches_referenceneeds 65,792 B on gfx1201.On ROCm the multi-row launch now takes its budget from
shared_memory_per_block(the LDS size per workgroup), asqsa/attend.pyalready does. Single-row decode, extend and all CUDA launches still read the opt-in value and do not change.Not run on AMD hardware. I compiled the wrapper's real stage-1 launches for gfx1201 with Triton 3.8 on a CUDA box (64 CUs, opt-in smem 0 as on ROCm): the multi-row tests plus a sweep of 10 head shapes x bf16/fp8/int8 x 1-8 rows x bs 1-64, with and without a window, 469 kernels.
The exactly-64-KiB bf16 tiles move to half the
BLOCK_Ntoo: the failing test case is one of them (65,536 B in this cross-compile, 65,792 B on the ROCm toolchain in the report). @zihaomu @TashaSkyUp, could you runpytest tests/kernels/test_triton_attention.py -k multi_rowon gfx1201 with this branch?CUDA:
pytest tests/kernels/test_triton_attention.py -k "multi_row or decode_rows or decode_triton"passes on an RTX PRO 6000 (sm_120).