ModernBERT-base-32k Performance Benchmark Results
This tutorial provides benchmark results and performance tuning guidance for ModernBERT-base-32k integration. Use these results to provision hardware and adjust workload expectations for your deployment.
Overview
ModernBERT-base-32k extends the context window from 512 tokens (BERT-base) to 32,768 tokens, enabling processing of long documents and conversations. This guide presents empirical benchmark results from comprehensive testing across different context lengths and concurrency levels.
Test Environment:
- GPU: NVIDIA L4 (23GB VRAM)
- Flash Attention 2: Enabled
- Model:
llm-semantic-router/modernbert-base-32k - Test Tool:
candle-binding/examples/benchmark_concurrent.rs
Benchmark Results
Single Request Latency (C=1)
| Context Length | Mean Latency | p50 Latency | p95 Latency | p99 Latency | Status |
|---|---|---|---|---|---|
| 1,024 tokens | 90.98ms | 94.18ms | 94.24ms | 94.24ms | Pass |
| 4,096 tokens | 899.87ms | 955.05ms | 955.93ms | 955.93ms | Pass |
| 8,192 tokens | 3,299.92ms | 3,524.62ms | 3,526.34ms | 3,526.34ms | Pass |
Notes:
- 1K tokens: Stable performance with mean ≈ p50
- 4K and 8K tokens: Stable performance with mean ≈ p50
Concurrent Requests (C=10)
| Context Length | Mean Latency | p50 Latency | p95 Latency | Success Rate | Status |
|---|---|---|---|---|---|
| 1,024 tokens | 1,001.22ms | 970.65ms | 1,379.32ms | 100% | Pass |
| 4,096 tokens | 9,323.45ms | 9,389.28ms | 10,349.11ms | 93% | Partial |
| 8,192 tokens | N/A | N/A | N/A | 0% | Fail |
Notes:
- 1K tokens: Excellent performance with 100% success rate
- 4K tokens: 93% success rate (7 OOM errors out of 100 requests)
- 8K tokens: Failed due to insufficient GPU memory
High Concurrency (C=50, C=100)
All high concurrency tests (C=50+) failed due to hardware limitations. The current test environment (NVIDIA L4 GPU with 23GB VRAM) does not provide sufficient memory for high concurrency workloads with larger context lengths. Testing high concurrency (C=50+) requires a GPU with 40GB+ VRAM (e.g., NVIDIA A100) as documented in the Big Batch Test Plan.
Hardware Provisioning Guide
Minimum Requirements
| Context Length | GPU VRAM | System RAM | Recommended GPU |
|---|---|---|---|
| ≤ 1K tokens | ≥ 5GB | ≥ 16GB | NVIDIA T4, L4 |
| ≤ 4K tokens | ≥ 10GB | ≥ 32GB | NVIDIA L4, A10G |
| ≤ 8K tokens | ≥ 23GB | ≥ 32GB | NVIDIA L4, A10G |
| 16K+ tokens | ≥ 40GB |