Skip to content

Commit 4a6a89a

Browse files
JakeStevensfacebook-github-bot
authored andcommitted
Buckify aot (#12359)
Summary: Buck-ify the AOT compiler flow for NXP Reviewed By: digantdesai Differential Revision: D72726244
1 parent f82c2f0 commit 4a6a89a

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

backends/nxp/TARGETS

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# @noautodeps
21
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
32
load("@fbcode_macros//build_defs:python_pytest.bzl", "python_pytest")
43
load(
@@ -33,3 +32,32 @@ python_library(
3332
"//pytorch/ao:torchao", # @manual
3433
],
3534
)
35+
36+
python_library(
37+
name = "neutron_sdk",
38+
srcs = glob(["backend/**/*.py"]),
39+
deps = [
40+
"fbsource//third-party/pypi/neutron_convertor_SDK_25_03:neutron_convertor_SDK_25_03",
41+
],
42+
)
43+
44+
python_library(
45+
name = "neutron_backend",
46+
srcs = [
47+
"nxp_backend.py",
48+
"neutron_partitioner.py",
49+
"neutron_node_extraction.py",
50+
"neutron_pass_manager.py",
51+
],
52+
deps = [
53+
":neutron_sdk",
54+
":aten_passes",
55+
":quantizer",
56+
"fbsource//third-party/pypi/flatbuffers:flatbuffers",
57+
"fbsource//third-party/pypi/ml-dtypes:ml-dtypes",
58+
"fbsource//third-party/tosa_tools/v0.80/serialization_lib/python/serializer:serializer",
59+
"//executorch/exir:lib",
60+
"//executorch/backends/transforms:remove_getitem_op",
61+
"//caffe2:torch",
62+
],
63+
)

backends/nxp/tests/TARGETS

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ python_library(
1313
],
1414
)
1515

16+
python_library(
17+
name = "executorch_pipeline",
18+
srcs = [
19+
"executorch_pipeline.py",
20+
"executors.py",
21+
],
22+
deps = [
23+
"//executorch/exir:lib",
24+
"//pytorch/ao:torchao",
25+
"//executorch/backends/nxp:quantizer",
26+
"//executorch/backends/nxp:neutron_backend",
27+
]
28+
)
29+
1630
python_pytest(
1731
name = "test_quantizer",
1832
srcs = [
@@ -24,3 +38,15 @@ python_pytest(
2438
"//executorch/backends/nxp/tests:models",
2539
],
2640
)
41+
42+
python_pytest(
43+
name = "test_neutron_backend",
44+
srcs = [
45+
"test_neutron_backend.py",
46+
],
47+
deps = [
48+
"//executorch/backends/nxp:neutron_backend",
49+
":executorch_pipeline",
50+
":models",
51+
]
52+
)

0 commit comments

Comments
 (0)