Skip to content

Commit 371cb1c

Browse files
authored
Wire target_config Buck deps on cmsis_nn_py (pytorch#19604) (pytorch#19604)
Summary: A previous change added `executorch/backends/cortex_m/target_config.py` (and `passes/cortex_m_pass.py`) but did not wire them into the cortex_m Buck graph. As a result, importing `executorch.backends.cortex_m.passes.cortex_m_pass_manager` from any consumer fails at import time with: ``` ModuleNotFoundError: No module named 'executorch.backends.cortex_m.target_config' ``` This change wires the new files into Buck and connects them to the newly-buckified `cmsis_nn` Python package: - New `//executorch/backends/cortex_m:target_config` `python_library` exporting `target_config.py`, depending on `//third-party/cmsis-nn:cmsis_nn_py` (added earlier in this stack). - `//executorch/backends/cortex_m/passes:cortex_passes`: add `cortex_m_pass.py` to `srcs` (needed because `passes/__init__.py` does `from .cortex_m_pass import CortexMPass`), and add `:target_config` to `deps` so `cortex_m_pass_manager.py` and `cortex_m_pass.py` can resolve their `target_config` import. Reviewed By: psiddh Differential Revision: D105210239
1 parent 803e47d commit 371cb1c

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

backends/cortex_m/TARGETS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,13 @@ python_library(
1919
"fbsource//third-party/pypi/tabulate:tabulate",
2020
],
2121
)
22+
23+
python_library(
24+
name = "target_config",
25+
srcs = [
26+
"target_config.py",
27+
],
28+
deps = [
29+
"fbsource//third-party/cmsis-nn:cmsis_nn_py",
30+
],
31+
)

backends/cortex_m/passes/BUCK

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ fbcode_target(_kind = runtime.python_library,
3131
"activation_fusion_pass.py",
3232
"clamp_hardswish_pass.py",
3333
"convert_to_cortex_m_pass.py",
34+
"cortex_m_pass.py",
3435
"cortex_m_pass_manager.py",
3536
"decompose_hardswish_pass.py",
3637
"decompose_mean_pass.py",
@@ -39,6 +40,7 @@ fbcode_target(_kind = runtime.python_library,
3940
deps=[
4041
"//caffe2:torch",
4142
"//executorch/backends/arm/_passes:passes",
43+
"//executorch/backends/cortex_m:target_config",
4244
"//executorch/backends/cortex_m/ops:ops",
4345
"//executorch/backends/cortex_m/passes:passes_utils",
4446
"//executorch/backends/cortex_m/passes:replace_quant_nodes_pass",

0 commit comments

Comments
 (0)