diff --git a/backends/qualcomm/runtime/targets.bzl b/backends/qualcomm/runtime/targets.bzl index f3b868892fa..8c921b96ec8 100644 --- a/backends/qualcomm/runtime/targets.bzl +++ b/backends/qualcomm/runtime/targets.bzl @@ -3,6 +3,7 @@ load( "ANDROID", ) load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_verision") def define_common_targets(): """Defines targets that should be shared between fbcode and xplat. @@ -56,10 +57,10 @@ def define_common_targets(): platforms = [ANDROID], visibility = ["@EXECUTORCH_CLIENTS"], resources = { - "qnn_lib": "fbsource//third-party/qualcomm/qnn/qnn-2.25:qnn_offline_compile_libs", + "qnn_lib": "fbsource//third-party/qualcomm/qnn/qnn-{0}:qnn_offline_compile_libs".format(get_qnn_library_verision()), }, deps = [ - "fbsource//third-party/qualcomm/qnn:api", + "fbsource//third-party/qualcomm/qnn/qnn-{0}:api".format(get_qnn_library_verision()), ":logging", "//executorch/backends/qualcomm:schema", "//executorch/backends/qualcomm/aot/ir:qcir_utils", diff --git a/backends/qualcomm/targets.bzl b/backends/qualcomm/targets.bzl index 1435d41f8db..a201274402b 100644 --- a/backends/qualcomm/targets.bzl +++ b/backends/qualcomm/targets.bzl @@ -92,3 +92,6 @@ def define_common_targets(): ":schema", ], ) + +def get_qnn_library_verision(): + return "2.26" diff --git a/examples/models/llama2/TARGETS b/examples/models/llama2/TARGETS index 13bf0a52c20..17597f3d502 100644 --- a/examples/models/llama2/TARGETS +++ b/examples/models/llama2/TARGETS @@ -3,6 +3,7 @@ load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load(":targets.bzl", "define_common_targets") +load("@fbsource//xplat/executorch/backends/qualcomm/qnn_version.bzl", "get_qnn_library_verision") oncall("executorch") @@ -69,7 +70,7 @@ runtime.python_binary( runtime.command_alias( name = "export_llama_qnn", env = { - "LD_LIBRARY_PATH": "$(location fbsource//third-party/qualcomm/qnn/qnn-2.25:qnn_offline_compile_libs)", + "LD_LIBRARY_PATH": "$(location fbsource//third-party/qualcomm/qnn/qnn-{0}:qnn_offline_compile_libs)".format(get_qnn_library_verision()), }, exe = ":export_llama", ) diff --git a/shim/xplat/executorch/backends/qualcomm/qnn_version.bzl b/shim/xplat/executorch/backends/qualcomm/qnn_version.bzl new file mode 100644 index 00000000000..75019982af2 --- /dev/null +++ b/shim/xplat/executorch/backends/qualcomm/qnn_version.bzl @@ -0,0 +1,2 @@ +def get_qnn_library_verision(): + return "2.26"