Skip to content

Commit 6ae8b1d

Browse files
cccclaifacebook-github-bot
authored andcommitted
Unify the qnn version definition (#6193)
Summary: Pull Request resolved: #6193 As title, the qnn version is harded across the repro, and we have unify way to config them in case mis-use Reviewed By: kirklandsign Differential Revision: D64334993 fbshipit-source-id: df9d30f6e5044677c7cc6ae69d7e061428d8efa7
1 parent e91357d commit 6ae8b1d

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

backends/qualcomm/runtime/targets.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ load(
33
"ANDROID",
44
)
55
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
6+
load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_verision")
67

78
def define_common_targets():
89
"""Defines targets that should be shared between fbcode and xplat.
@@ -56,10 +57,10 @@ def define_common_targets():
5657
platforms = [ANDROID],
5758
visibility = ["@EXECUTORCH_CLIENTS"],
5859
resources = {
59-
"qnn_lib": "fbsource//third-party/qualcomm/qnn/qnn-2.25:qnn_offline_compile_libs",
60+
"qnn_lib": "fbsource//third-party/qualcomm/qnn/qnn-{0}:qnn_offline_compile_libs".format(get_qnn_library_verision()),
6061
},
6162
deps = [
62-
"fbsource//third-party/qualcomm/qnn:api",
63+
"fbsource//third-party/qualcomm/qnn/qnn-{0}:api".format(get_qnn_library_verision()),
6364
":logging",
6465
"//executorch/backends/qualcomm:schema",
6566
"//executorch/backends/qualcomm/aot/ir:qcir_utils",

backends/qualcomm/targets.bzl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,6 @@ def define_common_targets():
9292
":schema",
9393
],
9494
)
95+
96+
def get_qnn_library_verision():
97+
return "2.26"

examples/models/llama2/TARGETS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
55
load(":targets.bzl", "define_common_targets")
6+
load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_verision")
67

78
oncall("executorch")
89

@@ -69,7 +70,7 @@ runtime.python_binary(
6970
runtime.command_alias(
7071
name = "export_llama_qnn",
7172
env = {
72-
"LD_LIBRARY_PATH": "$(location fbsource//third-party/qualcomm/qnn/qnn-2.25:qnn_offline_compile_libs)",
73+
"LD_LIBRARY_PATH": "$(location fbsource//third-party/qualcomm/qnn/qnn-{0}:qnn_offline_compile_libs)".format(get_qnn_library_verision()),
7374
},
7475
exe = ":export_llama",
7576
)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def get_qnn_library_verision():
2+
return "2.26"

0 commit comments

Comments
 (0)