Repository navigation
Closed as not planned
Labels
enhancementNew feature or request
Description
Problem
The serving example (examples/asr/serving/) has no protection against OOM when processing long audio files. Currently:
- Upload limit is file size only (100MB), not audio duration
- Batch size is fixed at 32 regardless of audio length
model.transcribe()receives files directly with no duration check- Parakeet TDT v3 supports up to 3 hours of audio per file (local attention mode)
A batch of 32 × 30-minute files will OOM on L4 (24GB VRAM). Even a few 1-hour files at batch=32 is risky. As audio duration increases, encoder memory scales linearly — fixed batch sizing doesn't account for this.
Proposed Solution
Add a duration-aware batch scheduler to the GPU worker / batch engine:
1. Pre-flight duration check
- Read audio duration (via
soundfileortorchaudio.info) before queuing - Reject files exceeding a configurable
max_audio_duration(default: 3 hours for v3, 24 min for v2)
2. Adaptive batch sizing based on VRAM budget
- Estimate VRAM per file:
base_vram + per_second_vram × duration - Calibrate
per_second_vramempirically on first few requests (or use conservative default) - Compute max batch size that fits within a VRAM budget (e.g., 80% of free VRAM)
- Example: 8s files → batch=32, 60s files → batch=8, 30min files → batch=1
3. Auto-chunking for very long audio (optional)
- For files exceeding a threshold (e.g., 10-15 minutes), split into overlapping segments
- Process segments as separate batch items
- Stitch results using LCS merge on overlap regions
- TDT duration predictions provide natural alignment info for stitching
4. Configuration
Context
- Parakeet TDT 0.6B v3 supports 3-hour audio via local attention — users will send long files
- L4 has 24GB VRAM, model uses ~4-5GB, leaving ~19GB for inference
- Production workloads (Omi) see p50=34s, p95=59s audio — already approaching limits at batch=32
- This is a prerequisite for reliable production deployment with mixed audio lengths
Affected Files
examples/asr/serving/gpu_worker.py— batch transcribe method, VRAM estimationexamples/asr/serving/batch_engine.py— batch formation logicexamples/asr/serving/server.py— duration validation on uploadexamples/asr/serving/conf/serving-batch.yaml— new config fields
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
beastoin commentedon Jun 28, 2026
Closing as superseded by #9 (VRAM-aware batch sizing — PR #11) and #10 (dual-model architecture — PR #12). Together they provide duration-aware batch scheduling with VRAM budget caps and compiled-model throughput for the majority of traffic.