-
Notifications
You must be signed in to change notification settings - Fork 258
Update/add to qr_ks_vs_whole_k_prefetch pipeline #3485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
qianfengz
wants to merge
25
commits into
develop
Choose a base branch
from
whole_k_prefetch_n0loop
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,864
−808
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
…oping Gemm0 along n0 dimension
…e_k_prefetch pipeline
…n whole_k_prefetch path)
…n whole_k_prefetch path in trload pipeline)
… next iteration in the non-whole-k-perfetch path
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.
About qr_ks_vs_whole_k_prefetch pipeline
The pipeline qr_ks_vs_whole_k_prefetch is mainly used for the situations where total number of work-groups is not enough to occupy the CUs. When the total number of work-groups is low, use MTile size (
kM0) 64 rather than 128 can improve the CU occupancy. And withkM0=64, less registers are consumed to save P and O, thus enough vgprs are left for prefetch the whole k_tile from next iteration in the main-loop, and thus performance can be improved compared to the usual method of usingkM0=128,Except for prefetching whole k tile when
kM0=64, the pipeline also has the path to usekM0=128, in which case, 1/2 ofn0_loopsslices of the k tile are prefetched for next iteration. Path ofkM0=128can be used as a replacement of using pipelineqr_ks_vs_asyncWhat this PR does
n0_loopbrings the benefits of lessmove_tile_window()call, and removing the need ofclear_tile(s_acc)in the main loop.partition_indexto guaranteewarp_idis allocated on vgpr for store_tile/load_tile to/from LDS tile_window)Performance results
qr_ks_vs_async_whole_k_prefetch_trloadshows much better performance thanqr_ks_vs_async_trloadon the same case (execution time41.02msby whole_k_prefetch_trload &58.50msby async_load)qr_ks_vs_async_whole_k_prefetch_trloadshow a little bit better performance thanqr_ks_vs_asyncon mi350 (execution time104.50msby whole_k_prefetch_trload &106.50msby qr_ks_vs_async). And they shows completely on-par performance on MI300Test/Verify
test_whole_k_prefetch_n0loopto test/verify qr_ks_vs_whole_k_prefetch pipeline since this pipeline can not be used by ck_tile fmha example so farDiscussion