Commit 8a16d88
authored
[AMD][Backend] Enable XF32 (TF32) Support for CDNA3 GPUs (#5637)
# Overview
AMD MI300-series GPUs support XF32 (TF32) mfma instructions in hardware,
so we should utilize them if they are there.
TF32 provides a ~1.4x improvement to matmuls over FP32 in some examples.
# BC breaking: changing the default input precision behavior
According to the [Triton
docs](https://github.com/triton-lang/triton/blob/6556ec6050649e1fc42feb05a62ab9cc6908a722/python/triton/language/core.py#L1714)
"For devices that do have tensor cores, the default precision is tf32".
Enabling XF32 (TF32) on the MI300 is BC breaking in this case, as before
the ops would execute with FP32 precision and will now execute with
TF32.
# Testing
I've added lit tests and enabled TF32 for MI300 in the python unit tests1 parent 4a80233 commit 8a16d88
File tree
8 files changed
+96
-22
lines changed- python
- test/unit/language
- triton/language
- test/TritonGPU/amd
- third_party/amd
- backend
- include/TritonAMDGPUTransforms
- lib
- TritonAMDGPUToLLVM/DotOpToLLVM
- TritonAMDGPUTransforms
8 files changed
+96
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3407 | 3407 | | |
3408 | 3408 | | |
3409 | 3409 | | |
| 3410 | + | |
3410 | 3411 | | |
3411 | 3412 | | |
3412 | | - | |
| 3413 | + | |
3413 | 3414 | | |
3414 | 3415 | | |
3415 | 3416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1715 | 1715 | | |
1716 | 1716 | | |
1717 | 1717 | | |
1718 | | - | |
| 1718 | + | |
1719 | 1719 | | |
1720 | 1720 | | |
1721 | 1721 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
115 | 121 | | |
116 | 122 | | |
117 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
82 | | - | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
Lines changed: 18 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
186 | 188 | | |
187 | | - | |
188 | | - | |
| 189 | + | |
| 190 | + | |
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
| |||
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
198 | 205 | | |
199 | 206 | | |
200 | 207 | | |
| |||
216 | 223 | | |
217 | 224 | | |
218 | 225 | | |
219 | | - | |
| 226 | + | |
220 | 227 | | |
221 | 228 | | |
222 | | - | |
| 229 | + | |
223 | 230 | | |
224 | 231 | | |
225 | 232 | | |
226 | 233 | | |
227 | 234 | | |
228 | 235 | | |
229 | | - | |
| 236 | + | |
230 | 237 | | |
231 | 238 | | |
232 | 239 | | |
| |||
370 | 377 | | |
371 | 378 | | |
372 | 379 | | |
373 | | - | |
| 380 | + | |
| 381 | + | |
374 | 382 | | |
375 | 383 | | |
376 | 384 | | |
| |||
388 | 396 | | |
389 | 397 | | |
390 | 398 | | |
391 | | - | |
| 399 | + | |
392 | 400 | | |
393 | 401 | | |
394 | 402 | | |
395 | 403 | | |
396 | 404 | | |
397 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
398 | 408 | | |
399 | 409 | | |
400 | 410 | | |
| |||
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
| 131 | + | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
149 | 151 | | |
150 | 152 | | |
151 | | - | |
| 153 | + | |
| 154 | + | |
152 | 155 | | |
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
159 | | - | |
160 | | - | |
161 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
162 | 166 | | |
163 | 167 | | |
164 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
42 | 53 | | |
43 | 54 | | |
44 | 55 | | |
| |||
219 | 230 | | |
220 | 231 | | |
221 | 232 | | |
| 233 | + | |
222 | 234 | | |
223 | 235 | | |
224 | 236 | | |
| |||
242 | 254 | | |
243 | 255 | | |
244 | 256 | | |
245 | | - | |
| 257 | + | |
246 | 258 | | |
247 | | - | |
| 259 | + | |
| 260 | + | |
248 | 261 | | |
249 | 262 | | |
250 | 263 | | |
| |||
0 commit comments