Offloading moves model weights, activations, or attention KV cache from scarce GPU memory to CPU memory or disk. It makes larger-model inference feasible on cheaper hardware, but adds I/O, latency, and lower throughput. section 9.1
Operational tradeoffs include:
- Hardware cost: uses abundant, cheaper CPU RAM and disk instead of requiring many high-memory GPUs. section 9.1
- Performance: accepts slower CPUs, disks, and transfer overhead in exchange for fitting the model. section 9.1
- Optimization: FlexGen selects tensor placement and movement with linear programming, while compressing weights and cache to 4 bits. section 9.1
FlexGen on a single GPU
A 175-billion-parameter model would require roughly 420 GB in FP16, but FlexGen can distribute its state across a 16-GB GPU, CPU RAM, and disk. A policy can configure 50-percent placement across tiers and 4-bit compression for weights and cache. section 9.1
Figure 9.2 Loading a 175 billion–parameter language model with FlexGen across GPU, CPU, and disk
Shows how FlexGen loads a large language model across GPU, CPU, and disk. section 9.1
