Repository navigation
[Triton] Retune gfx942 a16w4 DSv4.1 tiles for Triton 3.8 #6286
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,6 +104,13 @@ def get_kernel_config_triton(m, n, k, routing_data): | |
| f"bm{block_m}_n{n}_k{k}" | ||
| ) | ||
| if tuned is not None: | ||
| nonkdim = tuned.get("matrix_instr_nonkdim", 16) | ||
| # Triton 3.6 fails LLVM lowering of bm128_n5120_k768 at nonkdim 16 | ||
| # (unrealized_conversion_cast). 3.8 is faster with 16. | ||
| if block_m == 128 and n == 5120 and k == 768 and nonkdim == 16: | ||
| major, minor = (int(p) for p in triton.__version__.split(".")[:2]) | ||
| if (major, minor) < (3, 8): | ||
| nonkdim = 32 | ||
|
Comment on lines
+107
to
+113
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This stops the crash, but on Triton 3.6.0 and 3.7.1 the row is 17 to 25% slower than base. The cause is |
||
| return { | ||
| "block_m": block_m, | ||
| "block_n": tuned["BLOCK_SIZE_N"], | ||
|
|
@@ -115,7 +122,7 @@ def get_kernel_config_triton(m, n, k, routing_data): | |
| "w_cache_modifier": w_cache_modifier, | ||
| "split_k": split_k, | ||
| "waves_per_eu": tuned.get("waves_per_eu", 0), | ||
| "matrix_instr_nonkdim": tuned.get("matrix_instr_nonkdim", 16), | ||
| "matrix_instr_nonkdim": nonkdim, | ||
| "kpack": tuned.get("kpack", 1), | ||
| } | ||
|
|
||
|
|
@@ -162,7 +169,7 @@ def get_kernel_config_triton(m, n, k, routing_data): | |
| "split_k": split_k, | ||
| "waves_per_eu": 0, | ||
| "matrix_instr_nonkdim": 16, | ||
| "kpack": 1, | ||
| "kpack": 2 if block_m <= 32 else 1, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Triton 3.8.0, |
||
| } | ||
| return ret | ||
|
|
||
|
|
||
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.
MI300X and MI325X use this same gfx942 table. On MI300X, nonkdim 32 is 10 to 12% faster than 16. Your MI325X data also shows nonkdim 32 faster than #5667, by 0.7 to 2.1%. Could you set
"matrix_instr_nonkdim": 32? Then the version check inmoe_op_gemm_a16w4.pyis not necessary.