"vscode:/vscode.git/clone" did not exist on "edb978772caea6e18b719d7dd813c597d4e84306"
Commit bd6e66df authored by Kexin Yu's avatar Kexin Yu
Browse files

initialize on device

parent 9033ad58
...@@ -117,7 +117,7 @@ class FusedLAMB(torch.optim.Optimizer): ...@@ -117,7 +117,7 @@ class FusedLAMB(torch.optim.Optimizer):
else: else:
raise RuntimeError('FusedLAMB only support fp16 and fp32.') raise RuntimeError('FusedLAMB only support fp16 and fp32.')
g_norm_32, g_norm_16 = torch.zeros(1), torch.zeros(1) g_norm_32, g_norm_16 = torch.zeros(1, device='cuda'), torch.zeros(1, device='cuda')
# compute grad norm for two lists # compute grad norm for two lists
if len(g_all_32) > 0: if len(g_all_32) > 0:
g_norm_32 = multi_tensor_applier(self.multi_tensor_l2norm, g_norm_32 = multi_tensor_applier(self.multi_tensor_l2norm,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment