-
Notifications
You must be signed in to change notification settings - Fork 39
70 lines (63 loc) · 2.5 KB
/
test_models.yml
File metadata and controls
70 lines (63 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: ExecuTorch E2E / Python - Test
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
discover-tests:
runs-on: ubuntu-22.04
outputs:
model_names: ${{ steps.set-matrix.outputs.model_names }}
steps:
- uses: actions/checkout@v6
- name: Find model tests
id: set-matrix
run: |
# Find all test files and extract model names correctly
MODEL_NAMES=$(find tests/models -name "test_modeling_*.py" -type f | sed 's|tests/models/test_modeling_||' | sed 's|\.py$||' | paste -sd "," -)
echo "model_names=[\"${MODEL_NAMES//,/\",\"}\"]" >> $GITHUB_OUTPUT
# Display all discovered models
echo "Discovered models:"
echo "$MODEL_NAMES" | tr ',' '\n' | sort | awk '{print "- " $0}'
run-tests:
needs: discover-tests
strategy:
fail-fast: false
matrix:
test-modeling: ${{ fromJson(needs.discover-tests.outputs.model_names) }}
executorch-version: ['1.0.0', 'nightly']
python-version: ['3.11']
# os: [macos-15, ubuntu-22.04] # TODO(#122): Re-enable the mac tests after fixing seg fault.
os: [ubuntu-22.04]
# Custom job name, now shortened and cleaner
name: ${{ matrix.test-modeling }} (et=${{ matrix.executorch-version }}, py=${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
MODEL_NAME: ${{ matrix.test-modeling }}
steps:
- uses: actions/checkout@v6
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for ExecuTorch
run: |
# Clean up cache to save space
pip cache purge || true
rm -rf ~/.cache/huggingface/hub/* || true
if [ "${{ matrix.executorch-version }}" == "nightly" ]; then
python install_dev.py
else
# Use CPU-only torch to avoid CUDA dependencies (saves ~5GB)
pip install --no-cache-dir '.[dev]' \
--extra-index-url https://download.pytorch.org/whl/cpu
pip install --no-cache-dir executorch==${{ matrix.executorch-version }}
fi
pip list
- name: Run tests
run: |
RUN_SLOW=1 pytest tests/models/test_modeling_${{ matrix.test-modeling }}.py -s -vvvv --durations=0 --log-cli-level=INFO