Paper summary
Count memory according to what is being trained
A multimodal model’s memory needs depend on module size and which modules are updated.
Vision-language models combine modules with different roles and training behavior. Frozen layers do not need the same gradient and optimizer storage as trainable layers. A memory predictor must therefore distinguish the model’s components and the current training configuration.
Decompose modules into memory factors
The framework parses vision, projection and language modules into layers. For each layer it estimates parameter, gradient, optimizer-state and activation memory, accounting for whether that layer is being trained.
Per-factor estimates are aggregated into a peak GPU-memory prediction for the supplied hyperparameters. The estimate accounts for the storage required by frozen and updated modules.
View full-size figureEvaluate two LLaVA training configurations
Experiments use LLaVA-1.5 7B and DeepSpeed ZeRO-2 on one node with eight H100 80 GB GPUs connected by NVLink. At data-parallel degrees of 1, 2, 4 and 8, average prediction error is 13% MAPE for sequence length 1,024 and micro-batch size 16. With sequence length 2,048 and micro-batch size 8, average MAPE is 8.7%.
| Sequence / micro-batch | MAPE |
|---|---|
| 1,024 / 16 | 13% |
| 2,048 / 8 | 8.7% |
Memory factors
The estimator adds parameter, gradient, optimizer-state and activation storage across the vision, projection and language modules. Whether a layer is frozen determines which training state contributes to the estimate.