Skip to content

Commit 9e83fde

Browse files
shoumikhinfacebook-github-bot
authored andcommitted
Build Apple backends with pybindings on CI. (#2395)
Summary: Pull Request resolved: #2395 . Reviewed By: kirklandsign Differential Revision: D54840033 fbshipit-source-id: 55019d035587c4fa7ee447c129915daa6af225af
1 parent 38b36cb commit 9e83fde

File tree

6 files changed

+19
-17
lines changed

6 files changed

+19
-17
lines changed

.ci/scripts/utils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ install_executorch() {
1919
which pip
2020
# Install executorch, this assumes that Executorch is checked out in the
2121
# current directory
22-
pip install . --no-build-isolation
22+
pip install . --no-build-isolation -v
2323
# Just print out the list of packages for debugging
2424
pip list
2525
}

.github/workflows/_unittest.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ jobs:
3333
conda activate "${CONDA_ENV}"
3434
3535
BUILD_TOOL=${{ matrix.build-tool }}
36+
3637
# Setup MacOS dependencies as there is no Docker support on MacOS atm
37-
PYTHON_EXECUTABLE=python EXECUTORCH_BUILD_PYBIND=ON bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
38+
PYTHON_EXECUTABLE=python \
39+
EXECUTORCH_BUILD_PYBIND=ON \
40+
.ci/scripts/setup-linux.sh "${BUILD_TOOL}"
3841
3942
# Run pytest with coverage
4043
pytest -n auto --cov=./ --cov-report=xml
@@ -59,8 +62,13 @@ jobs:
5962
BUILD_TOOL=${{ matrix.build-tool }}
6063
6164
bash .ci/scripts/setup-conda.sh
65+
6266
# Setup MacOS dependencies as there is no Docker support on MacOS atm
63-
PYTHON_EXECUTABLE=python ${CONDA_RUN} EXECUTORCH_BUILD_PYBIND=ON bash .ci/scripts/setup-macos.sh "${BUILD_TOOL}"
67+
PYTHON_EXECUTABLE=python \
68+
EXECUTORCH_BUILD_PYBIND=ON \
69+
CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON" \
70+
${CONDA_RUN} --no-capture-output \
71+
.ci/scripts/setup-macos.sh "${BUILD_TOOL}"
6472
6573
# Run pytest with coverage
6674
${CONDA_RUN} pytest -n auto --cov=./ --cov-report=xml

.github/workflows/pull.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ jobs:
206206
207207
# build module for executorch.extension.pybindings.portable_lib
208208
BUILD_TOOL=${{ matrix.build-tool }}
209-
PYTHON_EXECUTABLE=python EXECUTORCH_BUILD_PYBIND=ON bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
209+
PYTHON_EXECUTABLE=python \
210+
EXECUTORCH_BUILD_PYBIND=ON \
211+
bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
210212
211213
# see if we can import the module successfully
212214
python -c "from executorch.extension.pybindings import portable_lib; print('success!')"

backends/apple/coreml/CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ cmake_minimum_required(VERSION 3.19)
44

55
project(executorch_coreml_backend)
66

7+
if(NOT CMAKE_CXX_STANDARD)
8+
set(CMAKE_CXX_STANDARD 17)
9+
endif()
10+
711
# Source root directory for executorch.
812
if(NOT EXECUTORCH_ROOT)
913
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
@@ -117,8 +121,3 @@ set(
117121
TARGET coremldelegate
118122
APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-receiver-expr"
119123
)
120-
121-
set_property(
122-
TARGET coremldelegate
123-
PROPERTY CXX_STANDARD 17
124-
)

backends/apple/coreml/runtime/delegate/asset.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#import <Foundation/Foundation.h>
99

1010
#import <numeric>
11+
#import <optional>
1112
#import <string>
1213
#import <vector>
1314

build/test_ios_ci.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ say "Installing MPS Backend Requirements"
3939

4040
./backends/apple/mps/install_requirements.sh
4141

42-
say "Installing Python Bindings"
43-
44-
EXECUTORCH_BUILD_PYBIND=ON \
45-
BUCK="$(which buck2)" \
46-
CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON" \
47-
CMAKE_BUILD_PARALLEL_LEVEL=9 \
48-
pip install . --no-build-isolation -v
49-
5042
say "Exporting Models"
5143

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

0 commit comments

Comments
 (0)