Skip fp16-config tests on accelerators without fp16 support - #8684
Merged
Merged
Conversation
Every fp16-config test that reaches deepspeed.initialize crashes its
sanity check ("Type fp16 is not supported on your device.") on
accelerators 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. deepspeedai#8398 added skipifs for the first
three files; the multi-rank CPU run in deepspeedai#8381 flushed out six more:
- checkpoint/test_universal_checkpoint.py: the fp16 parametrizations
fail inside the baseline DistributedFixture's distributed run, which
reports a setup ERROR for every dependent test instead of a skip.
- v1/zero/test_zero_coalesce_grad_reduction.py: TestCoalesceFP16
forces an fp16 config.
- runtime/test_no_sync_ctxt.py: the dtype=float16 parametrizations of
the three dtype-parametrized methods; stages 2/3 additionally never
reach their expected no_sync AssertionError on such hosts.
- checkpoint/test_moe_checkpoint.py: the whole class hardcodes fp16.
- runtime/zero/test_zero_offloadpp.py: TestZeroPartialOffloadConfigSweep
hardcodes fp16.
- checkpoint/test_pipeline.py: fp16 is enabled for zero_stage > 0; skip
only that parametrization so zero_stage=0 keeps running.
With this, every fp16-config test in the suite guards on
is_fp16_supported(): the gap is a skip, not a failure, on any
accelerator. Verified on an fp16-incapable CPU (the affected
parametrizations skip; adjacent non-fp16 ones keep passing) and by the
multi-rank CPU run in deepspeedai#8381.
Signed-off-by: Guokai Ma <guokai.ma@intel.com>
hwchen2017
reviewed
Sep 27, 2026
| def test_zero_stage(self, zero_stage, dtype): | ||
| # The fp16 parametrization crashes initialize's sanity check on accelerators | ||
| # without fp16 support (#8398's hardware lottery); skip instead of failing. | ||
| if dtype == torch.float16 and not get_accelerator().is_fp16_supported(): |
Contributor
There was a problem hiding this comment.
Should we have a check for bf16 here as well?
Collaborator
Author
There was a problem hiding this comment.
Thanks for the comments. Currently CPU with accelerated instruction set (AVX or AMX) has BF16 support. We can add bf16 skip check when we need to run validation on accelerators without bf16 support.
hwchen2017
approved these changes
Sep 28, 2026
Merged
via the queue into
deepspeedai:master
with commit Sep 28, 2026
df00e0b
13 of 15 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Every fp16-config test that reaches
deepspeed.initializecrashes its sanity check (Type fp16 is not supported on your device.) on accelerators whoseis_fp16_supported()is false. On CPU that maps to the AVX512-FP16 capability of the host, and GitHub'subuntu-24.04runners are hardware-heterogeneous, so these tests flip between failure and skip depending on which runner they land on. #8398 added the first skipifs; the multi-rank CPU run in #8381 flushed out six more files:checkpoint/test_universal_checkpoint.pyv1/zero/test_zero_coalesce_grad_reduction.pyTestCoalesceFP16forces an fp16 configruntime/test_no_sync_ctxt.pycheckpoint/test_moe_checkpoint.pyruntime/zero/test_zero_offloadpp.pyTestZeroPartialOffloadConfigSweephardcodes fp16checkpoint/test_pipeline.pyWith this PR, every fp16-config test in the suite guards on
is_fp16_supported()— the capability gap is a skip, not a failure, on any accelerator.Validation (executed on real hardware)
LOCAL_SIZE=2/4)Sibling PRs from the same series: #8397, #8398, #8399, #8407, #8409, #8559, #8648.