Browse Source

Rename class method of ZeroDDP (#2692)

pull/2876/head^2
junxu 2 years ago committed by GitHub
parent
commit
c52edcf0eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      colossalai/nn/parallel/data_parallel.py

4
colossalai/nn/parallel/data_parallel.py

@ -294,7 +294,7 @@ class ZeroDDP(ColoDDP):
continue
p.grad = None
def _pre_bacward(self):
def _pre_backward(self):
# set a visit label for all parameters
# the label is used to check whether the parameter is correctly reduced
for param in self.param2name:
@ -318,7 +318,7 @@ class ZeroDDP(ColoDDP):
self.gemini_manager.post_iter()
def backward(self, loss: torch.Tensor):
self._pre_bacward()
self._pre_backward()
with self.param_op_hook.switch_to_backward(), ColoParamOpHookManager.use_hooks(self.param_op_hook):
loss.backward()
self._post_backward()

Loading…
Cancel
Save