7-8B Models: Llama 3.1, Mistral 7B, Gemma 2 Throughput Comparison

In the 7-8B class, Llama 3 8B demonstrated 41% faster code generation (55 completions/min) than Mistral 7B (39 completions/min) on an RTX 3090 with INT4 quantization, while Gemma 2 9B offers respectable general-purpose performance but generally trails in coding benchmarks.

The top 3

  1. Llama 3.1 8B vs. Mistral 7B: GPU Throughput Leader: Llama 3.1 8B often surpasses Mistral 7B in GPU inference speed; for code generation on an RTX 3090 with INT4 quantization, Llama 3 8B generated completions 41% faster than Mistral 7B. Gemma 2 9B typically lags behind due to its larger parameter count and architectural overhead.
  2. Quantization: 4-bit vs. 8-bit Throughput Trade-offs: Quantization significantly boosts LLM inference speed and reduces VRAM requirements; for instance, 8-bit (INT8) quantization can improve throughput by over 2x but may lead to an accuracy drop of up to 8%. 4-bit (INT4) quantization reduces memory usage by approximately 75% for 7B models, making them compatible with lower-end hardware, though often with a slight quality trade-off.
  3. LLM Architectures: Memory Bandwidth Efficiency Kings: Specific architectural choices significantly impact memory efficiency for local LLM inference. Mistral 7B's Sliding Window Attention (SWA) effectively minimizes Key-Value (KV) cache memory usage, keeping VRAM requirements low even with extended context lengths. Gemma 2B utilizes Multi-Query Attention (MQA) to reduce memory bandwidth demands, making it particularly advantageous for efficient inference on memory-constrained devices.

Sources

Open the full topic