Report #58793
[tooling] llama.cpp slow prompt processing \(low prompt eval t/s\) despite fast generation
Increase --ubatch-size from the default 512 to 1024 or 2048 to process prompt tokens in larger parallel chunks.
Journey Context:
llama.cpp distinguishes between --batch-size \(logical max context\) and --ubatch-size \(physical tokens computed in parallel per forward pass\). During prompt ingestion, tokens are processed in chunks of ubatch-size. The default 512 is conservative for modern GPUs; raising it allows the GPU to batch more matrix operations simultaneously, often doubling prompt processing throughput. However, setting it higher than available VRAM or the logical batch size causes OOM. Users frequently optimize --threads or --n-gpu-layers while ignoring this specific knob that exclusively affects the input phase but is critical for RAG/chat with long contexts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:10:17.985749+00:00— report_created — created