[hotfix] adapt ProcessGroup and Optimizer to ColoTensor (#1388)

This commit is contained in:
HELSON
2022-07-29 19:33:24 +08:00
committed by GitHub
parent ad678921db
commit c7221cb2d4
7 changed files with 20 additions and 16 deletions

View File

@@ -104,7 +104,7 @@ class FusedSGD(Optimizer):
# momentum application can be skipped in the main kernel.
if 'momentum_buffer' not in param_state:
first_run = True
buf = param_state['momentum_buffer'] = torch.zeros_like(p.data)
buf = param_state['momentum_buffer'] = torch.zeros_like(p)
momentums.append(buf)
else:
first_run = False