Skip to content

Commit 854f3ca

Browse files
committed
rebase
[ghstack-poisoned]
2 parents e1db7c8 + 863a443 commit 854f3ca

40 files changed

+2050
-460
lines changed

.ci/scripts/setup-conda.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -ex
99

1010
install_conda() {
1111
pushd .ci/docker || return
12-
${CONDA_INSTALL} -y --file conda-env-ci.txt
12+
${CONDA_INSTALL} -c conda-forge -y --file conda-env-ci.txt
1313
popd || return
1414
}
1515

.github/workflows/android-release-artifacts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
fi
9191
9292
FLAVOR="${{ inputs.flavor }}"
93-
if [[ "$FLAVOR" == "vulkan+xnnpack" ]]; then
93+
if [[ "$FLAVOR" == "vulkan+xnnpack" || -z "$FLAVOR" ]]; then
9494
export EXECUTORCH_BUILD_VULKAN=ON
9595
fi
9696

CMakeLists.txt

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,12 @@ if(MAX_KERNEL_NUM)
425425
)
426426
endif()
427427

428+
# Build devtools first if needed - some backends depend on protobuf from
429+
# devtools
430+
if(EXECUTORCH_BUILD_DEVTOOLS)
431+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/devtools)
432+
endif()
433+
428434
if(EXECUTORCH_BUILD_PYBIND AND APPLE)
429435
# shared version
430436
add_library(executorch_core_shared SHARED ${_executorch_core__srcs})
@@ -590,10 +596,6 @@ if(EXECUTORCH_BUILD_CORTEX_M)
590596
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/cortex_m)
591597
endif()
592598

593-
if(EXECUTORCH_BUILD_DEVTOOLS)
594-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/devtools)
595-
endif()
596-
597599
if(EXECUTORCH_BUILD_EXTENSION_APPLE)
598600
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/apple)
599601
list(APPEND _executorch_extensions apple_extension)
@@ -758,6 +760,30 @@ if(EXECUTORCH_BUILD_PYBIND)
758760
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/devtools)
759761
endif()
760762

763+
# Create bundled_module target only for pybindings when bundled_program exists
764+
# This target has hard dependencies on devtools generated headers
765+
if(TARGET bundled_program)
766+
add_library(
767+
bundled_module STATIC
768+
${CMAKE_CURRENT_SOURCE_DIR}/extension/module/bundled_module.cpp
769+
)
770+
771+
# Ensure bundled_module waits for bundled_program's generated headers
772+
add_dependencies(bundled_module bundled_program)
773+
774+
target_link_libraries(bundled_module PRIVATE extension_data_loader)
775+
target_link_libraries(
776+
bundled_module PUBLIC extension_module_static bundled_program
777+
)
778+
779+
target_include_directories(
780+
bundled_module PUBLIC ${_common_include_directories}
781+
)
782+
target_compile_options(
783+
bundled_module PUBLIC -Wno-deprecated-declarations -fPIC
784+
)
785+
endif()
786+
761787
# find pytorch lib, to allow pybind to take at::Tensor as input/output
762788
find_package_torch()
763789
find_library(
@@ -775,6 +801,16 @@ if(EXECUTORCH_BUILD_PYBIND)
775801
torch
776802
)
777803

804+
if(EXECUTORCH_BUILD_EXTENSION_MODULE)
805+
# Always use static linking for pybindings to avoid runtime symbol
806+
# resolution issues
807+
list(APPEND _dep_libs extension_module_static)
808+
# Add bundled_module if available
809+
if(TARGET bundled_module)
810+
list(APPEND _dep_libs bundled_module)
811+
endif()
812+
endif()
813+
778814
if(EXECUTORCH_BUILD_TESTS)
779815
list(APPEND _dep_libs test_backend_compiler_lib)
780816
endif()

backends/apple/coreml/TARGETS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,13 @@ runtime.python_test(
120120
"test/*.py",
121121
]),
122122
deps = [
123+
"fbsource//third-party/pypi/coremltools:coremltools",
123124
"fbsource//third-party/pypi/pytest:pytest",
124125
":partitioner",
125126
":quantizer",
126127
":recipes",
127128
"//caffe2:torch",
128129
"//pytorch/vision:torchvision",
130+
"fbsource//third-party/pypi/scikit-learn:scikit-learn",
129131
],
130132
)

0 commit comments

Comments
 (0)