Skip to content

Commit c9c6819

Browse files
authored
Fix cortex_m test_pass_manager buck listing via Arm dep fixes (pytorch#23024)
Summary: The cortex_m `test_pass_manager` target failed test listing because it consumes the Arm `_passes:passes` target directly, whose Buck dep closure was incomplete, and `quantization_annotator` relied on a package-level import unavailable under the split Buck targets. Complete the dep closures and use a direct submodule import instead. Authored with Muse Code. Differential Revision: D121261247 cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani
1 parent 2bcc50c commit c9c6819

4 files changed

Lines changed: 21 additions & 2 deletions

File tree

‎backends/arm/_passes/BUCK‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ fbcode_target(
5858
deps = [
5959
":core",
6060
":arm_pass_manager_base" if runtime.is_oss else ":arm_pass_manager_fb",
61+
"//executorch/backends/arm:arm_vela",
62+
"//executorch/backends/arm/operators:op_tosa_rescale",
6163
"//executorch/backends/transforms:aten_to_dialect_pass",
6264
"//executorch/backends/transforms:dim_maps",
6365
"//executorch/backends/arm/tosa:utils",

‎backends/arm/operators/BUCK‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,29 @@ fbcode_target(
2525
srcs = ["operator_validation_utils.py"],
2626
)
2727

28+
# Leaf target for the rescale helpers imported by _passes. Kept separate from
29+
# :ops because :ops depends on _passes:passes, which would be a dep cycle.
30+
fbcode_target(
31+
_kind = runtime.python_library,
32+
name = "op_tosa_rescale",
33+
srcs = ["op_tosa_rescale.py"],
34+
deps = [
35+
":node_visitor",
36+
":operator_validation_utils",
37+
"fbsource//third-party/tosa_tools:serializer",
38+
"//caffe2:torch",
39+
"//executorch/backends/arm/tosa:mapping",
40+
],
41+
)
42+
2843
fbcode_target(
2944
_kind = runtime.python_library,
3045
name = "ops",
31-
srcs = glob(["op_*.py", "ops_*.py"]),
46+
srcs = glob(["op_*.py", "ops_*.py"], exclude = ["op_tosa_rescale.py"]),
3247
deps = [
3348
"fbsource//third-party/tosa_tools:tosa",
3449
":node_visitor",
50+
":op_tosa_rescale",
3551
":operator_validation_utils",
3652
"//executorch/backends/arm/tosa:constant_pool",
3753
"//executorch/backends/arm/tosa:mapping",

‎backends/arm/quantizer/quantization_annotator.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import torch.fx
2020
from executorch.backends.arm.common.debug import get_node_debug_info
2121
from executorch.backends.arm.common.type import ensure_type
22-
from executorch.backends.arm.quantizer import QuantizationConfig
22+
from executorch.backends.arm.quantizer.quantization_config import QuantizationConfig
2323

2424
from torch._ops import OpOverload
2525
from torch._subclasses import FakeTensor

‎backends/arm/tosa/dialect/BUCK‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ fbcode_target(_kind = runtime.python_library,
2626
deps = [
2727
":core",
2828
"//caffe2:torch",
29+
"//executorch/backends/arm:ao_ext",
2930
"//executorch/backends/arm/tosa:resize_utils",
3031
"//executorch/backends/arm/tosa:tosa",
3132
],

0 commit comments

Comments
 (0)