Commit 493dafa
authored
Skip fp16-config tests on accelerators without fp16 support (#8398)
## Problem
`TestMultipleModels::test_zero_optimizer`, `TestSimpleMoE`, `TestMoE`,
`TestPRMoE`, and `TestMOETensorParallel` hardcode `"fp16": {"enabled":
True}` in their DeepSpeed configs. The engine's sanity check then
raises:
```
ValueError: Type fp16 is not supported on your device.
```
on any accelerator whose `is_fp16_supported()` is false. On CPU that
maps to the AVX512-FP16 capability of the host, and GitHub's
`ubuntu-24.04` runners are hardware-heterogeneous: **the same test
passes on one runner and fails on the next** (observed directly in #8381
— 146 failures appeared on one runner generation and none on another,
with identical code).
## Change
Skip these tests via a capability query:
```python
@pytest.mark.skipif(not get_accelerator().is_fp16_supported(), reason="fp16 is not supported on this accelerator")
```
- capability only, no accelerator-name matching;
- mirrors the existing bf16 skip precedent in
`tests/unit/v1/zero/test_zero_user_backward.py`;
- deliberately a **skip** rather than silently running bf16 — these
tests exist to cover the fp16 paths.
## Validation
Validated as part of the multi-rank CPU CI experiment in #8381: the 146
hardware-lottery failures became deterministic skips, zero regressions
on previously-passing tests.
Signed-off-by: Guokai Ma <guokai.ma@intel.com>1 parent e74c707 commit 493dafa
3 files changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
| 169 | + | |
167 | 170 | | |
168 | 171 | | |
169 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
0 commit comments