Skip to content

Commit 136c1cc

Browse files
authored
Merge pull request #305 from Xilinx/jrickert.lower_to_linalg
Add Lowering for xten.resize, xten.grid_sample and xten.reduce_mean to linalg
2 parents c04c356 + 392b340 commit 136c1cc

11 files changed

Lines changed: 1918 additions & 6 deletions

File tree

include/xten/Conversion/Passes.td

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ def XTenNNToTosa : Pass<"xten-nn-to-tosa", "ModuleOp"> {
3333
let description = [{
3434
Partial conversion of XTenNN operations to TOSA.
3535

36-
This pass only converts XTenNN quantize and dequantize operations
37-
who operate on signed integer tensors to TOSA.
36+
This pass converts XTenNN quantize and dequantize operations
37+
who operate on signed integer tensors to TOSA. It can also optionally
38+
decompose XTenNN depth_to_space operations to TOSA.
3839

3940
Currently, unsigned integer tensor support in TOSA does not allow
4041
lowerings of operations like:
@@ -49,6 +50,13 @@ def XTenNNToTosa : Pass<"xten-nn-to-tosa", "ModuleOp"> {
4950
"mlir::tosa::TosaDialect",
5051
"amd::xten_nn::XTenNNDialect"
5152
];
53+
let options = [
54+
Option<"enableDepthToSpaceDecomposition",
55+
"enable-depth-to-space-decomposition",
56+
"bool",
57+
/*default=*/"false",
58+
"Enable decomposition of xten_nn.depth_to_space to TOSA.">,
59+
];
5260
}
5361

5462
def ConvertXTenNNToLinalg : Pass<"convert-xtennn-to-linalg", "mlir::func::FuncOp"> {

include/xten/Conversion/XTenNNToTosaPass.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ namespace amd {
1919
namespace xten_nn {
2020

2121
std::unique_ptr<mlir::Pass> createXTenNNToTOSAPass();
22+
std::unique_ptr<mlir::Pass>
23+
createXTenNNToTOSAPass(bool enableDepthToSpaceDecomposition);
2224

2325
} // namespace xten_nn
2426
} // namespace amd

0 commit comments

Comments
 (0)