Commit 742d71b
[AMD] Add tilesPerWarp parameter to mfma layout (#7283)
This PR introduces the tilesPerWarp parameter to the MFMA layout.
Previously, the MFMA layout assumed that each warp within a CTA tile
computed a single MFMA tile.
When the tensor was larger than a single CTA tile, these tiles were
repeated across the tensor.
In this setup, the output tiles computed by each wave were strided by
the number of warps
per CTA in both row and column dimensions.
For instance, with 16 MFMA tiles and warpsPerCTA = [2, 2], the
distribution of
warps across the MFMA tiles looked like:
w0 w1 w0 w1
w2 w3 w2 w3
w0 w1 w0 w1
w2 w3 w2 w3
The new tilesPerWarp parameter allows each warp to compute contiguous
MFMA tiles
in the row and/or column dimensions. Using the same example with
tilesPerWarp = [2, 2], the layout becomes:
w0 w0 w1 w1
w0 w0 w1 w1
w2 w2 w3 w3
w2 w2 w3 w3
While this is a general enhancement, the main motivation for introducing
this parameter
is to improve memory access efficiency for scale tensors in scaled dot
operations.
Specific patterns and use cases will be implemented in follow-up PRs.
---------
Co-authored-by: Ognjen Plavsic <[email protected]>
Co-authored-by: Lei Zhang <[email protected]>1 parent c2c7b9b commit 742d71b
File tree
10 files changed
+581
-101
lines changed- include/triton/Dialect/TritonGPU/IR
- lib
- Conversion/TritonGPUToLLVM
- Dialect/TritonGPU/IR
- python/test/unit/language
- third_party/amd/lib
- TritonAMDGPUToLLVM
- ConvertLayoutOpToLLVM
- TritonAMDGPUTransforms
- unittest/Dialect/TritonGPU
10 files changed
+581
-101
lines changedLines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
289 | 290 | | |
290 | 291 | | |
291 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1077 | 1077 | | |
1078 | 1078 | | |
1079 | 1079 | | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
1080 | 1102 | | |
1081 | 1103 | | |
1082 | 1104 | | |
1083 | 1105 | | |
1084 | 1106 | | |
1085 | 1107 | | |
| 1108 | + | |
1086 | 1109 | | |
1087 | 1110 | | |
1088 | 1111 | | |
1089 | 1112 | | |
1090 | 1113 | | |
1091 | 1114 | | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
1092 | 1127 | | |
1093 | 1128 | | |
1094 | 1129 | | |
1095 | 1130 | | |
1096 | 1131 | | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
1097 | 1135 | | |
1098 | 1136 | | |
1099 | 1137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1316 | 1316 | | |
1317 | 1317 | | |
1318 | 1318 | | |
| 1319 | + | |
1319 | 1320 | | |
1320 | 1321 | | |
1321 | 1322 | | |
| |||
1331 | 1332 | | |
1332 | 1333 | | |
1333 | 1334 | | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
1334 | 1340 | | |
1335 | 1341 | | |
1336 | 1342 | | |
| |||
1357 | 1363 | | |
1358 | 1364 | | |
1359 | 1365 | | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
1360 | 1370 | | |
1361 | 1371 | | |
1362 | 1372 | | |
1363 | 1373 | | |
1364 | 1374 | | |
1365 | 1375 | | |
1366 | | - | |
1367 | | - | |
| 1376 | + | |
| 1377 | + | |
1368 | 1378 | | |
1369 | 1379 | | |
1370 | 1380 | | |
1371 | 1381 | | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
1375 | 1391 | | |
1376 | 1392 | | |
1377 | 1393 | | |
| |||
1380 | 1396 | | |
1381 | 1397 | | |
1382 | 1398 | | |
1383 | | - | |
| 1399 | + | |
| 1400 | + | |
1384 | 1401 | | |
1385 | 1402 | | |
1386 | 1403 | | |
| |||
1873 | 1890 | | |
1874 | 1891 | | |
1875 | 1892 | | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
1876 | 1897 | | |
1877 | 1898 | | |
1878 | 1899 | | |
| |||
1908 | 1929 | | |
1909 | 1930 | | |
1910 | 1931 | | |
| 1932 | + | |
| 1933 | + | |
1911 | 1934 | | |
1912 | 1935 | | |
1913 | 1936 | | |
1914 | 1937 | | |
1915 | 1938 | | |
1916 | 1939 | | |
1917 | | - | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
1918 | 1943 | | |
1919 | 1944 | | |
1920 | 1945 | | |
1921 | 1946 | | |
1922 | 1947 | | |
1923 | 1948 | | |
1924 | | - | |
1925 | | - | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
1926 | 1953 | | |
1927 | 1954 | | |
1928 | 1955 | | |
| |||
0 commit comments