Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backends/arm/_passes/arm_pass_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
UnsqueezeBeforeRepeatPass,
UnsqueezeScalarPlaceholdersPass,
)
from executorch.backends.arm.tosa_specification import (

from executorch.backends.arm.tosa.specification import (
TosaLoweringContext,
TosaSpecification,
)
Expand Down
6 changes: 5 additions & 1 deletion backends/arm/_passes/decompose_meandim_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import torch
from executorch.backends.arm._passes import ArmPass
from executorch.backends.arm._passes.arm_pass_utils import get_node_arg
from executorch.backends.arm.operator_support.pool_2d_support import AvgPool2dSupported
from executorch.exir.backend.utils import WhyNoPartitionReporter
from executorch.exir.dialects._ops import ops as exir_ops

Expand Down Expand Up @@ -67,6 +66,11 @@ def __init__(self, graph_module, tosa_spec):
super().__init__()
self._graph_module = graph_module
self._tosa_spec = tosa_spec
# Lazy import to avoid circular dependency with operator_support
from executorch.backends.arm.operator_support.pool_2d_support import (
AvgPool2dSupported,
)

self._avg_pool_checker = AvgPool2dSupported(
self._tosa_spec, WhyNoPartitionReporter()
)
Expand Down
4 changes: 1 addition & 3 deletions backends/arm/arm_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
from enum import Enum
from typing import List, Optional

from executorch.backends.arm.tosa_specification import ( # type: ignore[import-not-found]
TosaSpecification,
)
from executorch.backends.arm.tosa import TosaSpecification

from executorch.exir.backend.compile_spec_schema import ( # type: ignore[import-not-found]
CompileSpec,
Expand Down
2 changes: 1 addition & 1 deletion backends/arm/ethosu/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from executorch.backends.arm.arm_vela import vela_compile

from executorch.backends.arm.tosa_backend import TOSABackend
from executorch.backends.arm.tosa.backend import TOSABackend
from executorch.exir.backend.backend_details import BackendDetails, PreprocessResult
from executorch.exir.backend.compile_spec_schema import CompileSpec
from torch.export.exported_program import ExportedProgram
Expand Down
2 changes: 1 addition & 1 deletion backends/arm/ethosu/partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
is_ethosu,
) # usort: skip
from executorch.backends.arm.ethosu import EthosUBackend
from executorch.backends.arm.tosa_partitioner import TOSAPartitioner
from executorch.backends.arm.tosa.partitioner import TOSAPartitioner
from executorch.exir.backend.compile_spec_schema import CompileSpec
from executorch.exir.backend.partitioner import DelegationSpec
from torch.fx.passes.operator_support import OperatorSupportBase
Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operator_support/clone_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
register_tosa_support_check,
SupportedTOSAOperatorCheck,
)
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.exir.dialects._ops import ops as exir_ops

logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operator_support/convolution_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
register_tosa_support_check,
SupportedTOSAOperatorCheck,
)
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification

from executorch.exir.dialects._ops import ops as exir_ops

Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operator_support/embedding_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
register_tosa_support_check,
SupportedTOSAOperatorCheck,
)
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.exir.dialects._ops import ops as exir_ops


Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operator_support/ethos_u55_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from executorch.backends.arm._passes.arm_pass_utils import get_first_fake_tensor
from executorch.backends.arm._passes.insert_table_ops import TableOps
from executorch.backends.arm.operators.op_permute import transform_permutation_vector
from executorch.backends.arm.tosa_utils import tosa_shape
from executorch.backends.arm.tosa.utils import tosa_shape
from executorch.exir.backend.utils import WhyNoPartitionReporter
from executorch.exir.dialects._ops import ops as exir_ops
from torch.fx.passes.operator_support import OperatorSupportBase
Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operator_support/index_select_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
register_tosa_support_check,
SupportedTOSAOperatorCheck,
)
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.exir.dialects._ops import ops as exir_ops


Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operator_support/index_tensor_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
register_tosa_support_check,
SupportedTOSAOperatorCheck,
)
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.exir.dialects._ops import ops as exir_ops


Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operator_support/minmax_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
register_tosa_support_check,
SupportedTOSAOperatorCheck,
)
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.exir.dialects._ops import ops as exir_ops


Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operator_support/pool_2d_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from executorch.backends.arm.operators.operator_validation_utils import (
adjust_pooling_pad_if_needed,
)
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.exir.dialects._ops import ops as exir_ops


Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operator_support/reduce_sum_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
register_tosa_support_check,
SupportedTOSAOperatorCheck,
)
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.exir.dialects._ops import ops as exir_ops


Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operator_support/right_shift_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
register_tosa_support_check,
SupportedTOSAOperatorCheck,
)
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.exir.dialects._ops import ops as exir_ops

logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operator_support/sin_cos_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
register_tosa_support_check,
SupportedTOSAOperatorCheck,
)
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.exir.dialects._ops import ops as exir_ops


Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operator_support/slice_copy_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
register_tosa_support_check,
SupportedTOSAOperatorCheck,
)
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.exir.dialects._ops import ops as exir_ops

logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operator_support/to_copy_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
register_tosa_support_check,
SupportedTOSAOperatorCheck,
)
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.exir.dialects._ops import ops as exir_ops

logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
EthosU55TransposeCheck,
EthosU55ViewCheck,
)
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.exir import ExportedProgram
from executorch.exir.backend.utils import WhyNoPartitionReporter
from executorch.exir.dialects._ops import ops as exir_ops
Expand Down
4 changes: 2 additions & 2 deletions backends/arm/operators/node_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import torch

