Skip to content

Commit

Permalink
Exclude upsample_bilinear2d.vec and nearest2d.vec from default export…
Browse files Browse the repository at this point in the history
… decomposition table (#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
  • Loading branch information
GregoryComer authored and facebook-github-bot committed Dec 19, 2024
1 parent 2ed5ce3 commit c92975a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backends/xnnpack/_passes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# pyre-unsafe

from typing import List, Optional, Type

from executorch.backends.xnnpack._passes.channels_last_tagged_reshape_pass import (
Expand All @@ -14,9 +16,6 @@
)
from executorch.backends.xnnpack._passes.convert_to_linear import ConvertToLinearPass
from executorch.backends.xnnpack._passes.convert_to_sdpa import ConvertToSDPAPass
from executorch.backends.xnnpack._passes.convert_to_upsample_bilinear2d import (
ConvertToUpsampleBilinear2d,
)
from executorch.backends.xnnpack._passes.fuse_activation_pass import FuseActivationPass
from executorch.backends.xnnpack._passes.fuse_batch_norm_with_conv import (
FuseBatchNormWithConvPass,
Expand Down Expand Up @@ -57,7 +56,6 @@ def __init__(
self.passes = [
# TODO - remove this pass once we have a better support for dim_order ops lowering
DimOrderOpsRevertPass,
ConvertToUpsampleBilinear2d,
ConvertToLinearPass,
ConvertToSDPAPass,
ConstPropPass,
Expand Down

0 comments on commit c92975a

Please sign in to comment.