Running Models YourselfLesson 18 of 82

Module 2 · The memory arithmetic

When it does not fit: the ordered remedies

In this lesson

  • 9 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 9 of 9 in this chapter

This chapter’s goalCompute, for any model and any context length, whether it fits on a stated machine and roughly how fast it will run: naming which of weights, KV cache, bandwidth or interconnect is the binding constraint, and choosing the remedy that costs the least quality when it does not fit.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

Fix the right term

Out of memory is not one problem. Work out which term is too large before changing anything, because the remedies for weights and for cache are different and applying the wrong one costs quality for nothing.

The sum, once more: weights + KV cache + overhead. Compute all three. If the cache is a quarter of the total, halving it saves an eighth; if it is two thirds, halving it saves a third. That arithmetic decides the order of everything below.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Open Model Ecosystem exam.

Stuck on something?Ask Tri, your AI tutor

How to cite: Addaly (2026) ‘When it does not fit: the ordered remedies’, in Running Models Yourself. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/running-models-yourself/when-it-does-not-fit (Accessed: 29 November 2026).