Skip to content

Commit

Permalink
tiny style change
Browse files Browse the repository at this point in the history
  • Loading branch information
dblalock committed Aug 15, 2023
1 parent 476a9ec commit b87ca31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llmfoundry/optim/lion8b.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def lion_step_unfused(grads: torch.Tensor,
beta2: float,
weight_decay: float = 0) -> torch.Tensor:
# f32 cast to match fused impl + for compatibility with f32 grads or weights
momentums = momentums.to(torch.float32)
momentums = momentums.to(dtype=torch.float32)
grads = grads.to(dtype=torch.float32)

update = momentums.lerp(grads, 1 - beta1).sign_()
Expand Down

0 comments on commit b87ca31

Please sign in to comment.