Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deepspeed/runtime/zero/stage3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@ def _overflow_clean_up(self, prev_scale):
def _overflow_check_and_loss_scale_update(self):

# First compute norm for all group so we know if there is overflow
if self.dtype == torch.float16:
if self.dtype in [torch.float16, torch.bfloat16]:
self.check_overflow()

#loss scaling related computation
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/runtime/zero/stage_1_and_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,7 @@ def step(self, closure=None):
see_memory_usage(f"In step before checking overflow")

# First compute norm for all group so we know if there is overflow
if self.dtype == torch.float16:
if self.dtype in [torch.float16, torch.bfloat16]:
self.check_overflow()

prev_scale = self.loss_scale
Expand Down
Loading