Skip to content

Commit 6082b59

Browse files
author
Guang Yang
committed
Run CoreML and MPS models in CI
1 parent 5d12e5b commit 6082b59

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.ci/scripts/test_model.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,15 @@ test_model_with_coreml() {
185185

186186
"${PYTHON_EXECUTABLE}" -m examples.apple.coreml.scripts.export --model_name="${MODEL_NAME}" --compute_precision "${DTYPE}"
187187
EXPORTED_MODEL=$(find "." -type f -name "${MODEL_NAME}*.pte" -print -quit)
188-
# TODO:
188+
189189
if [ -n "$EXPORTED_MODEL" ]; then
190190
EXPORTED_MODEL_WITH_DTYPE="${EXPORTED_MODEL%.pte}_${DTYPE}.pte"
191191
mv "$EXPORTED_MODEL" "$EXPORTED_MODEL_WITH_DTYPE"
192192
EXPORTED_MODEL="$EXPORTED_MODEL_WITH_DTYPE"
193193
echo "Renamed file path: $EXPORTED_MODEL"
194+
195+
bash ./examples/apple/coreml/scripts/build_executor_runner.sh
196+
./coreml_executor_runner --model_path "${EXPORTED_MODEL}"
194197
else
195198
echo "No .pte file found"
196199
exit 1
@@ -200,6 +203,11 @@ test_model_with_coreml() {
200203
test_model_with_mps() {
201204
"${PYTHON_EXECUTABLE}" -m examples.apple.mps.scripts.mps_example --model_name="${MODEL_NAME}" --use_fp16
202205
EXPORTED_MODEL=$(find "." -type f -name "${MODEL_NAME}*.pte" -print -quit)
206+
207+
if [ -n "$EXPORTED_MODEL" ]; then
208+
bash ./examples/apple/mps/scripts/build_mps_executor_runner.sh
209+
./${CMAKE_OUTPUT_DIR}/examples/apple/mps/mps_executor_runner --model_path "${EXPORTED_MODEL}" --bundled_program
210+
fi
203211
}
204212

205213
if [[ "${BACKEND}" == "portable" ]]; then

0 commit comments

Comments
 (0)