💾 A Transformers prototype loads parts of an AI model from SSD on demand
In brief
- 🔀 A public prototype reads only the model components it needs from the SSD.
- 📉 Across four test prompts on an Apple M5, peak device memory fell from 15 to 4.1 GiB. Output slowed from 38.1 to 25.7 tokens per second.
- 🗜️ The lower-memory setup also used lower-precision model weights.
🍎 A prototype for the Transformers AI library keeps part of a model in device memory and reads the rest from an SSD as needed. A configuration with compressed model weights used 4.1 GiB instead of 15 GiB of peak device memory in an Apple M5 test. It generated text more slowly. The experiment shows how a local model can trade some speed for a lower memory requirement.
🗃️ OLMoE is made up of many smaller networks called experts. It picks a small subset to process each unit of text. The published Transformers patch keeps recently needed experts in a cache and reads missing ones from the SSD. It can also guess which experts the next layer will need and start reading them early.
🔢 The published table covers four prompts with 128 generated tokens each on an Apple M5 with 32 GB of unified memory. With a 2 GiB cache and expert weights reduced to four bits, the prototype generated a median of 25.7 tokens per second. The standard model with 16-bit weights generated 38.1. The 4.1-versus-15 GiB figures measure peak device memory used for model computation. Both weight compression and loading on demand contribute to that difference.
🧪 The report also includes a setup that loads all the four-bit experts upfront. It ran faster and needed 6.1 GiB of device memory. In a short quality check, the four-bit model’s most likely next token matched the 16-bit model’s about 91 percent of the time. The reports and patch were made publicly available on November 13.