Skip to content

Commit e9cbfcb

Browse files
mcr229facebook-github-bot
authored andcommitted
Create XNNPACK __init__.py file (#1215)
Summary: Pull Request resolved: #1215 Users of XNNPACK Delegate shouldn't have to know where partitioners and configs are within package submodules. So we can bring the only things that users need into the `__init__` file. This allows us to import partitioners, configs and anything else straight from `executorch.backends.xnnpack` Reviewed By: JacobSzwejbka Differential Revision: D46538935 fbshipit-source-id: a6e3d94da227c951134a16fcd6280b232ed7dcb9
1 parent 74acb40 commit e9cbfcb

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

backends/xnnpack/TARGETS

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,19 @@ runtime.python_library(
2525
"//executorch/exir/backend:backend_details",
2626
],
2727
)
28+
29+
runtime.python_library(
30+
name = "xnnpack_delegate",
31+
srcs = [
32+
"__init__.py",
33+
],
34+
visibility = [
35+
"//executorch/...",
36+
"@EXECUTORCH_CLIENTS",
37+
],
38+
deps = [
39+
":xnnpack_preprocess",
40+
"//executorch/backends/xnnpack/partition:xnnpack_partitioner",
41+
"//executorch/backends/xnnpack/utils:xnnpack_utils",
42+
],
43+
)

backends/xnnpack/__init__.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
# Exposed Partitioners in XNNPACK Package
8+
from .partition.xnnpack_partitioner import (
9+
XnnpackDynamicallyQuantizedPartitioner,
10+
XnnpackPartitioner,
11+
)
12+
13+
# Exposed Configs in XNNPACK Package
14+
from .utils.configs import (
15+
get_xnnpack_capture_config,
16+
get_xnnpack_edge_compile_config,
17+
get_xnnpack_executorch_backend_config,
18+
)
19+
20+
# Easy util functions
21+
from .utils.utils import capture_graph_for_xnnpack
22+
23+
# XNNPACK Backend
24+
from .xnnpack_preprocess import XnnpackBackend
25+
26+
27+
__all__ = [
28+
"XnnpackDynamicallyQuantizedPartitioner",
29+
"XnnpackPartitioner",
30+
"XnnpackBackend",
31+
"capture_graph_for_xnnpack",
32+
"get_xnnpack_capture_config",
33+
"get_xnnpack_edge_compile_config",
34+
"get_xnnpack_executorch_backend_config",
35+
]

0 commit comments

Comments
 (0)