-
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.
Reland fix to multi-row reduction triggering.
Apparently there was no actual breakage, just a numerically unstable model. Reverts 87e62ee PiperOrigin-RevId: 679548584
- Loading branch information
1 parent
7ea3146
commit 9b1056c
Showing
3 changed files
with
140 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// RUN: fusion_to_mlir %s | mlir_fusions_opt -xla-gpu-test-optimize \ | ||
// RUN: -xla-gpu-test-transform-loops | FileCheck %s | ||
|
||
// The reference implementation reduces in f64, so we need a larger tolerance. | ||
// RUN: test_correctness %s --bijection_inputs=reduce:0 \ | ||
// RUN: --bijection_outputs=reduce --abs_error_bound=0.005 --rel_error_bound=0.005 | ||
|
||
add { | ||
lhs = f16[] parameter(0) | ||
rhs = f16[] parameter(1) | ||
ROOT add = f16[] add(lhs, rhs) | ||
} | ||
|
||
fusion { | ||
param_0 = f16[2048,64] parameter(0) | ||
c = f16[] constant(0) | ||
ROOT reduce = f16[2048] reduce(param_0, c), dimensions={1}, to_apply=add | ||
} | ||
|
||
// If unvectorized, this would be a regular row reduction. However, since we can | ||
// vectorize to size four, we can emit this as a multi-row reduction. | ||
// CHECK: vector.transfer_read {{.*}} vector<4xf16> |