Skip to content

Commit

Permalink
return grad in post_backward_hook()
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisxcai committed May 8, 2024
1 parent 901fb86 commit ad40f24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fairscale/nn/misc/flatten_params_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ def _hook(
self.fp32_grads[param_index] = grad.to(torch.float32)
else:
self.fp32_grads[param_index].add_(grad.data)

#logger.info(f"CHRISLOG: after post-backward hook, self.fp32_grads[param_index] is None: {self.fp32_grads[param_index] is None}")
return grad

def _unflatten_params_as_views(self) -> None:
"""Unlike ``_unflatten_params``, this function unflatten into views and keep
Expand Down

0 comments on commit ad40f24

Please sign in to comment.