Specific LLM Memory Footprints: 4-bit vs. 8-bit in GB
For a Llama 2 13B model, 4-bit quantization can reduce the total memory required for inference to approximately 6.0 GB, significantly less than the ~24.02 GB needed for float16/bfloat16 (effectively 8-bit precision in terms of memory). Similarly, a Llama 3.1 8B model requires about 8 GB at 8-bit and roughly 4 GB at 4-bit.
The top 3
- Llama 2 70B: From Unattainable to Playable: Full-precision Llama 2 70B requires approximately 140GB of VRAM, making it impossible for most consumer GPUs. However, 4-bit quantization drastically reduces this to around 35-48GB, enabling it to run on setups with multiple high-end consumer GPUs like dual RTX 4090s or a single A100 GPU.
- Mistral 7B: 4-bit Unlocks Consumer GPUs: The highly efficient Mistral 7B model, when quantized to 4-bit precision (Q4/NF4), typically requires only about 4GB of VRAM. This low memory footprint makes it readily runnable on a wide range of consumer-grade GPUs, including those with 8GB of VRAM like the NVIDIA RTX 3050 or RTX 4060.
- Quantization's Universal VRAM Rule: Quantization significantly reduces LLM memory footprints: 8-bit precision typically halves VRAM usage compared to FP16, while 4-bit can cut it by up to 75%. A practical rule of thumb for 4-bit (Q4) models is approximately 0.6 GB of VRAM per billion parameters, allowing for quick estimation of hardware requirements.
Open the full topic