Commit 67a959c
committed
CI Handle 2 errors with MacOS and transformers
Changes in transformers introduced 2 errors in the MacOS CI, which are
handled in this PR.
Context
For context on why we use torch 2.2 for MacOS, check huggingface#2431.
Unfortunately, as of today, the available GH workers for MacOS still
haven't improved.
Description
The 1st error was introduced by
huggingface/transformers#37785, which results in
torch.load failing when using torch < 2.6.
The 2nd error was introduced by
huggingface/transformers#37919, which results in
a DTensor import being triggered when calling save_pretrained, which
fails with MacOS and torch 2.2 (possibly also later MacOS versions, I
haven't checked).
The proposed solution is to plug into pytest, intercept the test report,
check for these specific errors, and turn them into skips.
Alternative solutions
The proposed solution is obviously an ugly hack. However, these are
errors we cannot fix directly, as they're caused by a dependency and are
caused by the old torch version we're forced to use (thus fixing them in
transformers is probably not an option).
Instead of altering the test report, the individual tests that fail
could get an explicit skip marker when MacOS is detected. However, since
the amount of affected tests are several hundreds, this is very
impractical and leads to a lot of noise in the tests.
Alternatively, we could move forward with the proposal in huggingface#2431 and
remove MacOS completely from the CI. I do, however, still have the faint
hope that GH will provide arm64 workers with more RAM in the future,
allowing us to switch.1 parent b3130c9 commit 67a959c
1 file changed
+41
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
31 | 34 | | |
32 | 35 | | |
33 | 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 | + | |
0 commit comments