gpu utilization
**GPU utilization** measures the percentage of a GPU's computational resources that are **actively being used** at any given moment. In the context of AI and LLM workloads, achieving high GPU utilization is critical because GPUs are extremely expensive resources — every idle cycle is wasted money.
**Understanding GPU Utilization Metrics**
- **SM Occupancy**: The percentage of **Streaming Multiprocessor** warps that are active. Higher occupancy generally means better utilization of compute cores.
- **Compute Utilization**: How much of the GPU's raw **FLOPS** capability is being consumed — measured via tools like `nvidia-smi` or **NVIDIA Nsight**.
- **Memory Bandwidth Utilization**: The fraction of available **HBM bandwidth** being used. LLM inference (especially decode) is often **memory-bandwidth bound**, meaning compute utilization may be low even when the GPU is effectively "busy."
- **GPU Memory Usage**: The amount of **VRAM** occupied by model weights, KV cache, activations, and framework overhead.
**Typical Utilization Patterns**
- **Training**: Usually achieves **high utilization** (70–90%+) due to large batch sizes and continuous computation.
- **Inference (Prefill)**: Moderate to high utilization — processing many input tokens in parallel is compute-intensive.
- **Inference (Decode)**: Often **low compute utilization** (10–30%) because generating one token at a time doesn't provide enough arithmetic to saturate the GPU. This is the main bottleneck.
**Improving Utilization**
- **Continuous Batching**: Dynamically group multiple inference requests together to increase the effective batch size.
- **Quantization**: Reduce precision to process more tokens per memory read.
- **Speculative Decoding**: Generate multiple candidate tokens per step to increase arithmetic intensity.
- **Right-Sizing**: Match the **GPU type and count** to the model size and expected load — over-provisioning wastes resources, under-provisioning causes queuing.
Monitoring GPU utilization in production is essential for **cost optimization** and **capacity planning** in AI infrastructure.