Skip to content

Commit c92975a

Browse files
GregoryComerfacebook-github-bot
authored andcommitted
Exclude upsample_bilinear2d.vec and nearest2d.vec from default export decomposition table (pytorch#7126)
Summary: As upsample_bilinear2d.vec and upsample_nearest2d.vec are core ATen ops, they should not be decomposed by default in the export path. Because the operators have CompositeImplicitAutograd dispatch, their decomposition is registered by default. This change adds an override list for CIA decompositions being registered in the default decomp table. In the long-term, we likely will want to exclude decompositions for all core-tagged CIA ops, but this will require all consumers to be ready to handle the remaining two ops, avg_pool1d, and adaptive_avg_pool1d. Until they are ready, I believe an explicit override list is the safest option. Additionally, I've also removed the ExecuTorch XNNPACK delegate ConvertToUpsampleBilinear2d pass, as the pass breaks (and is not needed), given that the op is not decomposed. The purpose of this pass was originally to pattern match the decomposition and un-decomposite it, but this is no longer necessary. X-link: pytorch/pytorch#141791 Reviewed By: StellarrZ Differential Revision: D66575454
1 parent 2ed5ce3 commit c92975a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

backends/xnnpack/_passes/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7+
# pyre-unsafe
8+
79
from typing import List, Optional, Type
810

911
from executorch.backends.xnnpack._passes.channels_last_tagged_reshape_pass import (
@@ -14,9 +16,6 @@
1416
)
1517
from executorch.backends.xnnpack._passes.convert_to_linear import ConvertToLinearPass
1618
from executorch.backends.xnnpack._passes.convert_to_sdpa import ConvertToSDPAPass
17-
from executorch.backends.xnnpack._passes.convert_to_upsample_bilinear2d import (
18-
ConvertToUpsampleBilinear2d,
19-
)
2019
from executorch.backends.xnnpack._passes.fuse_activation_pass import FuseActivationPass
2120
from executorch.backends.xnnpack._passes.fuse_batch_norm_with_conv import (
2221
FuseBatchNormWithConvPass,
@@ -57,7 +56,6 @@ def __init__(
5756
self.passes = [
5857
# TODO - remove this pass once we have a better support for dim_order ops lowering
5958
DimOrderOpsRevertPass,
60-
ConvertToUpsampleBilinear2d,
6159
ConvertToLinearPass,
6260
ConvertToSDPAPass,
6361
ConstPropPass,

0 commit comments

Comments
 (0)