Skip to content

Commit 207b1f6

Browse files
committed
Update
[ghstack-poisoned]
2 parents 6ffb463 + af284f6 commit 207b1f6

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

extension/training/CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,17 @@ if(EXECUTORCH_BUILD_PYBIND)
6363
endif()
6464

6565
if(EXECUTORCH_BUILD_XNNPACK)
66-
# need to explicitly specify XNNPACK and xnnpack-microkernels-prod here
67-
# otherwise uses XNNPACK and microkernel-prod symbols from libtorch_cpu
68-
list(APPEND _pybind_training_dep_libs xnnpack_backend XNNPACK
69-
xnnpack-microkernels-prod
70-
)
66+
if(EXECUTORCH_BUILD_SHARED)
67+
# The delegate bundles XNNPACK and its microkernels, so naming them again
68+
# here would ask for a second copy of what that library already provides.
69+
list(APPEND _pybind_training_dep_libs xnnpack_backend)
70+
else()
71+
# need to explicitly specify XNNPACK and xnnpack-microkernels-prod here
72+
# otherwise uses XNNPACK and microkernel-prod symbols from libtorch_cpu
73+
list(APPEND _pybind_training_dep_libs xnnpack_backend XNNPACK
74+
xnnpack-microkernels-prod
75+
)
76+
endif()
7177
endif()
7278

7379
pybind11_add_module(

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,10 @@ def get_build_type(is_debug=None) -> str:
323323
_UNSUPPORTED_WHEEL_HEADERS = frozenset(
324324
{
325325
"bundled_module.h",
326+
# These two include a third-party header the wheel does not ship, so they
327+
# cannot compile from an installed package no matter what is linked.
328+
"cpuinfo_utils.h",
329+
"threadpool.h",
326330
"file_descriptor_data_loader.h",
327331
"serialize.h",
328332
}

0 commit comments

Comments
 (0)