Skip to content
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

[Draft] MBSK prefetch optimization #1629

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

boringmorning
Copy link
Contributor

@boringmorning boringmorning commented Feb 6, 2025

Currently use "MbskPrefetchOpt" to control the MBSK reduction order:

0 (default): Reduce same element from all WGs, and repeat for all elements. This is the original design.

1: Reduce all elements from one other WG, and repeat for all WGs. This design can potentially improve data prefetch.

@boringmorning
Copy link
Contributor Author

image
image
In these 2 benchmarks, I tuned ~2000 kernels each for MbskPrefetchOpt = 0 and MbskPrefetchOpt = 1 and compare their winners' performance (all other parameters settings are the same). For the benchmark with smaller size, the result are almost the same. In contrast, MbskPrefetchOpt = 1 resulted in noticable improvement with the larger sizes.

@KKyang
Copy link
Contributor

KKyang commented Feb 7, 2025

why another new parameter? Can't we make this auto calculated? (Calculated in runtime and use a flag to control the branch)

@boringmorning
Copy link
Contributor Author

boringmorning commented Feb 7, 2025

why another new parameter? Can't we make this auto calculated? (Calculated in runtime and use a flag to control the branch)

@KKyang This is an option, but how to decide the branching is an important problem. Also will result in larger code size (hundreds to thousand lines of code).
Note that this is just the draft version, and one reason to use a new parameter is for easier benchmarking. I will have a presentation & discussion about this optimization (maybe next week).

@boringmorning boringmorning changed the title Add new tuning parameter "MbskPrefetchOpt" [Draft] MBSK prefetch optimization Feb 12, 2025
@boringmorning boringmorning self-assigned this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants