Blogs / How a Model Larger Than Free RAM Can Run on an Old Device

How a Model Larger Than Free RAM Can Run on an Old Device

Which devices one project names, where its numbers come from, and the idea that lets a large model fit in little memory.

  • Learning
  • 1 min read

For: Learners curious about running models locally.

Devices with idle resources

TV boxes, old tablets, single-board computers and routers all have a CPU, some RAM and flash storage that sit idle most of the day. smolmaxxing finds the biggest model each of them can really run, then pushes it further with custom kernels, careful memory use and weights streamed from flash.[1]

What was measured

Every number in this repo was measured on the device itself.[1]

The TV box and the iPad run 8B and 16B mixture-of-experts models on about 1 GB of RAM, and the phone runs a 35B one with about 3 GB free.[1]

How a large model fits

They all keep only part of each model in memory and read the rest from flash as it's needed.[1]

This is how 8B and 16B models run on 1 GB, and a 35B model on a phone.[1]

The modelPart kept in memoryThe rest in flashread as it is needed
Where does each part of a model live while it runs?

Sources

  1. Running LLMs on small and old devices (github.com · checked )

More articles