End User Deployment Guide
Project: Issue #995 - ModernBERT-base-32k Integration
Based on: Performance & Functionality Validation Results (1K-8K tokens)
Overview
This guide provides deployment recommendations for ModernBERT-base-32k based on empirical testing results. All recommendations are based on validated test results for context lengths from 512 tokens to 8K tokens.
For long context (16K-32K) and big batch testing, see separate test plans:
1. Performance Recommendations
1.1 Latency Expectations
| Context Length | GPU Latency (C=1) | GPU Latency (C=10) | CPU Latency |
|---|---|---|---|
| 512 tokens | 163ms | N/A | 7367ms |
| 1K tokens | 785ms | 996ms | 806ms |
| 4K tokens | 896ms | 9066ms (88% success) | N/A |
| 8K tokens | 3294ms | N/A (fails) | N/A |
Recommendations:
- Use GPU for all production deployments (45x faster for 512 tokens)
- Flash Attention 2 provides 1.75x-11.9x speedup (highly recommended)
- CPU only suitable for 512 tokens (similar performance to GPU for 1K+)
1.2 Memory Requirements
| Context Length | GPU Memory per Request | Total Memory (C=10) |
|---|---|---|
| 512 tokens | ~5MB | ~50MB |
| 1K tokens | ~11MB | ~110MB |
| 4K tokens | ~estimated | ~estimated |
| 8K tokens | ~estimated | ~estimated |
Recommendations:
- Memory usage is very efficient (~5-11MB per request)
- For 8K tokens with C=1, ensure at least 2GB free GPU memory
- For 4K tokens with C=10, ensure at least 1GB free GPU memory
2. Concurrency Limits
2.1 Recommended Concurrency by Context Length
| Context Length | Max Concurrency | Notes |
|---|---|---|
| 1024 tokens | C=10 | Tested and works reliably |
| 4096 tokens | C=10 | 88% success rate (12 OOM errors) |
| 8192 tokens | C=1 | Only C=1 works reliably |
| 16384+ tokens | C=1 (with chunking) | Requires A100 or chunking |
2.2 Concurrency Best Practices
- Start with C=1 for new deployments
- Gradually increase to C=10 for 1K-4K tokens
- Monitor memory - if OOM errors occur, reduce concurrency
- Use chunking for sequences > 8K tokens
- Avoid C=50+ for 8K+ tokens (memory fragmentation issues)