-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing reshape op so it supports reshaping of scalars (#1322)
- Loading branch information
1 parent
b192352
commit b663db2
Showing
5 changed files
with
27 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,7 +215,7 @@ jobs: | |
|
||
run-tests: | ||
|
||
timeout-minutes: 30 | ||
timeout-minutes: 45 | ||
needs: | ||
- build-image | ||
- build-ttmlir | ||
|
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
12 changes: 12 additions & 0 deletions
12
test/ttmlir/Dialect/TTNN/reshape/reshape_folding_test.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,12 @@ | ||
// RUN: ttmlir-opt --ttir-to-ttnn-backend-pipeline %s| FileCheck %s | ||
#any_device_tile = #tt.operand_constraint<dram|l1|tile|any_device_tile> | ||
// Tests if we fold when translating from "ttir.reshape" which is called on the two same shapes. | ||
module @reshape_test { | ||
func.func @main(%arg0: tensor<1xi32>) -> (tensor<1xi32> {jax.result_info = ""}) { | ||
%0 = tensor.empty() : tensor<1xi32> | ||
%1 = "ttir.reshape"(%arg0, %0) <{operand_constraints = [#any_device_tile, #any_device_tile], shape = [1 : i32]}> : (tensor<1xi32>, tensor<1xi32>) -> tensor<1xi32> | ||
// CHECK-NOT: %[[C:.*]] = "ttnn.reshape"[C:.*]] | ||
// CHECK: return %arg0 : tensor<1xi32, #{{.*}}> | ||
return %1 : tensor<1xi32> | ||
} | ||
} |