Repository navigation
[Codegen][GPU] Sort intrinsic according to k alignment - Step 2 of 2 - Creating intrinsic sort routine - #21128
Merged
jerryyin merged 4 commits intoJun 20, 2025
Conversation
jerryyin
requested review from
Groverkss,
MaheshRavishankar,
antiagainst,
kuhar and
qedawkins
as code owners
June 18, 2025 16:41
jerryyin
force-pushed
the
users/zyin/sort-intrinsics-according-to-k-aligned
branch
from
June 18, 2025 16:42
b9fadc6 to
efbfe7e
Compare
Signed-off-by: jerryyin <[email protected]>
krzysz00
reviewed
Jun 18, 2025
jerryyin
force-pushed
the
users/zyin/sort-intrinsics-according-to-k-aligned
branch
from
June 18, 2025 19:53
5fa470a to
f43b430
Compare
Signed-off-by: jerryyin <[email protected]>
kuhar
reviewed
Jun 18, 2025
jerryyin
force-pushed
the
users/zyin/sort-intrinsics-according-to-k-aligned
branch
2 times, most recently
from
June 19, 2025 20:17
066a94f to
51bf5d4
Compare
Signed-off-by: jerryyin <[email protected]>
krzysz00
approved these changes
Jun 20, 2025
krzysz00
left a comment
Contributor
There was a problem hiding this comment.
I think that's a reasonable set of tests for this code
Thanks for following up on this!
jerryyin
enabled auto-merge (squash)
June 20, 2025 19:15
Signed-off-by: jerryyin <[email protected]>
AWoloszyn
pushed a commit
that referenced
this pull request
Dec 1, 2025
…- Creating intrinsic sort routine (#21128) This is a follow-up of #21103. This intrinsic sorting routine will sort the MMA intrinsics by following precedence rules: 1) K-alignment. We prefer intrinsics that can evenly divide the K dimension of the problem. 2) M/N-alignment. We prefer intrinsics that can evenly divide the M and N dimensions of the problem. 3) Intrinsic with larger gemm size. 4) Intrinsic with larger K size. Scope of the impact is igemm and matmul problems. Other pipelines can choose to adopt this if the sorting turns out to be useful. ### Motivation: convolution configuration with > BOO_CACHE_ON=0 python boo_driver.py convbfp16 -n 16 -c 40 -H 192 -W 128 -k 40 -y 3 -x 3 -p 1 -q 1 -u 2 -v 2 -l 1 -j 1 -m conv -g 1 -F 1 -t 1 --in_layout NHWC --out_layout NHWC --fil_layout NHWC --iter 50 Since the gemmK size is 360, the best intrinsic is 32x32x8xbf16, not 16x16x16xbf16, as the former will end in aligned K. Before this PR: `362.06 us`. After this PR: `44.74 us`. Note that due to limitation of the tuner, this combination won't be covered by typical tuning run with 2k trials. So it is essential we bridge the gap through heuristic first before tuner is more capable of searching through different heuristics. --------- Signed-off-by: jerryyin <[email protected]>
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.
This is a follow-up of #21103.
This intrinsic sorting routine will sort the MMA intrinsics by following precedence rules:
Scope of the impact is igemm and matmul problems. Other pipelines can choose to adopt this if the sorting turns out to be useful.
Motivation:
convolution configuration with
Since the gemmK size is 360, the best intrinsic is 32x32x8xbf16, not 16x16x16xbf16, as the former will end in aligned K. Before this PR:
362.06 us. After this PR:44.74 us. Note that due to limitation of the tuner, this combination won't be covered by typical tuning run with 2k trials. So it is essential we bridge the gap through heuristic first before tuner is more capable of searching through different heuristics.