Skip to content

Commit 5ded7d0

Browse files
authored
[tosa] Add tosa-to-standard before tosa-to-linalg pass (#524)
Signed-off-by: Suraj Sudhir <[email protected]>
1 parent c9a3432 commit 5ded7d0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

e2e_testing/torchscript/xfail_sets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@
5050
"SqueezeDimModule_identity",
5151
"SqueezeDimModule_unitDim",
5252
"ReturnTwoTensorF32I64_basic",
53+
"ElementwisePowModule_basic",
5354
}

python/torch_mlir_e2e_test/tosa_backends/linalg_on_tensors.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ def compile(self, imported_module: Module):
3737
passed to `load`.
3838
"""
3939

40+
# TOSA legalization may emit tosa.const() ops. These are legalized
41+
# by tosa-to-standard to arith.constants. This mechanical transformation
42+
# must be done prior to TOSA-to-LinAlg so that the latter does not fail.
43+
# This is an artifact of legalizations spread across a collection of simple
44+
# ones in TOSA-to-Standard and the main conversions TOSA-to-LinAlg,
45+
# that depend on TOSA as well as TOSA-to-Standard.
46+
run_pipeline_with_repro_report(
47+
imported_module,
48+
"builtin.func(tosa-to-standard)",
49+
"Lowering TOSA to Standard")
50+
4051
run_pipeline_with_repro_report(
4152
imported_module,
4253
"builtin.func(tosa-to-linalg)",

0 commit comments

Comments
 (0)