Skip to content

Commit

Permalink
Introduce periodic.yml (#4348)
Browse files Browse the repository at this point in the history
Summary:
Move model tests to periodic. Takes too much resources for each PR. Keep MV3 (CNN) and VIT only.

Later, we can migrate Android on-device related tests to periodic.

Pull Request resolved: #4348

Reviewed By: huydhn

Differential Revision: D60143298

Pulled By: kirklandsign

fbshipit-source-id: e5a1f3beb8c9457d813afe4a1b0c30db33dcefa5
  • Loading branch information
kirklandsign authored and facebook-github-bot committed Jul 24, 2024
1 parent fd2dccf commit 47d309a
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .ci/scripts/gather_test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def model_should_run_on_event(model: str, event: str) -> bool:
We put higher priority and fast models to pull request and rest to push.
"""
if event == "pull_request":
return model in ["add", "ic3", "mv2", "mv3", "resnet18", "vit", "llava"]
return model in ["mv3", "vit"]
return True


Expand Down
1 change: 1 addition & 0 deletions .github/pytorch-probot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ ciflow_push_tags:
- ciflow/trunk
- ciflow/binaries
- ciflow/binaries/all
- ciflow/periodic
65 changes: 65 additions & 0 deletions .github/workflows/periodic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: periodic

on:
schedule:
# We have several schedules so jobs can check github.event.schedule to activate only for a fraction of the runs.
# Also run less frequently on weekends.
- cron: 45 0,8,16 * * *
push:
tags:
- ciflow/periodic/*
branches:
- release/*
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}-${{ github.event.schedule }}
cancel-in-progress: true

permissions: read-all

jobs:
gather-models:
runs-on: ubuntu-22.04
outputs:
models: ${{ steps.gather-models.outputs.models }}
steps:
- uses: actions/checkout@v3
with:
submodules: 'false'
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Extract the list of models to test
id: gather-models
run: |
set -eux
PYTHONPATH="${PWD}" python .ci/scripts/gather_test_models.py --event "${GITHUB_EVENT_NAME}"
test-models-linux:
name: test-models-linux
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
needs: gather-models
strategy:
matrix: ${{ fromJSON(needs.gather-models.outputs.models) }}
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: ${{ matrix.timeout }}
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=${{ matrix.build-tool }}
BACKEND=${{ matrix.backend }}
DEMO_BACKEND_DELEGATION=${{ matrix.demo_backend_delegation }}
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
# Build and test ExecuTorch
PYTHON_EXECUTABLE=python bash .ci/scripts/test.sh "${MODEL_NAME}" "${BUILD_TOOL}" "${BACKEND}" "${DEMO_BACKEND_DELEGATION}"

0 comments on commit 47d309a

Please sign in to comment.