Rename class method of ZeroDDP (#2692)

pull/2876/head^2
junxu 2023-02-22 15:05:53 +08:00 committed by GitHub
parent 6e4ac08172
commit c52edcf0eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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()