add torch.compile by default, shows almost 1.8X improvement in throughput nice

This commit is contained in:
Andrej Karpathy committed 2022-12-30 00:07:13 +00:00
1 parent fb52554ca8
commit 5a725d9098
4 files changed
+19 -3

No files matched your search

+1
View File
@@ -21,6 +21,7 @@ model = GPT(gptconf)
model.load_state_dict(checkpoint['model'])
model.eval()
model.to(device)
model = torch.compile(model) # requires PyTorch 2.0
enc = tiktoken.get_encoding("gpt2")
#start = enc.encode("\n")