Skip to content

Build Apple backends with pybindings on CI. #2395

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion .ci/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ install_executorch() {
which pip
# Install executorch, this assumes that Executorch is checked out in the
# current directory
pip install . --no-build-isolation
pip install . --no-build-isolation -v
# Just print out the list of packages for debugging
pip list
}
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/_unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ jobs:
conda activate "${CONDA_ENV}"

BUILD_TOOL=${{ matrix.build-tool }}

# Setup MacOS dependencies as there is no Docker support on MacOS atm
PYTHON_EXECUTABLE=python EXECUTORCH_BUILD_PYBIND=ON bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
PYTHON_EXECUTABLE=python \
EXECUTORCH_BUILD_PYBIND=ON \
.ci/scripts/setup-linux.sh "${BUILD_TOOL}"

# Run pytest with coverage
pytest -n auto --cov=./ --cov-report=xml
Expand All @@ -59,8 +62,13 @@ jobs:
BUILD_TOOL=${{ matrix.build-tool }}

bash .ci/scripts/setup-conda.sh

# Setup MacOS dependencies as there is no Docker support on MacOS atm
PYTHON_EXECUTABLE=python ${CONDA_RUN} EXECUTORCH_BUILD_PYBIND=ON bash .ci/scripts/setup-macos.sh "${BUILD_TOOL}"
PYTHON_EXECUTABLE=python \
EXECUTORCH_BUILD_PYBIND=ON \
CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON" \
${CONDA_RUN} --no-capture-output \
.ci/scripts/setup-macos.sh "${BUILD_TOOL}"

# Run pytest with coverage
${CONDA_RUN} pytest -n auto --cov=./ --cov-report=xml
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ jobs:

# build module for executorch.extension.pybindings.portable_lib
BUILD_TOOL=${{ matrix.build-tool }}
PYTHON_EXECUTABLE=python EXECUTORCH_BUILD_PYBIND=ON bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
PYTHON_EXECUTABLE=python \
EXECUTORCH_BUILD_PYBIND=ON \
bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"

# see if we can import the module successfully
python -c "from executorch.extension.pybindings import portable_lib; print('success!')"
Expand Down
9 changes: 4 additions & 5 deletions backends/apple/coreml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ cmake_minimum_required(VERSION 3.19)

project(executorch_coreml_backend)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

# Source root directory for executorch.
if(NOT EXECUTORCH_ROOT)
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
Expand Down Expand Up @@ -117,8 +121,3 @@ set(
TARGET coremldelegate
APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-receiver-expr"
)

set_property(
TARGET coremldelegate
PROPERTY CXX_STANDARD 17
)
1 change: 1 addition & 0 deletions backends/apple/coreml/runtime/delegate/asset.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#import <Foundation/Foundation.h>

#import <numeric>
#import <optional>
#import <string>
#import <vector>

Expand Down
8 changes: 0 additions & 8 deletions build/test_ios_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ say "Installing MPS Backend Requirements"

./backends/apple/mps/install_requirements.sh

say "Installing Python Bindings"

EXECUTORCH_BUILD_PYBIND=ON \
BUCK="$(which buck2)" \
CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON" \
CMAKE_BUILD_PARALLEL_LEVEL=9 \
pip install . --no-build-isolation -v

say "Exporting Models"

python3 -m examples.portable.scripts.export --model_name="$MODEL_NAME" --segment_alignment=0x4000
Expand Down