Skip to content

Commit

Permalink
simplify bool
Browse files Browse the repository at this point in the history
  • Loading branch information
karpathy committed Apr 22, 2024
1 parent a332ea5 commit 4e4eba0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion train_gpt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def get_batch():
write_model(model, "gpt2_124M.bin")
write_state(model, x, y, logits, loss, "gpt2_124M_debug_state.bin")

use_fused = True if device == "cuda" else False
use_fused = device == "cuda" # only works on CUDA (?)
optimizer = torch.optim.Adam(model.parameters(), lr=1e-4, fused=use_fused)
timings = []
if device == "cuda":
Expand Down

0 comments on commit 4e4eba0

Please sign in to comment.