-
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.
Convert stablehlo.composite ops to func.call ops before converting to…
… TTIR so that the TTIR inliner can inline them
- Loading branch information
Showing
3 changed files
with
19 additions
and
0 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 |
---|---|---|
|
@@ -17,4 +17,5 @@ add_mlir_library(TTMLIRStableHLOToTTIR | |
LINK_LIBS PUBLIC | ||
MLIRIR | ||
MLIRPass | ||
StablehloPasses | ||
) |
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,16 @@ | ||
// REQUIRES: stablehlo | ||
// RUN: ttmlir-opt --stablehlo-to-ttir-pipeline %s | FileCheck %s | ||
module @jit_eltwise_add attributes {} { | ||
func.func private @add_impl(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> { | ||
%0 = stablehlo.add %arg0, %arg1 : tensor<13x21x3xf32> | ||
return %0 : tensor<13x21x3xf32> | ||
} | ||
|
||
func.func public @main(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x21x3xf32>) -> tensor<13x21x3xf32> { | ||
%results = stablehlo.composite "jit_eltwise_add.my_add" %arg0, %arg1 { | ||
decomposition = @add_impl | ||
} : (tensor<13x21x3xf32>, tensor<13x21x3xf32>) -> tensor<13x21x3xf32> | ||
// CHECK: %[[C:.*]] = call @add_impl [[C:.*]] | ||
return %results : tensor<13x21x3xf32> | ||
} | ||
} |