Skip to content

Commit dd510a4

Browse files
Re-sync with internal repository (#6)
Co-authored-by: Facebook Community Bot <[email protected]>
1 parent 6bd7d02 commit dd510a4

File tree

112 files changed

+3774
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+3774
-0
lines changed

backends/TARGETS

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Any targets that should be shared between fbcode and xplat must be defined in
2+
# targets.bzl. This file can contain fbcode-only targets.
3+
4+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
5+
load(":backends.bzl", "get_all_cpu_aot_and_backend_targets")
6+
load(":targets.bzl", "define_common_targets")
7+
8+
define_common_targets()
9+
10+
# Use runtime.python_library instead of the one defined in python_library.bzl,
11+
# so we can have access to EXECUTORCH_CLIENTS list.
12+
runtime.python_library(
13+
name = "backend_api",
14+
srcs = [
15+
"backend_api.py",
16+
],
17+
visibility = [
18+
"//executorch/...",
19+
"//executorch/test/...",
20+
"@EXECUTORCH_CLIENTS",
21+
],
22+
deps = [
23+
":backend_details",
24+
":compile_spec_schema",
25+
"//caffe2:torch",
26+
"//executorch/backends:utils",
27+
],
28+
)
29+
30+
runtime.python_library(
31+
name = "compile_spec_schema",
32+
srcs = [
33+
"compile_spec_schema.py",
34+
],
35+
visibility = [
36+
"//executorch/...",
37+
"//executorch/test/...",
38+
"@EXECUTORCH_CLIENTS",
39+
],
40+
)
41+
42+
runtime.python_library(
43+
name = "partitioner",
44+
srcs = [
45+
"partitioner.py",
46+
],
47+
visibility = [
48+
"//executorch/...",
49+
"//executorch/test/...",
50+
"@EXECUTORCH_CLIENTS",
51+
],
52+
deps = [
53+
":compile_spec_schema",
54+
"//caffe2:torch",
55+
],
56+
)
57+
58+
runtime.python_library(
59+
name = "backend_details",
60+
srcs = [
61+
"backend_details.py",
62+
],
63+
visibility = [
64+
"//executorch/...",
65+
"//executorch/test/...",
66+
"@EXECUTORCH_CLIENTS",
67+
],
68+
deps = [
69+
":compile_spec_schema",
70+
":partitioner",
71+
"//caffe2:torch",
72+
"//executorch/exir:delegate",
73+
"//executorch/exir:graph_module",
74+
],
75+
)
76+
77+
# backend_lib includes all ahead of time apis and supported backends,
78+
# it's supposed to be only used on server side and not for production on device.
79+
runtime.python_library(
80+
name = "backend_lib",
81+
visibility = [
82+
"//executorch/...",
83+
"//executorch/test/...",
84+
"@EXECUTORCH_CLIENTS",
85+
],
86+
deps = [
87+
":backend_api",
88+
":backend_details",
89+
"//executorch/backends/canonical_partitioners:canonical_partitioner_lib",
90+
] + get_all_cpu_aot_and_backend_targets(),
91+
)
92+
93+
runtime.python_library(
94+
name = "utils",
95+
srcs = [
96+
"utils.py",
97+
],
98+
visibility = [
99+
"//executorch/...",
100+
"//executorch/backends/...",
101+
"//executorch/test/...",
102+
"@EXECUTORCH_CLIENTS",
103+
],
104+
deps = [
105+
"//caffe2:torch",
106+
],
107+
)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
2+
3+
runtime.python_library(
4+
name = "canonical_partitioner_lib",
5+
srcs = [
6+
"duplicate_dequant_node_pass.py",
7+
"pattern_op_partitioner.py",
8+
],
9+
visibility = [
10+
"//executorch/...",
11+
"//executorch/backends/...",
12+
"//executorch/test/...",
13+
"@EXECUTORCH_CLIENTS",
14+
],
15+
deps = [
16+
"//caffe2:torch",
17+
"//executorch/backends:partitioner",
18+
],
19+
)

backends/qnnpack/TARGETS

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
2+
load(":targets.bzl", "define_common_targets")
3+
4+
define_common_targets()
5+
6+
runtime.python_library(
7+
name = "qnnpack_preprocess",
8+
srcs = [
9+
"qnnpack_preprocess.py",
10+
"serialization/qnnpack_graph_schema.py",
11+
"serialization/qnnpack_graph_serialize.py",
12+
],
13+
resources = [
14+
"serialization/schema.fbs",
15+
],
16+
visibility = [
17+
"//executorch/...",
18+
],
19+
deps = [
20+
"//executorch/backends:backend_details",
21+
"//executorch/backends/transforms:lib",
22+
"//executorch/exir:graph_module",
23+
"//executorch/exir/serialize:bindings",
24+
"//executorch/exir/serialize:lib",
25+
],
26+
)

backends/qnnpack/partition/TARGETS

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
2+
3+
runtime.python_library(
4+
name = "support_patterns",
5+
srcs = [
6+
"support_patterns.py",
7+
],
8+
visibility = [
9+
"//executorch/...",
10+
"@EXECUTORCH_CLIENTS",
11+
],
12+
deps = [
13+
"//caffe2:torch",
14+
"//executorch/backends:utils",
15+
"//executorch/backends/transforms:lib",
16+
],
17+
)
18+
19+
runtime.python_library(
20+
name = "qnnpack_partitioner",
21+
srcs = [
22+
"qnnpack_partitioner.py",
23+
],
24+
visibility = [
25+
"//executorch/...",
26+
"@EXECUTORCH_CLIENTS",
27+
],
28+
deps = [
29+
":support_patterns",
30+
"//executorch/backends:partitioner",
31+
"//executorch/backends/canonical_partitioners:canonical_partitioner_lib",
32+
"//executorch/backends/qnnpack:qnnpack_preprocess",
33+
"//executorch/backends/transforms:lib",
34+
"//executorch/backends/xnnpack/partition:xnnpack_partitioner",
35+
"//executorch/exir:delegate",
36+
"//executorch/exir:lib",
37+
],
38+
)

backends/qnnpack/test/TARGETS

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest")
2+
load(":targets.bzl", "define_common_targets")
3+
4+
define_common_targets()
5+
6+
python_unittest(
7+
name = "test_qnnpack",
8+
srcs = [
9+
"test_qnnpack.py",
10+
],
11+
preload_deps = [
12+
"//executorch/kernels/quantized:custom_ops_generated_lib",
13+
],
14+
supports_static_listing = True,
15+
tags = ["long_running"],
16+
deps = [
17+
"//caffe2:torch",
18+
"//executorch/backends:backend_api",
19+
"//executorch/backends/qnnpack:qnnpack_backend",
20+
"//executorch/backends/qnnpack:qnnpack_preprocess",
21+
"//executorch/backends/qnnpack/partition:qnnpack_partitioner",
22+
"//executorch/exir:lib",
23+
"//executorch/exir/serialize:lib",
24+
"//executorch/pybindings:portable", # @manual
25+
"//executorch/pytree:pylib",
26+
],
27+
)
28+
29+
python_unittest(
30+
name = "test_qnnpack_partitioner",
31+
srcs = [
32+
"test_qnnpack_partitioner.py",
33+
],
34+
preload_deps = [
35+
"//executorch/kernels/quantized:custom_ops_generated_lib",
36+
],
37+
supports_static_listing = True,
38+
tags = ["long_running"],
39+
deps = [
40+
"//caffe2:torch",
41+
"//executorch/backends/qnnpack:qnnpack_backend",
42+
"//executorch/backends/qnnpack/partition:support_patterns",
43+
"//executorch/backends/transforms:lib",
44+
"//executorch/exir:lib",
45+
"//executorch/pybindings:portable", # @manual
46+
],
47+
)

0 commit comments

Comments
 (0)