from executorch.backends.arm.debug.schema import DebugHook
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa.mapping import TosaArg
from executorch.backends.arm.tosa.specification import TosaSpecification
from torch.export import ExportedProgram


Expand Down
8 changes: 4 additions & 4 deletions backends/arm/operators/op_abs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# pyre-unsafe
from typing import Any, List

import executorch.backends.arm.tosa_quant_utils as tqutils
import executorch.backends.arm.tosa_utils as tutils
import executorch.backends.arm.tosa.quant_utils as tqutils
import executorch.backends.arm.tosa.utils as tutils

from executorch.backends.arm.operators.node_visitor import (
NodeVisitor,
Expand All @@ -18,8 +18,8 @@
validate_same_dtype,
validate_valid_dtype,
)
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.backends.arm.tosa.mapping import TosaArg
from torch.fx import Node


Expand Down
8 changes: 4 additions & 4 deletions backends/arm/operators/op_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

from typing import Any, List

import executorch.backends.arm.tosa_quant_utils as tqutils
import executorch.backends.arm.tosa_utils as tutils
import executorch.backends.arm.tosa.quant_utils as tqutils
import executorch.backends.arm.tosa.utils as tutils

from executorch.backends.arm.operators.node_visitor import (
NodeVisitor,
Expand All @@ -19,8 +19,8 @@
validate_same_dtype,
validate_valid_dtype,
)
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.backends.arm.tosa.mapping import TosaArg
from torch.fx import Node


Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operators/op_amax.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
validate_same_dtype,
validate_valid_dtype,
)
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa.mapping import TosaArg
from torch.fx import Node


Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operators/op_amin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
validate_same_dtype,
validate_valid_dtype,
)
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa.mapping import TosaArg
from torch.fx import Node


Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operators/op_any.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
validate_valid_dtype,
)

from executorch.backends.arm.tosa_mapping import TosaArg # type: ignore
from executorch.backends.arm.tosa.mapping import TosaArg # type: ignore
from torch.fx import Node


Expand Down
4 changes: 2 additions & 2 deletions backends/arm/operators/op_avg_pool2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
validate_same_dtype,
validate_valid_dtype,
)
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.backends.arm.tosa.mapping import TosaArg


@register_node_visitor
Expand Down
6 changes: 3 additions & 3 deletions backends/arm/operators/op_bmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
validate_same_dtype,
validate_valid_dtype,
)
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa_quant_utils import build_rescale
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.backends.arm.tosa.mapping import TosaArg
from executorch.backends.arm.tosa.quant_utils import build_rescale
from tosa.RoundingMode import RoundingMode # type: ignore


Expand Down
2 changes: 1 addition & 1 deletion backends/arm/operators/op_cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from executorch.backends.arm.operators.operator_validation_utils import (
validate_num_inputs,
)
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa.mapping import TosaArg
from torch.fx import Node


Expand Down
4 changes: 2 additions & 2 deletions backends/arm/operators/op_clamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
validate_same_dtype,
validate_valid_dtype,
)
from executorch.backends.arm.tosa import TosaSpecification

from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa.mapping import TosaArg
from torch.fx import Node


Expand Down
4 changes: 2 additions & 2 deletions backends/arm/operators/op_constant_pad_nd.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
validate_same_dtype,
validate_valid_dtype,
)
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.backends.arm.tosa.mapping import TosaArg


@register_node_visitor
Expand Down
8 changes: 4 additions & 4 deletions backends/arm/operators/op_conv2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
from executorch.backends.arm.operators.operator_validation_utils import (
validate_num_inputs,
)
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa_quant_utils import build_rescale
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa_utils import tosa_shape
from executorch.backends.arm.tosa import TosaSpecification
from executorch.backends.arm.tosa.mapping import TosaArg
from executorch.backends.arm.tosa.quant_utils import build_rescale
from executorch.backends.arm.tosa.utils import tosa_shape


@register_node_visitor
Expand Down
4 changes: 2 additions & 2 deletions backends/arm/operators/op_cos.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
validate_same_dtype,
validate_valid_dtype,
)
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.backends.arm.tosa.mapping import TosaArg
from torch.fx import Node


Expand Down
6 changes: 3 additions & 3 deletions backends/arm/operators/op_eq.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from typing import Any, List

import executorch.backends.arm.tosa_quant_utils as tqutils
import executorch.backends.arm.tosa.quant_utils as tqutils

from executorch.backends.arm.operators.node_visitor import (
NodeVisitor,
Expand All @@ -18,8 +18,8 @@
validate_same_dtype,
validate_valid_dtype,
)
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.backends.arm.tosa.mapping import TosaArg

from torch.fx import Node

Expand Down
4 changes: 2 additions & 2 deletions backends/arm/operators/op_erf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
validate_same_dtype,
validate_valid_dtype,
)
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.backends.arm.tosa.mapping import TosaArg


@register_node_visitor
Expand Down
4 changes: 2 additions & 2 deletions backends/arm/operators/op_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
validate_same_dtype,
validate_valid_dtype,
)
from executorch.backends.arm.tosa_mapping import TosaArg
from executorch.backends.arm.tosa_specification import TosaSpecification
from executorch.backends.arm.tosa import TosaSpecification
from executorch.backends.arm.tosa.mapping import TosaArg
from torch.fx import Node


Expand Down
Loading
Loading