forked from triton-lang/triton
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cpu] Don't reuse shuffle dummies (#88)
This results in the following compile-time assertion error (in debug Triton builds): Assertion `Index < size() && "invalid index for value range"' failed. This occurs when there is more than one tt.reduce call with a given number of arguments in the same function, with the later call using more arguments. Reusing the dummy values means that the subsequent call has fewer dummy values than expected, hence the error. This bug also resulted in type mismatches errors between the reused dummy value and the current input value.
- Loading branch information
Showing
5 changed files
with
37 additions
and
12 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,18 @@ | ||
// RUN: triton-opt %s -split-input-file -triton-cpu-convert-reduction -canonicalize | ||
|
||
// Regression test: Check that we handle consecutive calls to tt.reduce with | ||
// different types & number of arguments. | ||
|
||
module { | ||
tt.func public @triton_(%arg0: tensor<1x4xf32>, %arg1: tensor<1x4xi32>) { | ||
%0 = "tt.reduce"(%arg0) <{axis = 1 : i32}> ({ | ||
^bb0(%arg3: f32, %arg4: f32): | ||
tt.reduce.return %arg3 : f32 | ||
}) : (tensor<1x4xf32>) -> tensor<1xf32> | ||
%1:2 = "tt.reduce"(%arg0, %arg1) <{axis = 1 : i32}> ({ | ||
^bb0(%arg3: f32, %arg4: i32, %arg5: f32, %arg6: i32): | ||
tt.reduce.return %arg3, %arg4 : f32, i32 | ||
}) : (tensor<1x4xf32>, tensor<1x4xi32>) -> (tensor<1xf32>, tensor<1xi32>) | ||
tt.return | ||
} | ||
} |
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