Skip to content

Commit 0163902

Browse files
authored
Add buck file for unit test
Differential Revision: D67463640 Pull Request resolved: #8106
1 parent 83a7773 commit 0163902

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

backends/qualcomm/tests/TARGETS

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
2+
load("@fbcode_macros//build_defs:python_unittest.bzl", "python_unittest")
3+
load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_verision")
4+
5+
python_library(
6+
name = "models",
7+
srcs = ["models.py"],
8+
deps = [
9+
"//caffe2:torch",
10+
]
11+
)
12+
13+
python_library(
14+
name = "test_qnn_delegate",
15+
srcs = [
16+
"test_qnn_delegate.py",
17+
"utils.py",
18+
],
19+
# env = {
20+
# "LD_LIBRARY_PATH": "$(location fbsource//third-party/qualcomm/qnn/qnn-{0}:qnn_offline_compile_libs)".format(get_qnn_library_verision()),
21+
# },
22+
deps = [
23+
":models",
24+
"//caffe2:torch",
25+
"//caffe2/functorch:functorch_src",
26+
"//executorch/exir/backend:partitioner",
27+
"//executorch/exir/dialects:lib",
28+
"//executorch/extension/pybindings:portable_lib", # @manual
29+
"//executorch/extension/pytree:pylib",
30+
"//executorch/backends/qualcomm/partition:partition",
31+
"//executorch/backends/qualcomm/quantizer:quantizer",
32+
"//executorch/backends/qualcomm/serialization:serialization",
33+
"//executorch/backends/qualcomm/utils:utils",
34+
"//executorch/devtools:lib",
35+
"//executorch/examples/qualcomm:utils",
36+
"//executorch/examples/models:models",
37+
"//executorch/backends/qualcomm/debugger:utils",
38+
],
39+
)

backends/qualcomm/tests/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ class TestQNN(unittest.TestCase):
190190
compile_only: bool = False
191191
pre_gen_pte: str = ""
192192
llama_artifacts: str = ""
193+
dump_intermediate_outputs: bool = False
193194

194195
def _assert_outputs_equal(self, model_output, ref_output):
195196
self.assertTrue(len(ref_output) == len(model_output))

0 commit comments

Comments
 (0)