add the estimation of model flops utilization (MFU), a very commonly looked at metric that estimates the token throughput in units of A100 bfloat16 peak flops (312 TFLOPS). this gives us a sense of the hardware utilization we're achieving

This commit is contained in:
Andrej Karpathy committed 2023-02-05 00:48:58 +00:00
1 parent 580902617c
commit ab0718a7dd
3 files changed
+29 -2

No files matched your search

+3 -1
View File
@@ -111,5 +111,7 @@ else:
print(f"{k}/{num_steps} loss: {lossf:.4f}")
torch.cuda.synchronize()
t1 = time.time()
dt = t1-t0
mfu = model.estimate_mfu(batch_size * 1 * num_steps, dt)
if stage == 1:
print(f"time per iteration: {(t1-t0)/num_steps*1000:.4f}ms")
print(f"time per iteration: {dt/num_steps*1000:.4f}ms, MFU: {mfu*100:.2f}%")