forked from openxla/xla
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PR openxla#14605: [ROCm] Switch on Triton feature for ROCm. Imported from GitHub PR openxla#14605 Last in series of commits to switch on Triton in XLA for ROCm. This is new version of: openxla#13003 Changes in third_party/triton/temporary/amd_pr7.patch are already merged on: triton-lang/triton#4238 Copybara import of the project: -- c2ce7e0 by Zoran Jovanovic <[email protected]>: [ROCm] Switch on Triton feature for ROCm. -- 563b303 by Zoran Jovanovic <[email protected]>: [ROCm] Fixed an issue with test cases from ir_emitter_triton_test.cc -- a4d2ad8 by Zoran Jovanovic <[email protected]>: [ROCm] Fixed an issue with gpu_compiler_test.cc -- a1b9260 by Zoran Jovanovic <[email protected]>: [ROCm] Applied comments from code review. -- c694a95 by Zoran Jovanovic <[email protected]>: [ROCm] Fixed failed tests because of openxla@19c11ba -- 7359619 by Zoran Jovanovic <[email protected]>: [ROCm] Fixed compilation issue with latest rebase. -- 82f58ce by Zoran Jovanovic <[email protected]>: [ROCm] Skip SplitLHSInputOutputIsFused test in ir_emitter_triton_test.cc untill issue is fixed. -- 57e776b by Zoran Jovanovic <[email protected]>: [ROCm] Triton related changes merged thus removed amd_pr7.patch -- 0d09d0e by Zoran Jovanovic <[email protected]>: [ROCm] Applied comments from code review. -- 7b11147 by Zoran Jovanovic <[email protected]>: [ROCm] Applied comments from code review. -- 9e7e0c7 by Zoran Jovanovic <[email protected]>: [ROCm] Modified TestNoAutotuner test case. Merging this change closes openxla#14605 COPYBARA_INTEGRATE_REVIEW=openxla#14605 from ROCm:rocm_triton_backend_8 9e7e0c7 PiperOrigin-RevId: 652449567 * Fixed test issues.
- Loading branch information
1 parent
bf81e49
commit 98a8fe9
Showing
13 changed files
with
114 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
diff --git a/third_party/amd/lib/TritonAMDGPUToLLVM/ElementwiseOpToLLVM.cpp b/third_party/amd/lib/TritonAMDGPUToLLVM/ElementwiseOpToLLVM.cpp | ||
index b0976f8..bcdc5c7 100644 | ||
--- a/third_party/amd/lib/TritonAMDGPUToLLVM/ElementwiseOpToLLVM.cpp | ||
+++ b/third_party/amd/lib/TritonAMDGPUToLLVM/ElementwiseOpToLLVM.cpp | ||
@@ -956,6 +956,22 @@ struct FpToFpOpConversion | ||
for (unsigned i = 0; i < std::min(numElements, operands.size()); i++) { | ||
inVals.push_back(operands[i][0]); | ||
} | ||
+ | ||
+ bool isSrcFP16 = srcElementType.isF16(); | ||
+ bool isSrcBF16 = srcElementType.isBF16(); | ||
+ | ||
+ if ((isSrcFP16 || isSrcBF16) | ||
+ && isDstFP32) { | ||
+ SmallVector<Value> outVals; | ||
+ for (Value &v : inVals) { | ||
+ if(isSrcFP16) | ||
+ outVals.push_back(convertFp16ToFp32(loc, rewriter, v)); | ||
+ else | ||
+ outVals.push_back(convertBf16ToFp32(loc, rewriter, v)); | ||
+ } | ||
+ return outVals; | ||
+ } | ||
+ | ||
if (useFP16IntermediateSrc) | ||
for (Value &v : inVals) | ||
v = cvtFp32ToFp16(loc, rewriter, v, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters