From af97aff064cfe72bec732bacccc0207681881495 Mon Sep 17 00:00:00 2001 From: Mergen Nachin Date: Thu, 13 Mar 2025 10:58:37 -0400 Subject: [PATCH] Refactor and deprecate gather_test_models --- .ci/scripts/gather_test_models.py | 3 +++ .github/workflows/pull.yml | 25 ++++-------------- .github/workflows/trunk.yml | 44 ++++++++++++++++--------------- 3 files changed, 31 insertions(+), 41 deletions(-) diff --git a/.ci/scripts/gather_test_models.py b/.ci/scripts/gather_test_models.py index 9ede09b2865..b32a052026a 100755 --- a/.ci/scripts/gather_test_models.py +++ b/.ci/scripts/gather_test_models.py @@ -5,6 +5,9 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. +# WARNING: The CI runner logic should directly be in the corresponding yml files +# This file will be deleted once the reference in periodic.yml is deleted. + import itertools import json import os diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 5cc0d3c597b..c066a7045aa 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -13,24 +13,6 @@ concurrency: cancel-in-progress: true 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-setup-linux-gcc: name: test-setup-linux-gcc uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main @@ -62,9 +44,12 @@ jobs: permissions: id-token: write contents: read - needs: gather-models strategy: - matrix: ${{ fromJSON(needs.gather-models.outputs.models) }} + matrix: + model: [mv3, vit] + backend: [portable, xnnpack-quantization-delegation] + build-tool: [cmake, buck2] + runner: [linux.2xlarge] fail-fast: false with: runner: ${{ matrix.runner }} diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 84603f75e65..0a6170a9edf 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -18,37 +18,39 @@ concurrency: cancel-in-progress: true 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 --target-os macos --event "${GITHUB_EVENT_NAME}" - test-models-macos: name: test-models-macos uses: pytorch/test-infra/.github/workflows/macos_job.yml@main - needs: gather-models strategy: - matrix: ${{ fromJSON(needs.gather-models.outputs.models) }} + matrix: + model: [add, add_mul, emformer_join, emformer_transcribe, ic3, ic4, linear, llama2, mobilebert, mv2, mv3, resnet18, resnet50, vit, w2l] + backend: [portable, xnnpack-quantization-delegation] + build-tool: [cmake] + runner: [macos-m1-stable] + include: + - model: efficient_sam + backend: portable + - model: llama + backend: portable + - model: llama3_2_vision_encoder + backend: portable + - model: lstm + backend: portable + - model: mul + backend: portable + - model: phi-4-mini + backend: portable + - model: qwen2_5 + backend: portable + - model: softmax + backend: portable fail-fast: false with: runner: ${{ matrix.runner }} python-version: '3.11' submodules: 'true' ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} - timeout: ${{ matrix.timeout }} + timeout: 90 script: | MODEL_NAME=${{ matrix.model }} BUILD_TOOL=${{ matrix.build-tool }}