Skip to content

Commit 46b10a7

Browse files
cccclaifacebook-github-bot
authored andcommitted
add coreml stories end to end ci (#4161)
Summary: Pull Request resolved: #4161 ghstack-source-id: 232863655 exported-using-ghexport Reviewed By: kirklandsign Differential Revision: D59412583 fbshipit-source-id: 6659ad4d421c536a0bc699e4ca8e2c51cd357184
1 parent b91c20b commit 46b10a7

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

.ci/scripts/test_llama.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ fi
6363

6464
echo "MPS option ${MPS}"
6565

66+
if [[ "${MODE}" =~ .*coreml.* ]]; then
67+
COREML=ON
68+
else
69+
COREML=OFF
70+
fi
71+
72+
echo "COREML option ${COREML}"
73+
6674
if [[ -z "${BUCK:-}" ]]; then
6775
BUCK=buck2
6876
fi
@@ -86,6 +94,7 @@ cmake_install_executorch_libraries() {
8694
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
8795
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
8896
-DEXECUTORCH_BUILD_MPS="$MPS" \
97+
-DEXECUTORCH_BUILD_COREML="$COREML" \
8998
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
9099
-Bcmake-out .
91100
cmake --build cmake-out -j9 --target install --config Debug
@@ -154,6 +163,9 @@ fi
154163
if [[ "${MPS}" == "ON" ]]; then
155164
EXPORT_ARGS="${EXPORT_ARGS} -kv -v --mps --disable_dynamic_shape"
156165
fi
166+
if [[ "${COREML}" == "ON" ]]; then
167+
EXPORT_ARGS="${EXPORT_ARGS} -kv -v --coreml --disable_dynamic_shape"
168+
fi
157169
# Add dynamically linked library location
158170
$PYTHON_EXECUTABLE -m examples.models.llama2.export_llama ${EXPORT_ARGS}
159171

.github/workflows/trunk.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ jobs:
225225
matrix:
226226
dtype: [fp32]
227227
build-tool: [buck2, cmake]
228-
mode: [portable, xnnpack+kv+custom, mps]
228+
mode: [portable, xnnpack+kv+custom, mps, coreml]
229229
fail-fast: false
230230
with:
231231
runner: macos-m1-stable
@@ -245,6 +245,10 @@ jobs:
245245
echo "mps doesn't support buck2."
246246
exit 0
247247
fi
248+
if [[ "${MODE}" == "coreml" ]]; then
249+
echo "coreml doesn't support buck2."
250+
exit 0
251+
fi
248252
fi
249253
250254
bash .ci/scripts/setup-conda.sh
@@ -253,10 +257,13 @@ jobs:
253257
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh "${BUILD_TOOL}"
254258
255259
if [[ "${MODE}" == "mps" ]]; then
260+
# Install mps delegate
256261
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash backends/apple/mps/install_requirements.sh
257262
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."
260267
fi
261268
262269
# Install requirements for export_llama

0 commit comments

Comments
 (0)