Skip to content

Test MV3 model in CI wheel builds #9192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2025
Merged

Test MV3 model in CI wheel builds #9192

merged 2 commits into from
Mar 18, 2025

Conversation

jathu
Copy link
Contributor

@jathu jathu commented Mar 12, 2025

Summary

As part of #9019, we want to ensure we can export models on P0 hosts targeting P0 backends. So, let's test this in our wheel creation. For now, we introduce macOS/Linux XNNPACK export.

Given the wheel building GitHub workflow doesn't support using jobs as a test step, we must go use a python script. This runs a similar test to what we do in PRs:

test-models-linux:
name: test-models-linux
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
permissions:
id-token: write
contents: read
strategy:
matrix:
model: [linear, add, add_mul, ic3, mv2, resnet18, resnet50, mobilebert, emformer_transcribe]
backend: [portable, xnnpack-quantization-delegation]
runner: [linux.2xlarge]
include:
- model: ic4
backend: portable
runner: linux.4xlarge.memory
- model: ic4
backend: xnnpack-quantization-delegation
runner: linux.4xlarge.memory
- model: emformer_join
backend: portable
runner: linux.4xlarge.memory
- model: emformer_join
backend: xnnpack-quantization-delegation
runner: linux.4xlarge.memory
- model: phi-4-mini
backend: portable
runner: linux.4xlarge.memory
- model: llama3_2_vision_encoder
backend: portable
runner: linux.4xlarge.memory
- model: w2l
backend: portable
runner: linux.4xlarge.memory
fail-fast: false
with:
runner: ${{ matrix.runner }}
docker-image: executorch-ubuntu-22.04-clang12
submodules: 'true'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 90
script: |
# The generic Linux job chooses to use base env, not the one setup by the image
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
conda activate "${CONDA_ENV}"
MODEL_NAME=${{ matrix.model }}
BUILD_TOOL=cmake
BACKEND=${{ matrix.backend }}
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "${BUILD_TOOL}"
# Build and test ExecuTorch
PYTHON_EXECUTABLE=python bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "${BACKEND}"

Test plan

CI → Build {Linux, macOS} Wheels

cc @larryliu0820 @lucylq

Copy link

pytorch-bot bot commented Mar 12, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9192

Note: Links to docs will display an error until the docs builds have been completed.

⏳ 1 Pending, 2 Unrelated Failures

As of commit 61d2afe with merge base a05c4da (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 12, 2025
@jathu jathu force-pushed the jathu/upgrade-wheel-test branch 28 times, most recently from 52bb7b0 to ed5444f Compare March 13, 2025 23:50
@jathu jathu force-pushed the jathu/upgrade-wheel-test branch 2 times, most recently from a9a24d4 to 11c818b Compare March 14, 2025 22:14
@jathu jathu changed the title [wheel] Test models in CI wheel builds [wheel] Test MV3 model in CI wheel builds Mar 14, 2025
@jathu jathu force-pushed the jathu/upgrade-wheel-test branch from 11c818b to d768b30 Compare March 14, 2025 22:30
@jathu jathu marked this pull request as ready for review March 14, 2025 23:14
@jathu jathu force-pushed the jathu/upgrade-wheel-test branch from d768b30 to 00af75e Compare March 15, 2025 02:17
@jathu jathu changed the title [wheel] Test MV3 model in CI wheel builds Test MV3 model in CI wheel builds Mar 16, 2025
@jathu jathu added module: ci Issues related to continuous integration module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch labels Mar 17, 2025
Copy link
Contributor

@larryliu0820 larryliu0820 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is way better than before and thanks for adding the test after building the wheel.

Comment on lines +57 to +59
os.path.join(_repository_root_dir(), ".ci/scripts/test_model.sh"),
str(model_test.model),
# What to build `executor_runner` with for testing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need so many redirections?

Can we just call this command directly in the .yml file?

Copy link
Contributor

@mergennachin mergennachin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having this

smoke-test-script: ${{ matrix.smoke-test-script }}

can we just run the script directly, similar to how we do in pull.yml and trunk.yml

@jathu
Copy link
Contributor Author

jathu commented Mar 17, 2025

Instead of having this

smoke-test-script: ${{ matrix.smoke-test-script }}

can we just run the script directly, similar to how we do in pull.yml and trunk.yml

I don't think this is possible with the current job template, it only support running python scripts:

https://github.com/pytorch/test-infra/blob/dd355a4aa131ba56a81bee1ff408ff14b1bcbf70/.github/workflows/build_wheels_macos.yml#L220-L251

@jathu jathu force-pushed the jathu/upgrade-wheel-test branch 2 times, most recently from fb34916 to 8880b82 Compare March 18, 2025 15:59
@jathu jathu force-pushed the jathu/upgrade-wheel-test branch from 8880b82 to 61d2afe Compare March 18, 2025 20:12
@jathu jathu merged commit 0e5f309 into main Mar 18, 2025
166 of 169 checks passed
@jathu jathu deleted the jathu/upgrade-wheel-test branch March 18, 2025 21:43
oscarandersson8218 pushed a commit to oscarandersson8218/executorch that referenced this pull request Mar 21, 2025
### Summary

As part of pytorch#9019, we want to
ensure we can export models on P0 hosts targeting P0 backends. So, let's
test this in our wheel creation. For now, we introduce macOS/Linux
XNNPACK export.

Given the wheel building GitHub workflow doesn't support using jobs as a
test step, we must go use a python script. This runs a similar test to
what we do in PRs:


https://github.com/pytorch/executorch/blob/1011fdc98bcd61063b845670fb1779635aa30e3a/.github/workflows/pull.yml#L85-L136

### Test plan

CI → Build {Linux, macOS} Wheels

cc @larryliu0820 @lucylq
DannyYuyang-quic pushed a commit to CodeLinaro/executorch that referenced this pull request Apr 2, 2025
### Summary

As part of pytorch#9019, we want to
ensure we can export models on P0 hosts targeting P0 backends. So, let's
test this in our wheel creation. For now, we introduce macOS/Linux
XNNPACK export.

Given the wheel building GitHub workflow doesn't support using jobs as a
test step, we must go use a python script. This runs a similar test to
what we do in PRs:


https://github.com/pytorch/executorch/blob/1011fdc98bcd61063b845670fb1779635aa30e3a/.github/workflows/pull.yml#L85-L136

### Test plan

CI → Build {Linux, macOS} Wheels

cc @larryliu0820 @lucylq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch module: ci Issues related to continuous integration topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants