Memory math

You load an 8B model on a 24 GB GPU and it fits with room to spare. Then you set the context to 128K tokens, and the first long conversation runs it out of memory. The weights didn't grow. The KV cache did, and it's easy to calculate before it surprises you.

In this lesson you'll learn to

Create a free account to open this lesson

It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.