Since prompt evaluation (prefill) is slower than generation (decoding), the bottleneck is likely **memory bandwidth** or **compute throughput** during the initial processing of the input tokens.

### 1. GPU Offloading & VRAM
*   **Full Offload:** Ensure the entire model is on the GPU. Check `n_gpu_layers`. If any layers are on the CPU, prefill speed will drop by 10x–50x.
*   **VRAM Overhead:** Ensure you aren't hitting the VRAM limit. If the KV cache is too large, the system may be swapping to system RAM.

### 2. Core llama.cpp Optimizations
*   **Flash Attention:** Ensure `--flash-attn` is enabled. This is the single most effective way to speed up prefill for long prompts.
*   **Batch Size:** Increase `n_batch` (default is often 512). For high-end GPUs, try 1024 or 2048.
*   **U-Batch Size:** Adjust `n_ubatch` (micro-batch). If your GPU has high compute but low memory bandwidth, a smaller `n_ubatch` can sometimes help, but usually, you want this to match `n_batch` for prefill.

### 3. Context & Quantization
*   **Context Window:** Check `n_ctx`. If you are allocating a massive context (e.g., 32k+) but only using 1k, you are wasting VRAM and slowing down the initial memory allocation.
*   **Quantization Type:** Ensure you are using a standard quantization (e.g., `Q4_K_M` or `Q8_0`). Extremely high-bitrate models or non-standard formats can cause compute bottlenecks.

### 4. Hardware & Drivers
*   **Power Limits:** Check if the GPU is thermal throttling or hitting a power cap during the high-intensity prefill phase.
*   **CUDA/ROCm Version:** Ensure your drivers and toolkit match the requirements of the `llama.cpp` build you are running.

### Summary Checklist for Command Line:
1.  [ ] `--flash-attn` (Enabled?)
2.  [ ] `n_gpu_layers` (Is it maxed out?)
3.  [ ] `n_batch` (Try 1024 or 2048)
4.  [ ] `n_ctx` (Is it unnecessarily large?)
5.  [ ] `n_ubatch` (Match `n_batch` if possible)