Skip to content

Commit

Permalink
Requires grad checking. (#3789)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeff Rasley <[email protected]>
  • Loading branch information
jomayeri and jeffra committed Jun 23, 2023
1 parent ac8614e commit 48930f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepspeed/runtime/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2292,7 +2292,7 @@ def _get_gradients_for_reduction(self):
expert_grads[key] = []

for param_name, param in self.module.named_parameters():
if param.grad is None:
if param.grad is None and param.requires_grad:
# In cases where there is an imbalance of empty grads across
# ranks we must create empty grads, this will ensure that every
# rank is reducing the same size. In some cases it may make
Expand Down

0 comments on commit 48930f3

Please sign in to comment.