Skip to content

Commit ea0d441

Browse files
authored
Add a latest XNNPACK opt-in (pytorch#22972)
Summary: Keep ExecuTorch on the existing XNNPACK dependency by default and add `-c executorch.use_latest_xnnpack=true` to opt in fb: Reviewed By: digantdesai Differential Revision: D116485510 Pull Request resolved: pytorch#22972
1 parent 5027c37 commit ea0d441

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎backends/vulkan/test/op_tests/targets.bzl‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
load("@fbsource//tools/build_defs:platform_defs.bzl", "ANDROID")
22
load("@fbsource//xplat/caffe2:pt_defs.bzl", "get_pt_ops_deps")
33
load("@fbsource//xplat/caffe2:pt_ops.bzl", "pt_operator_library")
4+
load("@fbsource//xplat/executorch/backends/xnnpack/third-party:third_party_libs.bzl", "third_party_dep")
45
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
56
load(
67
"@fbsource//xplat/executorch/backends/vulkan:targets.bzl",
@@ -232,6 +233,6 @@ def define_common_targets(is_fbcode = False):
232233
"conv2d_gemm_dynamic_test",
233234
extra_deps = [
234235
"//executorch/runtime/core/exec_aten/testing_util:tensor_util",
235-
"fbsource//xplat/third-party/XNNPACK:XNNPACK",
236+
third_party_dep("XNNPACK"),
236237
]
237238
)

‎shim_et/xplat/executorch/backends/xnnpack/third-party/third_party_libs.bzl‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
22

3+
_XNNPACK_LATEST = "fbsource//third-party/XNNPACK:XNNPACK"
4+
35
# Dictionary mappping third-party library name to the correct OSS/Internal target dependencies.
46
# the values of the dictionary are lists where the first element is the internal dep and the
57
# second element is the OSS dep
@@ -17,4 +19,8 @@ def third_party_dep(name):
1719
if name not in _THIRD_PARTY_LIBS:
1820
fail("Cannot find third party library " + name + ", please register it in THIRD_PARTY_LIBS first!")
1921

20-
return _THIRD_PARTY_LIBS[name][1] if runtime.is_oss else _THIRD_PARTY_LIBS[name][0]
22+
if runtime.is_oss:
23+
return _THIRD_PARTY_LIBS[name][1]
24+
if name == "XNNPACK" and native.read_config("executorch", "use_latest_xnnpack", "false") == "true":
25+
return _XNNPACK_LATEST
26+
return _THIRD_PARTY_LIBS[name][0]

0 commit comments

Comments
 (0)