Skip to content

Commit ae69655

Browse files
cccclaifacebook-github-bot
authored andcommitted
Add buck file for unit test (#8106)
Summary: ``` buck2 test 'fbcode//mode/dev-nosan' fbcode//executorch/backends/qualcomm/tests/fb:test_qnn_delegate_simulator -- --exact 'executorch/backends/qualcomm/tests/fb:test_qnn_delegate_simulator - test_qnn_backend_mha (executorch.backends.qualcomm.tests.fb.test_qnn_delegate_simulator.TestQNNQuantizedOperatorSimulator)' ``` Differential Revision: D67463640
1 parent 88886b8 commit ae69655

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ class TestQNN(unittest.TestCase):
131131
use_16a4w: str = "16a4w"
132132
shared_buffer: bool = False
133133
enable_x86_64: bool = False
134+
dump_intermediate_outputs: bool = False
134135

135136
def _assert_outputs_equal(self, model_output, ref_output):
136137
self.assertTrue(len(ref_output) == len(model_output))
@@ -197,6 +198,7 @@ def verify_output( # noqa: C901
197198
)
198199

199200
output_dir = f"{tmp_dir}/outputs"
201+
make_output_dir(output_dir)
200202
outputs = []
201203
etdump_path = f"{tmp_dir}/etdump.etdp"
202204
debug_output_path = f"{tmp_dir}/debug_output.bin"

0 commit comments

Comments
 (0)