Skip to content

Use "pybind" preset when building a wheel #10951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .ci/scripts/unittest-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ if [[ "$BUILD_TOOL" == "cmake" ]]; then
# Setup swiftshader and Vulkan SDK which are required to build the Vulkan delegate
source .ci/scripts/setup-vulkan-linux-deps.sh

# We need the runner to test the built library.
PYTHON_EXECUTABLE=python \
CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
CMAKE_ARGS="-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON -DEXECUTORCH_BUILD_TESTS=ON" \
.ci/scripts/setup-linux.sh "$@"

.ci/scripts/unittest-linux-cmake.sh
Expand Down
3 changes: 2 additions & 1 deletion .ci/scripts/unittest-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ export PATH="${TMP_DIR}:$PATH"
trap 'rm -rfv ${TMP_DIR}' EXIT

# Setup MacOS dependencies as there is no Docker support on MacOS atm
# We need the runner to test the built library.
PYTHON_EXECUTABLE=python \
CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
CMAKE_ARGS="-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON -DEXECUTORCH_BUILD_TESTS=ON" \
${CONDA_RUN} --no-capture-output \
.ci/scripts/setup-macos.sh "$@"

Expand Down
4 changes: 0 additions & 4 deletions .ci/scripts/wheel/envvar_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,3 @@
# Ensure that CMAKE_ARGS is defined before referencing it. Defaults to empty
# if not defined.
export CMAKE_ARGS="${CMAKE_ARGS:-}"

# Link the XNNPACK backend into the pybindings runtime so that users can execute
# ExecuTorch programs that delegate to it.
CMAKE_ARGS="${CMAKE_ARGS} -DEXECUTORCH_BUILD_PYBIND=ON -DEXECUTORCH_BUILD_XNNPACK=ON"
4 changes: 0 additions & 4 deletions .ci/scripts/wheel/envvar_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@
# any variables so that subprocesses will see them.

source "${GITHUB_WORKSPACE}/${REPOSITORY}/.ci/scripts/wheel/envvar_base.sh"

# When building for macOS, link additional backends into the pybindings runtime.
CMAKE_ARGS="${CMAKE_ARGS} -DEXECUTORCH_BUILD_COREML=ON"
CMAKE_ARGS="${CMAKE_ARGS} -DEXECUTORCH_BUILD_MPS=ON"
8 changes: 1 addition & 7 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"version": 10,
"cmakeMinimumRequired": {
"major": 3,
"minor": 31,
"patch": 0
},
"$comment": "On-device AI across mobile, embedded and edge for PyTorch.",
"version": 6,
"configurePresets": [
{
"name": "common",
Expand Down
9 changes: 2 additions & 7 deletions backends/openvino/scripts/openvino_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,11 @@ main() {
# Set parameters to configure the project with CMake
# Note: Add any additional configuration options you need here
export CMAKE_ARGS="-DEXECUTORCH_BUILD_OPENVINO=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
-DEXECUTORCH_ENABLE_LOGGING=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_BUILD_PYBIND=ON"
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON"
export CMAKE_BUILD_ARGS="--target openvino_backend"

# Build the package
pip install . --no-build-isolation
./install_executorch.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah so good


else
echo "Error: Argument is not valid: $build_type"
Expand Down
4 changes: 2 additions & 2 deletions runtime/executor/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ add_custom_command(
COMMAND
${PYTHON_EXECUTABLE} -m test.models.export_program --modules
"ModuleAdd,ModuleAddHalf,ModuleAddMul,ModuleDynamicCatUnallocatedIO,ModuleIndex,ModuleMultipleEntry,ModuleSimpleTrain,ModuleStateful"
--outdir "${CMAKE_CURRENT_BINARY_DIR}" 2> /dev/null
--outdir "${CMAKE_CURRENT_BINARY_DIR}"
COMMAND
${PYTHON_EXECUTABLE} -m test.models.export_program --modules "ModuleAddMul"
--external-constants --outdir "${CMAKE_CURRENT_BINARY_DIR}" 2> /dev/null
--external-constants --outdir "${CMAKE_CURRENT_BINARY_DIR}"
COMMAND
${PYTHON_EXECUTABLE} -m test.models.export_delegated_program --modules "ModuleAddMul"
--backend_id "StubBackend" --outdir "${CMAKE_CURRENT_BINARY_DIR}/delegated/" || true
Expand Down
Loading
Loading