How much of actual VRAM would you need to run a 72B-parameter LLM? Including, say, 32k…
- User
How much of actual VRAM would you need to run a 72B-parameter LLM? Including, say, 32k tokens of context. Break it down for me.
- Assistant
How much of actual VRAM would you need to run a 72B-parameter LLM? Including, say, 32k tokens of context. Break it down for me.
Running a 72-billion-parameter (72B) Large Language Model (LLM) with a 32,000-token context length is a substantial computational task. To determine the Video RAM (VRAM) requirements, we'll break down the memory consumption into several key components:
a. Number of Parameters:
b. Precision:
c. Memory Calculation: [ \text{Memory} = \text{Number of Parameters} \times \text{Bytes per Parameter} ] [ \text{Memory} = 72,000,000,000 \times 2 \text{ bytes} = 144 \text{ GB} ]
Note: Lower precision formats like 8-bit (FP8) can halve this requirement to 72 GB, while higher precision like 32-bit (FP32) would double it to 288 GB. However, FP16 is typically preferred for inference due to its balance between precision and memory usage.
When processing input sequences, the model generates intermediate activations at each layer, which consume additional memory.
a. Factors Affecting Activation Memory:
b. Simplified Estimation: A rough estimation is that activations can require memory comparable to or exceeding the model parameters, especially with long sequences.
Note: The actual activation memory can vary based on the model's architecture and optimizations like activation checkpointing or gradient caching (more relevant for training).
Beyond parameters and activations, other factors contribute to VRAM usage:
Estimated Overheads: ~12 GB
| Component | Memory Usage |
|---|---|
| Model Parameters | 144 GB |
| Activations | 144 GB |
| Overheads | 12 GB |
| Total | ~300 GB |
Model Parallelism:
Quantization:
Memory Optimization Techniques:
Hardware Solutions:
To run a 72B-parameter LLM with a 32k-token context, you would approximately need around 300 GB of VRAM. This estimation assumes using FP16 precision without aggressive optimizations. Achieving this typically requires a multi-GPU setup or specialized high-memory GPUs coupled with advanced parallelization and memory optimization techniques.
Recommendations:
Not yet included in a published release.