-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow vectorization in DynamicUpdateSlice in-place emitter.
We can use the same conditions for when to allow vectorization as for loop fusion. PiperOrigin-RevId: 678591064
- Loading branch information
1 parent
e0b9573
commit 46c95ae
Showing
5 changed files
with
37 additions
and
4 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
14 changes: 14 additions & 0 deletions
14
xla/service/gpu/fusions/tests/dynamic_update_slice/vectorize_x1_too_small.hlo
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,14 @@ | ||
// RUN: fusion_to_mlir %s | mlir_fusions_opt -xla-gpu-test-optimize \ | ||
// RUN: -xla-gpu-test-transform-loops | FileCheck %s | ||
// RUN: test_correctness %s --bijection_inputs=dus:1 | ||
|
||
dus { | ||
%input = f32[40,40,300] parameter(0) | ||
%update = f32[1,1,40] parameter(1) | ||
%idx = s32[] parameter(2) | ||
%zero = s32[] constant(0) | ||
ROOT dus = f32[40,40,300] dynamic-update-slice(%input, %update, %idx, %zero, %zero) | ||
} | ||
|
||
// CHECK-NOT: vector.transfer_read {{.*}} vector<4xf32> | ||
// CHECK-NOT: vector.transfer_write {{.*}} vector<4xf32> |
14 changes: 14 additions & 0 deletions
14
xla/service/gpu/fusions/tests/dynamic_update_slice/vectorize_x4.hlo
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,14 @@ | ||
// RUN: fusion_to_mlir %s | mlir_fusions_opt -xla-gpu-test-optimize \ | ||
// RUN: -xla-gpu-test-transform-loops | FileCheck %s | ||
// RUN: test_correctness %s --bijection_inputs=dus:1 | ||
|
||
dus { | ||
%input = f32[40,40,300] parameter(0) | ||
%update = f32[20,40,300] parameter(1) | ||
%idx = s32[] parameter(2) | ||
%zero = s32[] constant(0) | ||
ROOT dus = f32[40,40,300] dynamic-update-slice(%input, %update, %idx, %zero, %zero) | ||
} | ||
|
||
// CHECK: vector.transfer_read {{.*}} vector<4xf32> | ||
// CHECK: vector.transfer_write {{.*}} vector<4xf32> |