From 9a3f6f392de48348c7dc7f6f4bfff9c40d1096b0 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Fri, 27 Sep 2024 00:46:18 -0700 Subject: [PATCH] llm.c tok/s --- examples/llm.c/train_gpt2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/llm.c/train_gpt2.py b/examples/llm.c/train_gpt2.py index f378f9ca..2fd5040d 100755 --- a/examples/llm.c/train_gpt2.py +++ b/examples/llm.c/train_gpt2.py @@ -177,7 +177,7 @@ if __name__ == "__main__": loss = step(x.contiguous(), y.contiguous()) Device[Device.DEFAULT].synchronize() t1 = time.time() - print(f"iteration {i}, loss: {loss.item()}, time: {(t1-t0)*1000:.3f}ms") + print(f"iteration {i}, loss: {loss.item():.6f}, time: {(t1-t0)*1000:.3f}ms, {int(B*T/(t1-t0))} tok/s") if not args.skip_test: start = "<|endoftext|>"