Repository navigation
Closed
Description
Summary
The omi parakeet server (backend/parakeet/) was forked from the beastoin/NeMo serving stack. beastoin/NeMo#8 has new updates that should be adopted into the omi parakeet server.
Source PR: beastoin/NeMo#8
Source issue: beastoin/NeMo#7
Changes to adopt (high priority)
1. Attention mode system (gpu_worker.py)
Add configurable attention modes for long audio support (up to 1h on L4):
full— default, O(T²) VRAM, current behaviorlocal— O(T×W) VRAM scaling viarel_pos_local_attnwith configurable sliding window, handles up to 1h on L4auto— per-request switching based on audio duration threshold (disables torch.compile since compiled graphs freeze attention pattern)
Env vars: PARAKEET_ATTENTION_MODE, PARAKEET_AUTO_ATTN_THRESHOLD (seconds), PARAKEET_LOCAL_ATTN_CONTEXT
2. Max file duration guard (gpu_worker.py)
Reject files exceeding PARAKEET_MAX_FILE_DURATION seconds before GPU inference, preventing OOM crashes on unexpectedly long audio.
3. HTTP 413 for over-limit files (main.py)
Return proper HTTP 413 status when files exceed duration or size limits, instead of 500 errors.
4. cuda_graphs: false formalization
Already disabled in omi via env var, but should be documented as a hard requirement (crashes at c=32+ on L4/T4).
What stays the same
- Speaker embedding (WorkType.EMBEDDING, CUDA stream isolation from PR Fix CUDA stream conflict in parakeet batch diarization #8117)
- Prometheus metrics and observability
- Omi streaming path (stream_handler.py with VAD + diarization)
- NIM mode, BF16 support, sync submit
- Existing env var configuration pattern
Not in scope
- Pool mode (multiple model instances) — follow-up
- Prefetch mode (I/O decoupling) — follow-up
- YAML config migration — omi uses env vars
- NeMo streaming engine — omi has its own integrated streaming
Acceptance criteria
- Attention mode switching works:
PARAKEET_ATTENTION_MODE=autoswitches to local attention for long audio - Files exceeding
PARAKEET_MAX_FILE_DURATIONare rejected with HTTP 413 before GPU inference - Existing functionality preserved: embedding, metrics, streaming, diarization
- Tests cover attention mode switching and duration guard
- No regression on current throughput (RTFx ≥ 50x at cc=16)
References
- Current parakeet CUDA isolation fix: Fix CUDA stream conflict in parakeet batch diarization #8117 / Parakeet: batch diarization uses external HTTP embeddings instead of built-in model #8081
- NeMo upstream PR: fix(serving): EOU detection + configurable attention mode for long audio beastoin/NeMo#8
- NeMo upstream issue: Rebase serving layer on upstream nemo.collections.asr.inference pipeline framework beastoin/NeMo#7
Metadata
Metadata
Assignees
Labels
No labels
Activity
Add attention mode system and duration guard to GPU worker
Add HTTP 413 pre-batch duration guard in transcribe endpoints
Add tests for attention modes, duration guard, and auto switching
Add HTTP 413 endpoint tests for duration guard
Fix metrics double-counting: use status=rejected for 413 responses
Add boundary and integration tests for attention/duration guard
Add v2 under-limit and boundary endpoint tests