Skip to content

Commit

Permalink
deepspeed engine: fp16 support validation on init (#4843)
Browse files Browse the repository at this point in the history
  • Loading branch information
nelyahu authored Dec 26, 2023
1 parent c37fe9c commit 3e94f8c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deepspeed/runtime/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,9 @@ def _supported_optims(self):

# Validate configuration based on command line arguments
def _do_sanity_check(self):
if self.fp16_enabled() and not get_accelerator().is_fp16_supported():
raise ValueError("Type fp16 is not supported.")

expected_optim_types = self._supported_optims()
expected_optim_types += [type(None), Callable]
assert isinstance(self.client_optimizer, tuple(expected_optim_types)), \
Expand Down

0 comments on commit 3e94f8c

Please sign in to comment.