Overview
Batch inference allows you to process multiple requests simultaneously, improving throughput and efficiency.Basic Batch Inference
Key Considerations
Padding Configuration
Mixed Content Batching
You can batch requests with different content types:Batch with Video Content
Performance Tips
Optimization Recommendations:
- Group similar requests: Batch requests with similar lengths to minimize padding overhead
- Use flash_attention_2: Significantly improves batch processing speed
- Adjust batch size: Balance between throughput and memory usage
- Monitor GPU memory: Larger batches require more VRAM
Enable Flash Attention
Memory Considerations
Batch size impacts memory usage:- Small batches (2-4): Better for mixed content types
- Medium batches (4-8): Good balance for similar requests
- Large batches (8+): Best for uniform, text-only requests
Error Handling
Next Steps
Generation Parameters
Configure sampling parameters for better outputs
Pixel Control
Optimize memory usage with resolution control