mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-05 19:13:01 +00:00
[hotfix] adapt ProcessGroup and Optimizer to ColoTensor (#1388)
This commit is contained in:
@@ -116,9 +116,9 @@ class HybridAdam(NVMeOptimizer):
|
||||
state['step'] = 0
|
||||
|
||||
# gradient momentums
|
||||
state['exp_avg'] = torch.zeros_like(p.data, dtype=torch.float, device=target_device)
|
||||
state['exp_avg'] = torch.zeros_like(p, dtype=torch.float, device=target_device)
|
||||
# gradient variances
|
||||
state['exp_avg_sq'] = torch.zeros_like(p.data, dtype=torch.float, device=target_device)
|
||||
state['exp_avg_sq'] = torch.zeros_like(p, dtype=torch.float, device=target_device)
|
||||
self._post_state_init(p)
|
||||
|
||||
state['step'] += 1
|
||||
|
Reference in New Issue
Block a user