@@ -39,6 +39,7 @@ python_library(
39
39
":passes",
40
40
":utils",
41
41
":ops_registrations",
42
+ ":replace_ops",
42
43
"//caffe2:torch",
43
44
"//executorch/backends/cadence/aot/quantizer:fusion_pass",
44
45
"//executorch/backends/cadence/aot/quantizer:quantizer",
@@ -74,12 +75,14 @@ python_library(
74
75
":utils",
75
76
":fuse_ops",
76
77
":simplify_ops",
78
+ ":replace_ops",
79
+ ":reorder_ops",
80
+ ":remove_ops",
77
81
"//caffe2:torch",
78
82
"//executorch/exir:pass_base",
79
83
"//executorch/exir/dialects:lib",
80
84
"//executorch/exir/passes:lib",
81
85
"//executorch/exir/passes:spec_prop_pass",
82
- "//executorch/backends/transforms:remove_clone_ops"
83
86
],
84
87
)
85
88
@@ -180,6 +183,63 @@ python_library(
180
183
],
181
184
)
182
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
+
183
243
python_unittest(
184
244
name = "test_graph_builder",
185
245
srcs = [
@@ -196,3 +256,101 @@ python_unittest(
196
256
":ops_registrations"
197
257
],
198
258
)
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