From 8ae2f127beb32c309eabf1fe8a39770f149d6a24 Mon Sep 17 00:00:00 2001 From: Pratham Aditya Salhotra <66534075+PrathamAditya@users.noreply.github.com> Date: Sat, 2 May 2026 20:49:05 +0530 Subject: [PATCH] Fix FLOPs calculation description in lecture_02.py I was watching CS336: lecture 2 on youtube and Professor Percy Liang corrected this at last minute of the video. I am following the notes from this lectures repository and it was not updated here. --- lecture_02.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lecture_02.py b/lecture_02.py index 38171e8c..7dbce928 100644 --- a/lecture_02.py +++ b/lecture_02.py @@ -62,7 +62,7 @@ def main(): text("Summary:") text("- Everything is operations on tensors (parameters, gradients, activations, optimizer states, data)") text("- einops: better way to think about tensor operations") - text("- 6 (# data points) (# parameters) FLOPs per training step") + text("- 6 (# batch size) (# sequnce length) (# parameters) FLOPs per training step") text("- Arithmetic intensity / roofline analysis: compute-bound or memory-bound?") text("- Matrix multiplications are compute-bound, elementwise operations are memory-bound") text("- Gradient accumulation, activation checkpointing: reduce memory to use bigger batch sizes")