Skip to content

Commit 5decfcd

Browse files
authored
Buck fwd-fix: wire up legalize_portable_dim_order_pass (#20971) (#20971)
Summary: Forward fix for D111976876 (DiffTrain import of pytorch/executorch #20878). That diff added `executorch/exir/passes/legalize_portable_dim_order_pass.py` and imports `LegalizePortableDimOrderPass` at the top of `exir/passes/__init__.py`, but like every DiffTrain import it carried no Buck changes. Since `exir/passes/BUCK` uses explicit per-file `srcs` lists (no globs), the new module was never wired into any target, so importing `executorch.exir.passes` fails with `ModuleNotFoundError: No module named 'executorch.exir.passes.legalize_portable_dim_order_pass'`. This breaks every fbcode consumer of `//executorch/exir/passes:lib`, including the arm test listing for `fold_scalar_mul_into_conv_pass` (D112075757) and the residual `backends/arm/test:*` listing failures on D112027047. This adds a `legalize_portable_dim_order_pass` `runtime.python_library` (deps mirror the sibling `memory_format_ops_pass`) and adds it to the `:lib` target `deps`, in both `fbcode` and `xplat` `exir/passes/BUCK`. Authored with Claude Code. Differential Revision: D112243998
1 parent af62dce commit 5decfcd

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

exir/passes/BUCK

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ fbcode_target(_kind = runtime.python_library,
1515
":external_constants_pass",
1616
":init_mutable_pass",
1717
":insert_write_back_for_buffers_pass",
18+
":legalize_portable_dim_order_pass",
1819
":memory_format_ops_pass",
1920
":memory_planning_pass",
2021
":normalize_transpose_pass",
@@ -51,6 +52,21 @@ fbcode_target(_kind = runtime.python_library,
5152
],
5253
)
5354

55+
fbcode_target(_kind = runtime.python_library,
56+
name = "legalize_portable_dim_order_pass",
57+
srcs = [
58+
"legalize_portable_dim_order_pass.py",
59+
],
60+
deps = [
61+
":dim_order_ops_registry",
62+
"//caffe2:torch",
63+
"//executorch/exir:dim_order_utils",
64+
"//executorch/exir:pass_base",
65+
"//executorch/exir/dialects:lib",
66+
"//executorch/exir/dialects/edge:lib",
67+
],
68+
)
69+
5470
fbcode_target(_kind = runtime.python_library,
5571
name = "pass_registry",
5672
srcs = [

0 commit comments

Comments
 (0)