Skip to content

Commit fbfa1ac

Browse files
committed
rebase
[ghstack-poisoned]
2 parents 4473fb7 + dec04ee commit fbfa1ac

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
@@ -423,6 +423,12 @@ if(MAX_KERNEL_NUM)
423423
)
424424
endif()
425425

426+
# Build devtools first if needed - some backends depend on protobuf from
427+
# devtools
428+
if(EXECUTORCH_BUILD_DEVTOOLS)
429+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/devtools)
430+
endif()
431+
426432
if(EXECUTORCH_BUILD_PYBIND AND APPLE)
427433
# shared version
428434
add_library(executorch_core_shared SHARED ${_executorch_core__srcs})
@@ -588,10 +594,6 @@ if(EXECUTORCH_BUILD_CORTEX_M)
588594
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/cortex_m)
589595
endif()
590596

591-
if(EXECUTORCH_BUILD_DEVTOOLS)
592-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/devtools)
593-
endif()
594-
595597
if(EXECUTORCH_BUILD_EXTENSION_APPLE)
596598
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/apple)
597599
list(APPEND _executorch_extensions apple_extension)
@@ -756,6 +758,30 @@ if(EXECUTORCH_BUILD_PYBIND)
756758
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/devtools)
757759
endif()
758760

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

802+
if(EXECUTORCH_BUILD_EXTENSION_MODULE)
803+
# Always use static linking for pybindings to avoid runtime symbol
804+
# resolution issues
805+
list(APPEND _dep_libs extension_module_static)
806+
# Add bundled_module if available
807+
if(TARGET bundled_module)
808+
list(APPEND _dep_libs bundled_module)
809+
endif()
810+
endif()
811+
776812
if(EXECUTORCH_BUILD_TESTS)
777813
list(APPEND _dep_libs test_backend_compiler_lib)
778814
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)