[AUTOMATED] Model Memory Requirements
Model Memory Requirements
You will need about {'dtype': 'float16/bfloat16', 'Largest Layer or Residual Group': '1.51 GB', 'Total Size': '148.56 GB', 'Training using Adam (Peak vRAM)': {'model': 319032508584, 'optimizer': 638065017168, 'gradients': 478548762876, 'step': 638065017168}} VRAM to load this model for inference, and {'dtype': 'int4', 'Largest Layer or Residual Group': '386.26 MB', 'Total Size': '37.14 GB', 'Training using Adam (Peak vRAM)': {'model': -1, 'optimizer': -1, 'gradients': -1, 'step': -1}} VRAM to train it using Adam.
These calculations were measured from the Model Memory Utility Space on the Hub.
The minimum recommended vRAM needed for this model assumes using Accelerate or device_map="auto"
and is denoted by the size of the "largest layer".
When performing inference, expect to add up to an additional 20% to this, as found by EleutherAI. More tests will be performed in the future to get a more accurate benchmark for each model.
When training with Adam
, you can expect roughly 4x the reported results to be used. (1x for the model, 1x for the gradients, and 2x for the optimizer).
Results:
dtype | Largest Layer or Residual Group | Total Size | Training using Adam (Peak vRAM) |
---|---|---|---|
float32 | 3.02 GB | 297.12 GB | {'model': 319032508584, 'optimizer': 638065017168, 'gradients': 319032508584, 'step': 1276130034336} |
float16/bfloat16 | 1.51 GB | 148.56 GB | {'model': 319032508584, 'optimizer': 638065017168, 'gradients': 478548762876, 'step': 638065017168} |
int8 | 772.52 MB | 74.28 GB | {'model': -1, 'optimizer': -1, 'gradients': -1, 'step': -1} |
int4 | 386.26 MB | 37.14 GB | {'model': -1, 'optimizer': -1, 'gradients': -1, 'step': -1} |