Skip to content

Commit a8189f0

Browse files
artkorenevArtem Korenev
and
Artem Korenev
authored
fix no shard case (#1150)
Co-authored-by: Artem Korenev <[email protected]>
1 parent 17ecf4a commit a8189f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fairscale/nn/data_parallel/fully_sharded_data_parallel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,7 @@ def _post_backward_hook(self, param: Parameter, *unused: Any) -> None:
17591759
# world_size == 1. This could be relaxed in the future, in which
17601760
# case grads should be all-reduced here.
17611761
assert self.world_size == 1
1762-
self._post_reduction_hook(param, param.grad.data)
1762+
self._post_reduction_hook(param, param.grad)
17631763

17641764
# After _post_backward_hook returns, orig_grad_data will eventually
17651765
# go out of scope, at which point it could otherwise be freed for

0 commit comments

Comments
 (0)