Skip to content

Adopt NeMo PR #8 updates into omi parakeet server: attention modes, duration guard, HTTP 413 #8426

Closed

Description

@beastoin

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 behavior
  • local — O(T×W) VRAM scaling via rel_pos_local_attn with configurable sliding window, handles up to 1h on L4
  • auto — 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=auto switches to local attention for long audio
  • Files exceeding PARAKEET_MAX_FILE_DURATION are 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions