Skip to content

Commit e6237f7

Browse files
digantdesaifacebook-github-bot
authored andcommitted
Add Buck config to disable XNNPACK Workspace Sharing (#5696)
Summary: Pull Request resolved: #5696 XNNPACK Workspace sharing is enabled by default. Use this config to disable it. Reviewed By: gordonliu Differential Revision: D63437983 fbshipit-source-id: 7533b56b6918e458e9366973348e292e345aa5f1
1 parent fcdfe06 commit e6237f7

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

backends/xnnpack/targets.bzl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
load("@fbsource//xplat/executorch/backends/xnnpack/third-party:third_party_libs.bzl", "third_party_dep")
22
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
33

4+
def _get_preprocessor_flags():
5+
"""
6+
Disable if someone explictly specified a config option,
7+
else Enable otherwise
8+
"""
9+
if native.read_config("executorch", "xnnpack_workspace_sharing", "1") == "0":
10+
return []
11+
12+
# Enable if not disabled through config
13+
return ["-DENABLE_XNNPACK_SHARED_WORKSPACE"]
14+
415
def define_common_targets():
516
runtime.cxx_library(
617
name = "dynamic_quant_utils",
@@ -36,11 +47,9 @@ def define_common_targets():
3647
"@EXECUTORCH_CLIENTS",
3748
],
3849
preprocessor_flags = [
39-
# Enable workspace sharing across delegates
40-
"-DENABLE_XNNPACK_SHARED_WORKSPACE",
4150
# Uncomment to enable per operator timings
4251
# "-DENABLE_XNNPACK_PROFILING",
43-
],
52+
] + _get_preprocessor_flags(),
4453
exported_deps = [
4554
"//executorch/runtime/backend:interface",
4655
],

0 commit comments

Comments
 (0)