Skip to content

Commit ac71e8e

Browse files
committed
Add more models to coreml testing
1 parent c16b645 commit ac71e8e

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

.ci/scripts/test_model.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ test_model() {
9191
run_portable_executor_runner
9292
rm "./${MODEL_NAME}.pte"
9393
fi
94-
STRICT="--no-strict"
94+
STRICT="--strict"
9595
if [[ "${MODEL_NAME}" == "llava" ]]; then
9696
# Install requirements for llava
9797
bash examples/models/llava/install_requirements.sh
98+
STRICT="--no-strict"
9899
fi
99100
if [[ "${MODEL_NAME}" == "qwen2_5" ]]; then
100101
# Install requirements for export_llama

.github/workflows/trunk.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21-
test-models-macos:
22-
name: test-models-macos
21+
test-models-macos-cpu:
22+
name: test-models-macos-cpu
2323
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
2424
strategy:
2525
matrix:
@@ -55,6 +55,31 @@ jobs:
5555
# Build and test executorch
5656
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "${BACKEND}"
5757
58+
test-models-macos-coreml:
59+
name: test-models-macos-coreml
60+
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
61+
strategy:
62+
matrix:
63+
model: [dl3, edsr, efficient_sam, emformer_join, emformer_transcribe, ic3, mobilebert, mv3, resnet50, vit, w2l]
64+
backend: [coreml]
65+
fail-fast: false
66+
with:
67+
runner: macos-m1-stable
68+
python-version: '3.11'
69+
submodules: 'recursive'
70+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
71+
timeout: 90
72+
script: |
73+
MODEL_NAME=${{ matrix.model }}
74+
BUILD_TOOL=cmake
75+
BACKEND=${{ matrix.backend }}
76+
77+
bash .ci/scripts/setup-conda.sh
78+
# Setup MacOS dependencies as there is no Docker support on MacOS atm
79+
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh --build-tool "${BUILD_TOOL}"
80+
# Build and test executorch
81+
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "${BACKEND}"
82+
5883
test-models-linux-aarch64:
5984
name: test-models-linux-aarch64
6085
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
@@ -589,7 +614,7 @@ jobs:
589614
echo "Finishing installing coreml."
590615
591616
# Build and test coreml model
592-
MODELS=(mv3 ic4 resnet50 edsr mobilebert w2l)
617+
MODELS=(mv3 ic4 resnet50)
593618
for MODEL_NAME in "${MODELS[@]}"; do
594619
echo "::group::Exporting coreml model: $MODEL_NAME"
595620
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "coreml"

examples/xnnpack/aot_compiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@
8787

8888
model = model.eval()
8989
# pre-autograd export. eventually this will become torch.export
90-
ep = torch.export.export_for_training(model, example_inputs, strict=False)
90+
ep = torch.export.export_for_training(model, example_inputs, strict=True)
9191
model = ep.module()
9292

9393
if args.quantize:
9494
logging.info("Quantizing Model...")
9595
# TODO(T165162973): This pass shall eventually be folded into quantizer
9696
model = quantize(model, example_inputs, quant_type)
97-
ep = torch.export.export_for_training(model, example_inputs, strict=False)
97+
ep = torch.export.export_for_training(model, example_inputs, strict=True)
9898

9999
edge = to_edge_transform_and_lower(
100100
ep,

0 commit comments

Comments
 (0)