-
Notifications
You must be signed in to change notification settings - Fork 2
167 lines (144 loc) · 6.43 KB
/
ci.yml
File metadata and controls
167 lines (144 loc) · 6.43 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: ci
on:
push:
pull_request:
types:
- closed
branches:
- main
jobs:
run:
name: to-${{ matrix.torch }}-tr-${{ matrix.transformers }}-ci ${{ matrix.os }}-${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ['3.10', '3.11', '3.12', '3.13']
transformers: ['4.48.3', '4.51.3', '4.52.4', '4.55.4', '4.56.2', '4.57.3', 'main']
torch: ['2.9', 'main']
exclude:
- python: '3.10' # 3.10
torch: 'main'
- python: '3.10'
torch: '2.9'
- python: '3.10'
transformers: 'main'
- python: '3.10'
transformers: '4.52.4'
- python: '3.10'
transformers: '4.55.4'
- python: '3.10'
transformers: '4.56.2'
- python: '3.10'
transformers: '4.57.3'
- python: '3.11' # 3.11
torch: 'main'
- python: '3.11'
transformers: 'main'
- python: '3.11'
transformers: '4.55.4'
- python: '3.11'
transformers: '4.56.2'
- python: '3.11'
transformers: '4.57.3'
- python: '3.13' # 3.11
torch: '2.9'
- python: '3.13'
transformers: '4.48.3'
- python: '3.13'
transformers: '4.51.3'
- python: '3.13'
transformers: '4.55.4'
- python: '3.13'
transformers: '4.56.2'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install pytorch ${{ matrix.torch }}
run: |
if [[ "${{ matrix.torch }}" == "main" ]]; then
python -m pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu
else
echo "install torch==${{ matrix.torch }} torchvision torchaudio"
pip install torch==${{ matrix.torch }} torchvision torchaudio
fi
- name: Install transformers ${{ matrix.transformers }}
run: |
if [[ "${{ matrix.transformers }}" == "main" ]]; then
echo "install transformers from github"
git clone https://github.com/huggingface/transformers.git
cd transformers
pip install -e .
cd ..
else
echo "install transformers==${{ matrix.transformers }}"
pip install transformers==${{ matrix.transformers }}
fi
- name: Install requirements
run: python -m pip install -r requirements.txt
- name: Install requirements dev
run: python -m pip install -r requirements-dev.txt
- name: Uninstall onnx-diagnostic
run: python -m pip uninstall -y onnx-diagnostic
- name: Uninstall onnx and install onnx-weekly
run: |
python -m pip uninstall -y onnx
python -m pip install onnx-weekly
- name: Install pytorch ${{ matrix.torch }} (2)
run: |
if [[ "${{ matrix.torch }}" == "main" ]]; then
python -m pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu
else
echo "install torch==${{ matrix.torch }} torchvision torchaudio"
pip install torch==${{ matrix.torch }} torchvision torchaudio
fi
- name: Cache pip
if: ${{ matrix.torch != 'main' && matrix.transformers != 'main' }}
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: pip freeze
run: python -m pip freeze
- name: tiny-llm torch.export.export
run: PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_tiny_llms.py
- name: tiny-llm onnx
run: PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_tiny_llms_onnx.py
continue-on-error: true # connectivity issues
- name: tiny-llm example
run: PYTHONPATH=. UNITTEST_GOING=1 python _doc/examples/plot_export_tiny_llm.py
continue-on-error: true # connectivity issues
- name: tiny-llm bypass
run: PYTHONPATH=. UNITTEST_GOING=1 python _doc/examples/plot_export_tiny_llm_patched.py
continue-on-error: true # connectivity issues
- name: run tests bypassed
run: PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_tiny_llms_bypassed.py
- name: test image_classification
run: PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_tasks/test_tasks_image_classification.py
- name: test zero_shot_image_classification
run: PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_tasks/test_tasks_zero_shot_image_classification.py
- name: run tests
run: |
pip install pytest
PYTHONPATH=. UNITTEST_GOING=1 pytest --durations=10 _unittests --ignore _unittests/ut_reference/test_backend_extended_reference_evaluator.py --ignore _unittests/ut_reference/test_backend_onnxruntime_evaluator.py --ignore _unittests/ut_torch_models/test_tiny_llms_bypassed.py --ignore _unittests/ut_tasks/test_tasks_zero_shot_image_classification.py --ignore _unittests/ut_tasks/test_tasks_image_classification.py --ignore-glob _unittests/ut_torch_models/test_validate_whole_models*.py --ignore-glob _unittests/ut_torch_models/test_validate_models*.py
- name: test models
run: |
echo "----"
PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_validate_models.py
echo "----"
PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_validate_whole_models1.py
echo "----"
PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_validate_whole_models2.py
echo "----"
PYTHONPATH=. UNITTEST_GOING=1 python _unittests/ut_torch_models/test_validate_whole_models3.py
echo "----"
# - name: run backend tests python
# run: PYTHONPATH=. UNITTEST_GOING=1 pytest --durations=10 _unittests/ut_reference/test_backend_extended_reference_evaluator.py
# - name: run backend tests onnxruntime
# run: PYTHONPATH=. UNITTEST_GOING=1 pytest --durations=10 _unittests/ut_reference/test_backend_onnxruntime_evaluator.py --maxfail=15