-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add a script for generating the quick-tuning perfconfigs list #1689
Conversation
bf24e45
to
588592a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1689 +/- ##
===========================================
- Coverage 77.76% 77.70% -0.07%
===========================================
Files 100 100
Lines 27866 27897 +31
Branches 4063 4072 +9
===========================================
+ Hits 21671 21678 +7
- Misses 4540 4552 +12
- Partials 1655 1667 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
params = {initParameters, nInitParameters}; | ||
if (opType == KernelType::Gemm) { | ||
switch (dataTypeA.getIntOrFloatBitWidth()) { | ||
case 8: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would apply to both f8 and i8 here, is that the goal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I 've just add select conv or gemm list based on opType. I think we're using non-accel configs for fp8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are fp8 mfmas and i8 mfmas, so here we are using the same params for both. Is that expected? or was this tuned for i8 only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tuned only for the i8. When I run tuning for fp8, I get this output:
Tuning: -t fp8 -out_datatype f32 -transA false -transB false -g 3 -m 1024 -n 512 -k 769
v2:64,32,32,4,2,2,1 9.187230e+05
v2:64,32,32,4,2,4,1 7.604820e+05
v2:64,32,32,4,4,2,1 8.972820e+05
...
where it seems that the perfconfigs are in the format for non-xdlops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running this command (gfx942):
./bin/rocmlir-gen -operation gemm -t fp8 --arch gfx942:sramecc+:xnack- --num_cu 304 -g 1 -m 1 -k 768 -n 768 -transA=False -transB=False --kernel-repeats 1 --perf_config= | ./bin/rocmlir-tuning-driver --tuning-space=exhaustive
I get this:
v2:16,16,4,16,16,8,1,1,1 1.952500e+04
v2:16,16,4,16,16,8,3,1,1 5.493000e+03
v2:16,16,4,16,16,8,4,1,1 3.728000e+03
v2:16,16,4,16,16,16,1,1,1 8.179000e+03
v2:16,16,4,16,16,16,3,1,1 3.448000e+03
v2:16,16,4,16,16,16,4,1,1 2.887000e+03
v2:16,16,8,16,16,8,1,1,1 7.617000e+03
v2:16,16,8,16,16,8,3,1,1 1.128990e+05
...
We get 9 numbers which corresponds to xdlops.
What command are you running?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think we either tune for f8 and bf8 or use the default params? So, instead of checking dataTypeA.getIntOrFloatBitWidth() we need to check for the actual type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran python3 tuningRunner.py --op gemm --data-type fp8 -c toy-gemm-configs -d on gfx90a, but I get the same result with the rocmlir-tuning-driver on gfx90a. It seems that f8 mfma is supported only on gfx942?
As our quick-tuning list on develop is outdated, I think we should merge this first, and then investigate f8 in a new ticket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's supported in navi4 as well. Ok, that's fair, let's merge this and open a new ticket for fp8 and bf8.
mlir/include/mlir/Dialect/Rock/Tuning/QuickTuningPerfconfigs.inc
Outdated
Show resolved
Hide resolved
a478ee0
to
738bbaf
Compare
bbefcf6
to
8e5cf9c
Compare
@dhernandez0 ready for another review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are some comments not addressed in the review
This PR includes a script for finding quick-tuning perfconfigs in the following way:
Additionally, there are option to automatically generated the QuickTuningPerfconfigs.inc file that contains selected perfconfigs, and its integration into the codebase.
closes : ROCm/rocMLIR-internal#1641
closes : ROCm/rocMLIR-internal#1258
closes : ROCm/rocMLIR-internal#1518