BatchGen is a high-throughput batch inference engine designed to minimize batch completion time (BCT) for large-scale batch workloads and MoE-based LLMs.
BatchGen introduces the sequence coroutine compute model, which treats each sequence's computation as an event-driven coroutine that can be paused, resumed, and reorganized. A static planner optimizes batch configurations through lightweight profiling, while a dynamic sequence scheduler yields, combines, and migrates sequence coroutines at runtime—enabling larger expert-level batches for sparse MoE models, mitigating long-tail stragglers, and maintaining high device utilization across GPU clusters.
Host Memory: Must be larger than the model size. Additional memory is used for the host KV cache, which stores KV states for sequences waiting to be processed. Larger host KV cache sizes generally result in better throughput.
For DeepSeek-R1-671B (~700GB model weights), we recommend at least 1TB host memory: ~700GB for model weights + 300GB for host KV cache.
git clone https://github.com/batchgen-project/batchgen.git
cd batchgen
./scripts/install_deps.sh
This script automatically installs:
For manual installation, see the Manual Installation Guide.
For complete deployment instructions including model download, checkpoint conversion, server setup, and submitting jobs, see the Deployment Guide.
We learned from the following projects when building BatchGen:
C++
74.9%
Python
22.7%
Cuda
2.1%
BatchGen is a high-throughput batch inference engine designed to minimize batch completion time (BCT) for large-scale batch workloads and MoE-based LLMs.
BatchGen introduces the sequence coroutine compute model, which treats each sequence's computation as an event-driven coroutine that can be paused, resumed, and reorganized. A static planner optimizes batch configurations through lightweight profiling, while a dynamic sequence scheduler yields, combines, and migrates sequence coroutines at runtime—enabling larger expert-level batches for sparse MoE models, mitigating long-tail stragglers, and maintaining high device utilization across GPU clusters.
Host Memory: Must be larger than the model size. Additional memory is used for the host KV cache, which stores KV states for sequences waiting to be processed. Larger host KV cache sizes generally result in better throughput.
For DeepSeek-R1-671B (~700GB model weights), we recommend at least 1TB host memory: ~700GB for model weights + 300GB for host KV cache.
git clone https://github.com/batchgen-project/batchgen.git
cd batchgen
./scripts/install_deps.sh
This script automatically installs:
For manual installation, see the Manual Installation Guide.
For complete deployment instructions including model download, checkpoint conversion, server setup, and submitting jobs, see the Deployment Guide.
We learned from the following projects when building BatchGen:
C++
74.9%
Python
22.7%
Cuda
2.1%