Skip to content

Commit 2e5be22

Browse files
GregoryComerfacebook-github-bot
authored andcommitted
Cleanup XNN delegate post removal of upsample decomposition
Summary: Following the removal of the decompositions for upsample_bilinear2d in PyTorch, we don't need to pattern match and recompose upsample_bilinear2d. This PR cleans up the convert_to_upsample_bilinear2d pass and associated logic. Differential Revision: D68374585
1 parent 24671a9 commit 2e5be22

File tree

4 files changed

+2
-136
lines changed

4 files changed

+2
-136
lines changed

backends/xnnpack/_passes/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
)
1515
from executorch.backends.xnnpack._passes.convert_to_linear import ConvertToLinearPass
1616
from executorch.backends.xnnpack._passes.convert_to_sdpa import ConvertToSDPAPass
17-
from executorch.backends.xnnpack._passes.convert_to_upsample_bilinear2d import (
18-
ConvertToUpsampleBilinear2d,
19-
)
2017
from executorch.backends.xnnpack._passes.decompose_cat import DecomposeConcatenate
2118
from executorch.backends.xnnpack._passes.fuse_activation_pass import FuseActivationPass
2219
from executorch.backends.xnnpack._passes.fuse_batch_norm_with_conv import (
@@ -58,7 +55,6 @@ def __init__(
5855
self.passes = [
5956
# TODO - remove this pass once we have a better support for dim_order ops lowering
6057
DimOrderOpsRevertPass,
61-
ConvertToUpsampleBilinear2d,
6258
ConvertToLinearPass,
6359
ConvertToSDPAPass,
6460
ConstPropPass,

backends/xnnpack/_passes/convert_to_upsample_bilinear2d.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

backends/xnnpack/partition/graphs/bilinear_2d.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

backends/xnnpack/test/ops/test_bilinear2d.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,9 @@ def test_fp32_bilinear2d_dynamic_bilinear2d_not_partitioned(self):
133133
3: torch.export.Dim("w", min=1, max=12),
134134
}
135135
}
136-
artifact_str = str(
136+
(
137137
Tester(self.StaticResizeBilinear2dModule(), example_inputs)
138138
.export(Export(dynamic_shapes))
139139
.to_edge_transform_and_lower()
140-
.get_artifact()
141-
.exported_program()
142-
)
143-
# NOTE The decomposition can be partially delegated. This will need to be replaced
144-
# with the aten upsample op once decomp is removed.
145-
self.assertTrue(
146-
"executorch_exir_dialects_edge__ops_aten_index_Tensor" in artifact_str
147-
or "executorch_exir_dialects_edge__ops_aten_upsample_bilinear2d_vec"
148-
in artifact_str
140+
.check("executorch_exir_dialects_edge__ops_aten_upsample_bilinear2d_vec")
149141
)

0 commit comments

Comments
 (0)