LlamaIndex Achieves 10x Inference Speedup for OCRia-1 with Custom Optimization Stack
·2026.11.04 00:12
Key point
The team combined mixed-precision quantization, DFlash2 speculative decoding, and custom CUDA kernels to reduce latency and improve throughput on a single GPU.
Details
- LlamaIndex optimized the inference stack for its OCRia-1 document parsing model, achieving a nearly 10x improvement in token generation speed from ~285 to ~2,800 tokens/sec on a single B200 GPU.
- The primary bottleneck was memory-bound decoding; the team addressed this by reducing data movement, increasing tokens per forward pass, and eliminating CPU/GPU overhead.
- Mixed-precision quantization using BF16, FP8, and NVFP4 was applied to sensitive layers, with the vision encoder kept unquantized to preserve visual accuracy.
- Speculative decoding using DFlash2 increased acceptance rates to over 12 tokens, allowing the model to generate multiple tokens per target forward pass.
- Custom CUDA kernels for ReplaySSM verification reduced per-layer latency from 72–80 µs to 23–24 µs, a 3.3x speedup over the original Triton implementation.
- CPU-side metadata preparation was optimized by caching shared calculations and reducing GPU launches from ~290 per step to one, eliminating redundant synchronization overhead.
- General optimizations will be contributed back to vLLM, while OCRia-1 is currently available on LlamaParse for all tiers.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.