@@ -38,6 +38,8 @@ python_library(
3838 deps = [
3939 ":passes",
4040 ":utils",
41+ ":ops_registrations",
42+ ":replace_ops",
4143 "//caffe2:torch",
4244 "//executorch/backends/cadence/aot/quantizer:fusion_pass",
4345 "//executorch/backends/cadence/aot/quantizer:quantizer",
@@ -71,12 +73,16 @@ python_library(
7173 ],
7274 deps = [
7375 ":utils",
76+ ":fuse_ops",
77+ ":simplify_ops",
78+ ":replace_ops",
79+ ":reorder_ops",
80+ ":remove_ops",
7481 "//caffe2:torch",
7582 "//executorch/exir:pass_base",
7683 "//executorch/exir/dialects:lib",
7784 "//executorch/exir/passes:lib",
7885 "//executorch/exir/passes:spec_prop_pass",
79- "//executorch/backends/transforms:remove_clone_ops"
8086 ],
8187)
8288
@@ -163,6 +169,77 @@ python_library(
163169 ],
164170)
165171
172+ python_library(
173+ name = "simplify_ops",
174+ srcs = [
175+ "simplify_ops.py",
176+ ],
177+ typing = True,
178+ deps = [
179+ ":pass_utils",
180+ "//executorch/backends/cadence/aot:pass_utils",
181+ "//executorch/exir:pass_base",
182+ "//executorch/exir/dialects:lib",
183+ ],
184+ )
185+
186+ python_library(
187+ name = "remove_ops",
188+ srcs = [
189+ "remove_ops.py",
190+ ],
191+ typing = True,
192+ deps = [
193+ "//caffe2:torch",
194+ "//executorch/backends/cadence/aot:pass_utils",
195+ "//executorch/backends/cadence/aot:simplify_ops",
196+ "//executorch/exir:pass_base",
197+ "//executorch/exir/dialects:lib",
198+ "//executorch/exir/dialects/edge:lib",
199+ "//executorch/exir/passes:spec_prop_pass",
200+ "//executorch/backends/transforms:remove_clone_ops"
201+ ],
202+ )
203+
204+ python_library(
205+ name = "reorder_ops",
206+ srcs = [
207+ "reorder_ops.py",
208+ ],
209+ typing = True,
210+ deps = [
211+ "//caffe2:torch",
212+ "//executorch/backends/cadence/aot:compiler_utils",
213+ "//executorch/backends/cadence/aot:pass_utils",
214+ "//executorch/backends/cadence/aot:utils",
215+ "//executorch/exir:pass_base",
216+ "//executorch/exir:tensor",
217+ "//executorch/exir/dialects:lib",
218+ "//executorch/exir/dialects/edge:lib",
219+ ],
220+ )
221+
222+ python_library(
223+ name = "replace_ops",
224+ srcs = [
225+ "replace_ops.py",
226+ ],
227+ typing = True,
228+ deps = [
229+ ":pass_utils",
230+ "//caffe2:torch",
231+ "//executorch/backends/cadence/aot:compiler_utils",
232+ "//executorch/backends/cadence/aot:fuse_ops",
233+ "//executorch/backends/cadence/aot:pass_utils",
234+ "//executorch/backends/cadence/aot:remove_ops",
235+ "//executorch/backends/cadence/aot:utils",
236+ "//executorch/exir:pass_base",
237+ "//executorch/exir/dialects:lib",
238+ "//executorch/exir/dialects/edge:lib",
239+ "//executorch/exir/passes:spec_prop_pass",
240+ ],
241+ )
242+
166243python_unittest(
167244 name = "test_graph_builder",
168245 srcs = [
@@ -179,3 +256,101 @@ python_unittest(
179256 ":ops_registrations"
180257 ],
181258)
259+
260+ python_unittest(
261+ name = "test_replace_ops_passes",
262+ srcs = [
263+ "tests/test_replace_ops_passes.py",
264+ ],
265+ supports_static_listing = False,
266+ typing = True,
267+ deps = [
268+ "fbsource//third-party/pypi/parameterized:parameterized",
269+ ":compiler",
270+ ":replace_ops",
271+ "//caffe2:torch",
272+ "//executorch/backends/cadence/aot:compiler",
273+ "//executorch/backends/cadence/aot:graph_builder",
274+ "//executorch/backends/cadence/aot:pass_utils",
275+ "//executorch/exir:pass_base",
276+ "//executorch/exir/dialects:lib",
277+ "//executorch/exir/passes:lib",
278+ ],
279+ )
280+
281+ python_unittest(
282+ name = "test_fusion_ops_passes",
283+ srcs = [
284+ "tests/test_fusion_ops_passes.py",
285+ ],
286+ typing = True,
287+ deps = [
288+ ":compiler",
289+ "//caffe2:torch",
290+ "//executorch/backends/cadence/aot:compiler",
291+ "//executorch/backends/cadence/aot:fuse_ops",
292+ "//executorch/backends/cadence/aot:graph_builder",
293+ "//executorch/backends/cadence/aot:ops_registrations",
294+ "//executorch/backends/cadence/aot:pass_utils",
295+ "//executorch/exir/dialects:lib",
296+ "//executorch/exir/dialects/edge:lib",
297+ ],
298+ )
299+
300+ python_unittest(
301+ name = "test_remove_ops_passes",
302+ srcs = [
303+ "tests/test_remove_ops_passes.py",
304+ ],
305+ supports_static_listing = False,
306+ typing = True,
307+ deps = [
308+ "fbsource//third-party/pypi/parameterized:parameterized",
309+ "fbsource//third-party/pypi/pyre-extensions:pyre-extensions",
310+ ":compiler",
311+ "//caffe2:torch",
312+ "//executorch/backends/cadence/aot:compiler",
313+ "//executorch/backends/cadence/aot:ops_registrations",
314+ "//executorch/backends/cadence/aot:pass_utils",
315+ "//executorch/backends/cadence/aot:remove_ops",
316+ "//executorch/backends/cadence/aot/quantizer:quantizer",
317+ "//executorch/exir/dialects:lib",
318+ ],
319+ )
320+
321+ python_unittest(
322+ name = "test_simplify_ops_passes",
323+ srcs = [
324+ "tests/test_simplify_ops_passes.py",
325+ ],
326+ supports_static_listing = False,
327+ typing = True,
328+ deps = [
329+ "fbsource//third-party/pypi/parameterized:parameterized",
330+ "//caffe2:torch",
331+ "//executorch/backends/cadence/aot:compiler",
332+ "//executorch/backends/cadence/aot:ops_registrations",
333+ "//executorch/backends/cadence/aot:pass_utils",
334+ "//executorch/backends/cadence/aot:simplify_ops",
335+ "//executorch/exir/dialects:lib",
336+ ],
337+ )
338+
339+ python_unittest(
340+ name = "test_reorder_ops_passes",
341+ srcs = [
342+ "tests/test_reorder_ops_passes.py",
343+ ],
344+ typing = True,
345+ deps = [
346+ ":compiler",
347+ ":pass_utils",
348+ "//caffe2:torch",
349+ "//executorch/backends/cadence/aot:compiler",
350+ "//executorch/backends/cadence/aot:fuse_ops",
351+ "//executorch/backends/cadence/aot:ops_registrations",
352+ "//executorch/backends/cadence/aot:pass_utils",
353+ "//executorch/backends/cadence/aot:reorder_ops",
354+ "//executorch/exir/dialects:lib",
355+ ],
356+ )
0 commit comments