File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 63
63
64
64
echo " MPS option ${MPS} "
65
65
66
+ if [[ " ${MODE} " =~ .* coreml.* ]]; then
67
+ COREML=ON
68
+ else
69
+ COREML=OFF
70
+ fi
71
+
72
+ echo " COREML option ${COREML} "
73
+
66
74
if [[ -z " ${BUCK:- } " ]]; then
67
75
BUCK=buck2
68
76
fi
@@ -86,6 +94,7 @@ cmake_install_executorch_libraries() {
86
94
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
87
95
-DEXECUTORCH_BUILD_XNNPACK=" $XNNPACK " \
88
96
-DEXECUTORCH_BUILD_MPS=" $MPS " \
97
+ -DEXECUTORCH_BUILD_COREML=" $COREML " \
89
98
-DPYTHON_EXECUTABLE=" $PYTHON_EXECUTABLE " \
90
99
-Bcmake-out .
91
100
cmake --build cmake-out -j9 --target install --config Debug
154
163
if [[ " ${MPS} " == " ON" ]]; then
155
164
EXPORT_ARGS=" ${EXPORT_ARGS} -kv -v --mps --disable_dynamic_shape"
156
165
fi
166
+ if [[ " ${COREML} " == " ON" ]]; then
167
+ EXPORT_ARGS=" ${EXPORT_ARGS} -kv -v --coreml --disable_dynamic_shape"
168
+ fi
157
169
# Add dynamically linked library location
158
170
$PYTHON_EXECUTABLE -m examples.models.llama2.export_llama ${EXPORT_ARGS}
159
171
Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ jobs:
225
225
matrix :
226
226
dtype : [fp32]
227
227
build-tool : [buck2, cmake]
228
- mode : [portable, xnnpack+kv+custom, mps]
228
+ mode : [portable, xnnpack+kv+custom, mps, coreml ]
229
229
fail-fast : false
230
230
with :
231
231
runner : macos-m1-stable
@@ -245,6 +245,10 @@ jobs:
245
245
echo "mps doesn't support buck2."
246
246
exit 0
247
247
fi
248
+ if [[ "${MODE}" == "coreml" ]]; then
249
+ echo "coreml doesn't support buck2."
250
+ exit 0
251
+ fi
248
252
fi
249
253
250
254
bash .ci/scripts/setup-conda.sh
@@ -253,10 +257,13 @@ jobs:
253
257
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh "${BUILD_TOOL}"
254
258
255
259
if [[ "${MODE}" == "mps" ]]; then
260
+ # Install mps delegate
256
261
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash backends/apple/mps/install_requirements.sh
257
262
echo "Finishing installing mps."
258
- else
259
- echo "Not mps mode, skip installing mps."
263
+ elif [[ "${MODE}" == "coreml" ]]; then
264
+ # Install coreml delegate
265
+ PYTHON_EXECUTABLE=python ${CONDA_RUN} bash backends/apple/coreml/scripts/install_requirements.sh
266
+ echo "Finishing installing coreml."
260
267
fi
261
268
262
269
# Install requirements for export_llama
You can’t perform that action at this time.
0 commit comments