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.
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]
Sources
- Running LLMs on small and old devices (github.com · checked )
More articles
- LearningHow Large LLMs Are and What They Need to Run FastWhat a Hugging Face post says about how large LLMs often are, an example with more than 100 billion parameters and what they need to run fast.
- LearningHow Speculative Decoding Splits the Work Into Two StagesWhat a Hugging Face post says speculative decoding accelerates and what the draft model and the target model each do.
- LearningWhy Decoding Can Be Batched but Reading the Prompt CannotWhat the TNG post says a later output token needs, why decode steps can be batched together and why batching does not work for prefill.