32
32
"RUN_PT_FLAX_CROSS_TESTS" : False ,
33
33
}
34
34
# Disable the use of {"s": None} as the output is way too long, causing the navigation on CircleCI impractical
35
- COMMON_PYTEST_OPTIONS = {"max-worker-restart" : 0 , "dist" : "loadfile" }
35
+ COMMON_PYTEST_OPTIONS = {"max-worker-restart" : 0 , "dist" : "loadfile" , "v" : None }
36
36
DEFAULT_DOCKER_IMAGE = [{"image" : "cimg/python:3.8.12" }]
37
37
38
38
@@ -52,7 +52,7 @@ class CircleCIJob:
52
52
name : str
53
53
additional_env : Dict [str , Any ] = None
54
54
cache_name : str = None
55
- cache_version : str = "0.7 "
55
+ cache_version : str = "0.8.2 "
56
56
docker_image : List [Dict [str , str ]] = None
57
57
install_steps : List [str ] = None
58
58
marker : Optional [str ] = None
@@ -128,22 +128,6 @@ def to_dict(self):
128
128
steps .extend ([{"run" : l } for l in self .install_steps ])
129
129
steps .extend ([{"run" : 'pip install "fsspec>=2023.5.0,<2023.10.0"' }])
130
130
steps .extend ([{"run" : "pip install pytest-subtests" }])
131
- steps .append (
132
- {
133
- "save_cache" : {
134
- "key" : f"v{ self .cache_version } -{ self .cache_name } -{ cache_branch_prefix } -pip-" + '{{ checksum "setup.py" }}' ,
135
- "paths" : ["~/.cache/pip" ],
136
- }
137
- }
138
- )
139
- steps .append (
140
- {
141
- "save_cache" : {
142
- "key" : f"v{ self .cache_version } -{ self .cache_name } -{ cache_branch_prefix } -site-packages-" + '{{ checksum "setup.py" }}' ,
143
- "paths" : ["~/.pyenv/versions/" ],
144
- }
145
- }
146
- )
147
131
steps .append ({"run" : {"name" : "Show installed libraries and their versions" , "command" : "pip freeze | tee installed.txt" }})
148
132
steps .append ({"store_artifacts" : {"path" : "~/transformers/installed.txt" }})
149
133
@@ -227,7 +211,7 @@ def to_dict(self):
227
211
# failure.
228
212
test_command = f"({ test_command } ) || true"
229
213
else :
230
- test_command += " || true"
214
+ test_command = f"( { test_command } | tee tests_output.txt) || true"
231
215
steps .append ({"run" : {"name" : "Run tests" , "command" : test_command }})
232
216
233
217
# Deal with errors
@@ -264,6 +248,25 @@ def to_dict(self):
264
248
265
249
steps .append ({"store_artifacts" : {"path" : "~/transformers/tests_output.txt" }})
266
250
steps .append ({"store_artifacts" : {"path" : "~/transformers/reports" }})
251
+
252
+ # save cache at the end: so pytest step runs before cache saving and we can see results earlier
253
+ steps .append (
254
+ {
255
+ "save_cache" : {
256
+ "key" : f"v{ self .cache_version } -{ self .cache_name } -{ cache_branch_prefix } -pip-" + '{{ checksum "setup.py" }}' ,
257
+ "paths" : ["~/.cache/pip" ],
258
+ }
259
+ }
260
+ )
261
+ steps .append (
262
+ {
263
+ "save_cache" : {
264
+ "key" : f"v{ self .cache_version } -{ self .cache_name } -{ cache_branch_prefix } -site-packages-" + '{{ checksum "setup.py" }}' ,
265
+ "paths" : ["~/.pyenv/versions/" ],
266
+ }
267
+ }
268
+ )
269
+
267
270
job ["steps" ] = steps
268
271
return job
269
272
@@ -283,6 +286,8 @@ def job_name(self):
283
286
"pip install -U --upgrade-strategy eager .[sklearn,tf-cpu,torch,testing,sentencepiece,torch-speech,vision]" ,
284
287
"pip install -U --upgrade-strategy eager tensorflow_probability" ,
285
288
"pip install -U --upgrade-strategy eager -e git+https://github.com/huggingface/accelerate@main#egg=accelerate" ,
289
+ # TODO: remove this one after fixing the dependency issue(s) above
290
+ "pip install -U --upgrade-strategy eager torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu" ,
286
291
],
287
292
marker = "is_pt_tf_cross_test" ,
288
293
pytest_options = {"rA" : None , "durations" : 0 },
@@ -470,10 +475,11 @@ def job_name(self):
470
475
"pip install -U --upgrade-strategy eager 'git+https://github.com/facebookresearch/detectron2.git'" ,
471
476
"sudo apt install tesseract-ocr" ,
472
477
"pip install -U --upgrade-strategy eager pytesseract" ,
473
- "pip install -U --upgrade-strategy eager ' natten< 0.15.0' " ,
478
+ "pip install -U --upgrade-strategy eager natten== 0.15.1+torch210cpu -f https://shi-labs.com/natten/wheels " ,
474
479
"pip install -U --upgrade-strategy eager python-Levenshtein" ,
475
480
"pip install -U --upgrade-strategy eager opencv-python" ,
476
481
"pip install -U --upgrade-strategy eager nltk" ,
482
+ "pip uninstall -y torch torchvision torchaudio && pip install -U --upgrade-strategy eager 'torch<2.2.0' 'torchvision<0.17' 'torchaudio<2.2.0'"
477
483
],
478
484
tests_to_run = [
479
485
"tests/models/*layoutlmv*" ,
@@ -513,9 +519,11 @@ def job_name(self):
513
519
"pip install --upgrade --upgrade-strategy eager pip" ,
514
520
"pip install -U --upgrade-strategy eager -e .[dev]" ,
515
521
"pip install -U --upgrade-strategy eager -e git+https://github.com/huggingface/accelerate@main#egg=accelerate" ,
516
- "pip install --upgrade --upgrade-strategy eager pytest pytest-sugar" ,
517
- "pip install -U --upgrade-strategy eager ' natten< 0.15.0' " ,
522
+ "pip install --upgrade --upgrade-strategy eager ' pytest<8.0.0' pytest-sugar" ,
523
+ "pip install -U --upgrade-strategy eager natten== 0.15.1+torch210cpu -f https://shi-labs.com/natten/wheels " ,
518
524
"pip install -U --upgrade-strategy eager g2p-en" ,
525
+ # TODO: remove this one after fixing the dependency issue(s) above
526
+ "pip install -U --upgrade-strategy eager torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu" ,
519
527
"find -name __pycache__ -delete" ,
520
528
"find . -name \*.pyc -delete" ,
521
529
# Add an empty file to keep the test step running correctly even no file is selected to be tested.
0 commit comments