forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Codegen][GPU] Allow iree_gpu.tensor_barrier to take vectors (iree-or…
…g#17479) This allows synchronizing on vectors as well as tensors with similar semantics. In a typical lowering flow, this will represent the read equivalent to a tensor barrier, in that a tensor barrier represents a wait until all writes to a shared allocation has finished, while this represents a wait until all threads have read the value they need from that shared allocation. Renames the operation to iree_gpu.value_barrier for clarity.
- Loading branch information
Showing
12 changed files
with
132 additions
and
31 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
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
21 changes: 21 additions & 0 deletions
21
.../src/iree/compiler/Codegen/Dialect/GPU/TransformExtensions/test/lower_vector_barrier.mlir
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,21 @@ | ||
// RUN: iree-opt %s -iree-transform-dialect-interpreter -transform-dialect-drop-schedule --split-input-file | FileCheck %s | ||
|
||
func.func @lower_value_barrier(%input: vector<4xf32>) -> vector<4xf32> { | ||
%0 = iree_gpu.value_barrier %input : vector<4xf32> | ||
return %0 : vector<4xf32> | ||
} | ||
|
||
module attributes { transform.with_named_sequence } { | ||
transform.named_sequence @__transform_main(%root: !transform.any_op {transform.readonly}) { | ||
%func = transform.structured.match ops{["func.func"]} in %root : (!transform.any_op) -> !transform.any_op | ||
transform.apply_patterns to %func { | ||
transform.apply_patterns.iree.lower_value_barrier | ||
} : !transform.any_op | ||
transform.yield | ||
} | ||
} | ||
|
||
// CHECK-LABEL: func @lower_value_barrier | ||
// CHECK-SAME: %[[INPUT:[A-Za-z0-9]+]]: vector<4xf32> | ||
// CHECK-NEXT: gpu.barrier | ||
// CHECK-NEXT: return %[[INPUT]] |
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