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.
Merge pull request #40 from ROCm/rocm-jaxlib-v0.4.31-qa-cleanup
Rocm jaxlib v0.4.31 qa cleanup
- Loading branch information
Showing
26 changed files
with
285 additions
and
43 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
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,35 @@ | ||
From a46b9e979ffa523bfed61487a2404e1f48140288 Mon Sep 17 00:00:00 2001 | ||
From: Dragan Mladjenovic <[email protected]> | ||
Date: Fri, 29 Mar 2024 12:27:36 +0000 | ||
Subject: [PATCH] Support gpu::ShuffleMode::DOWN lowering | ||
|
||
--- | ||
mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp | 6 +++++- | ||
1 file changed, 5 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp | ||
index e2cb3687d872..9317e30290c6 100644 | ||
--- a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp | ||
+++ b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp | ||
@@ -140,7 +140,7 @@ struct GPUShuffleOpLowering : public ConvertOpToLLVMPattern<gpu::ShuffleOp> { | ||
Value srcLaneId = getLaneId(rewriter, loc, indexBitwidth); | ||
|
||
auto int32Type = IntegerType::get(rewriter.getContext(), 32); | ||
Value width = adaptor.getWidth(); | ||
Value zero = rewriter.create<LLVM::ConstantOp>(loc, int32Type, 0); | ||
Value negwidth = rewriter.create<LLVM::SubOp>(loc, int32Type, zero, width); | ||
Value add = rewriter.create<LLVM::AddOp>(loc, int32Type, srcLaneId, width); | ||
@@ -151,6 +151,10 @@ struct GPUShuffleOpLowering : public ConvertOpToLLVMPattern<gpu::ShuffleOp> { | ||
// TODO: Use ds_swizzle for XOR when step/offsets are constants for better | ||
// perf. | ||
switch (op.getMode()) { | ||
+ case gpu::ShuffleMode::DOWN: | ||
+ dstLane = rewriter.create<LLVM::AddOp>(loc, int32Type, srcLaneId, | ||
+ adaptor.getOffset()); | ||
+ break; | ||
case gpu::ShuffleMode::XOR: | ||
dstLane = rewriter.create<LLVM::XOrOp>(loc, int32Type, srcLaneId, | ||
adaptor.getOffset()); | ||
-- | ||
2.25.1 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
From a46b9e979ffa523bfed61487a2404e1f48140288 Mon Sep 17 00:00:00 2001 | ||
From: Dragan Mladjenovic <[email protected]> | ||
Date: Fri, 29 Mar 2024 12:27:36 +0000 | ||
Subject: [PATCH] Support gpu::ShuffleMode::DOWN lowering | ||
|
||
--- | ||
mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp | 6 +++++- | ||
1 file changed, 5 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp | ||
index e2cb3687d872..9317e30290c6 100644 | ||
--- a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp | ||
+++ b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp | ||
@@ -140,7 +140,7 @@ struct GPUShuffleOpLowering : public ConvertOpToLLVMPattern<gpu::ShuffleOp> { | ||
Value srcLaneId = getLaneId(rewriter, loc, indexBitwidth); | ||
|
||
auto int32Type = IntegerType::get(rewriter.getContext(), 32); | ||
Value width = adaptor.getWidth(); | ||
Value zero = rewriter.create<LLVM::ConstantOp>(loc, int32Type, 0); | ||
Value negwidth = rewriter.create<LLVM::SubOp>(loc, int32Type, zero, width); | ||
Value add = rewriter.create<LLVM::AddOp>(loc, int32Type, srcLaneId, width); | ||
@@ -151,6 +151,10 @@ struct GPUShuffleOpLowering : public ConvertOpToLLVMPattern<gpu::ShuffleOp> { | ||
// TODO: Use ds_swizzle for XOR when step/offsets are constants for better | ||
// perf. | ||
switch (op.getMode()) { | ||
+ case gpu::ShuffleMode::DOWN: | ||
+ dstLane = rewriter.create<LLVM::AddOp>(loc, int32Type, srcLaneId, | ||
+ adaptor.getOffset()); | ||
+ break; | ||
case gpu::ShuffleMode::XOR: | ||
dstLane = rewriter.create<LLVM::XOrOp>(loc, int32Type, srcLaneId, | ||
adaptor.getOffset()); | ||
-- | ||
2.25.1 | ||
|
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
Oops, something went wrong.