Overview of the TurboMind Inference Engine
mainTurboMind is a high-efficiency LLM inference engine developed based on NVIDIA's FasterTransformer. It is specifically optimized for LLaMa-style models and features:
- Persistent Batching: Also known as continuous batching, it models conversational LLM inference as a continuous batch that lives throughout the service lifecycle. It uses pre-allocated batch slots that are immediately released upon sequence completion to accept new requests.
- KV Cache Manager: A memory-pool-based manager with an LRU (Least Recently Used) eviction policy. It acts as a "cache for KV caches," allowing sequences to hit existing cache slots to skip context decoding. When slots are full, the manager automatically evicts the least recently used sequences, converting them into compact token IDs to be re-decoded later if needed. This process is transparent to the user.
- Optimized LLaMa Implementation: Includes support for fast text decoding in multi-turn dialogues using a CUTLASS-based FMHA implementation, INT8 KV cache to reduce memory overhead, and support for non-contiguous KV caches in batches.