Skip to content
Open
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
29 changes: 28 additions & 1 deletion backends/arm/_passes/TARGETS
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")

# Core utilities that other passes depend on
runtime.python_library(
name = "core",
srcs = [
"arm_pass.py",
"arm_pass_utils.py",
"quant_args.py",
],
deps = [
"//executorch/backends/arm:common",
"//executorch/backends/arm:constants",
"//executorch/backends/arm/tosa:utils",
"//executorch/backends/arm/tosa/dialect:lib",
"//executorch/backends/transforms:utils",
"//executorch/exir:lib",
],
)

runtime.python_library(
name = "passes",
srcs = glob(["*.py"]),
srcs = glob(
["*.py"],
exclude = [
"arm_pass.py",
"arm_pass_utils.py",
"quant_args.py",
],
),
deps = [
":core",
"//executorch/backends/arm:common",
"//executorch/backends/arm:constants",
"//executorch/backends/arm/_passes/fb:fb",
"//executorch/backends/arm/tosa:utils",
"//executorch/backends/arm/tosa/dialect:lib",
"//executorch/backends/transforms:fuse_view_copy",
Expand Down
2 changes: 2 additions & 0 deletions backends/arm/_passes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


from . import arm_pass_utils # noqa
from . import fb

Check failure on line 8 in backends/arm/_passes/__init__.py

View workflow job for this annotation

GitHub Actions / lintrunner-mypy / linux-job

MYPY attr-defined

Module "backends.arm._passes" has no attribute "fb" To disable, use ` # type: ignore[attr-defined]`
from .arm_pass import ArmPass # noqa # usort: skip
from .annotate_decomposed_matmul import AnnotateDecomposedMatmulPass # noqa
from .annotate_output_dim_order_pass import AnnotateOutputDimOrderPass # noqa
Expand Down Expand Up @@ -80,6 +81,7 @@
)
from .decompose_var_pass import DecomposeVarPass # noqa
from .decorate_fp32_to_int32_casting_pass import DecorateFp32toInt32CastingPass # noqa
from .fb.reciprocal_dual_lut_pass import ReciprocalDualLutPass # noqa

Check failure on line 84 in backends/arm/_passes/__init__.py

View workflow job for this annotation

GitHub Actions / lintrunner-mypy / linux-job

MYPY import-not-found

Cannot find implementation or library stub for module named "backends.arm._passes.fb.reciprocal_dual_lut_pass" To disable, use ` # type: ignore[import-not-found]`
from .fold_qdq_with_annotated_qparams_pass import ( # noqa
FoldAndAnnotateQParamsPass,
QuantizeClampArgumentsPass,
Expand Down
3 changes: 3 additions & 0 deletions backends/arm/_passes/arm_pass_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
RewriteConvPass,
RewriteMatmulPass,
RewriteUpsamplePass,
ReciprocalDualLutPass,
ScalarsToAttributePass,
SizeAdjustInputPass,
ToTosaMemoryFormatPass,
Expand Down Expand Up @@ -331,6 +332,8 @@ def _tosa_pipeline(
FuseViewCopyTransformPass(),
DecomposeConvWithInt16ActivationPass(),
DecomposeSumPass(),
# FIX: Fixed LUT generation, re-enabled dual LUT pass
ReciprocalDualLutPass(exported_program),
InsertTableOpsPass(exported_program),
]
)
Expand Down
Loading