**llama.cpp Prefill Bottleneck Checklist (Single GPU)**

- [ ] **VRAM Capacity:** Verify model weights + KV cache fit entirely in VRAM. Set `--gpu-layers -1`. If VRAM is exceeded, prefill spills to system RAM, causing severe slowdowns.
- [ ] **KV Cache Precision:** Change from default fp32 to fp16: `--cache-type-k f16 --cache-type-v f16`. Reduces memory bandwidth pressure during prefill.
- [ ] **Flash Attention:** Enable `--flash-attn`. Critical for prefill throughput on modern architectures (Ampere+).
- [ ] **Batch/Parallelism:** Increase `--batch-size` (default 512) and `--parallel` (server flag) to allow parallel prefill processing. Test `--batch-size 1024` or `2048`.
- [ ] **Context Window:** Reduce `--ctx-size`. Large contexts saturate memory bandwidth during prefill. Isolate with `--ctx-size 2048` to confirm.
- [ ] **Driver/Runtime:** Confirm CUDA/ROCm version matches `llama.cpp` build. Update GPU drivers. If self-compiled, verify `CMAKE_CUDA_ARCHITECTURES` matches your GPU.
- [ ] **Quantization:** Use Q4_K_M or Q5_K_M. Avoid Q2/Q3 (higher compute overhead). Ensure model file isn’t corrupted or improperly converted.
- [ ] **Utilization Verification:** Run `nvidia-smi`/`rocm-smi` during prefill. If GPU util < 80%, check offloading, batch size, or driver fallbacks.
- [ ] **Server Overhead:** Disable logging (`--log-disable`), ensure `--mmap` is active, and verify streaming isn’t masking latency. Test with `--n-predict 1` to isolate prefill time.

**Note:** Prefill is compute/memory-bandwidth bound; decode is sequential memory-bound. If prefill remains slower after these steps, the model architecture (e.g., MoE, extreme context) or PCIe/RAM bottleneck may be the limiting factor.