Commit 2e5d65e
PR tensorflow#34806: [ROCm] fix the calling convention for AMD GPU
Imported from GitHub PR openxla/xla#34806
Bugfix: PR tensorflow#34230 ("argument removal without building prototype") removed the call to **BuildKernelPrototypeFromUniqueName** which internally called **AnnotateFunctionAsGpuKernel** to set the correct calling convention based on the target GPU. Without this, Triton's **PTX_Kernel** calling convention was copied directly, which doesn't work on AMD GPUs and lead to "LLVM ERROR: unsupported calling convention".
Fix: Added a call to **AnnotateFunctionAsGpuKernel** in **RemoveUnusedTritonAbiArguments** to properly set:
PTX_Kernel (71) for NVIDIA
AMDGPU_KERNEL (91) for AMD
SPIR_KERNEL (76) for SPIR
@xla-rotation could you review my PR, please?
Copybara import of the project:
--
ebd6e1fa03033bc9f6913351323fce26e1a8e4d2 by Songlin Piao <Songlin.Piao@amd.com>:
replace the manual calling convention fix with AnnotateFunctionAsGpuKernel
--
4f16d9579b11c2984c8ebe58041b0d2b9ea5ba3f by Songlin Piao <Songlin.Piao@amd.com>:
added a filecheck test
Merging this change closes tensorflow#34806
PiperOrigin-RevId: 8421465801 parent 692e221 commit 2e5d65e
3 files changed
Lines changed: 35 additions & 1 deletion
File tree
- third_party/xla/xla
- backends/gpu/codegen
- service/gpu/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
270 | 269 | | |
271 | 270 | | |
272 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
273 | 278 | | |
274 | 279 | | |
275 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
| 664 | + | |
664 | 665 | | |
665 | 666 | | |
666 | 667 | | |
| |||
673 | 674 | | |
674 | 675 | | |
675 | 676 | | |
| 677 | + | |
676 | 678 | | |
677 | 679 | | |
678 | 680 | | |
679 | 681 | | |
| 682 | + | |
680 | 683 | | |
681 | 684 | | |
682 | 685 | | |
| |||
Lines changed: 26 additions & 0 deletions
| 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 | + | |
0 commit comments