Repository navigation
Conversation
Full attention + torch.compile (proven stable config) with duration guard to reject files near the OOM boundary. Files >10 min would risk OOM at batch_size>1, so reject them pre-inference with HTTP 413. This replaces the auto-attention approach which required disabling torch.compile and caused OOMs from increased VRAM usage. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Collaborator
Author
Contributor
|
Hey @beastoin 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! 💜 |
5 of 7 tasks
beastoin
added a commit
that referenced
this pull request
Jun 29, 2026
…k tests (#8486) ## Summary Re-land of attention mode system from reverted PR #8428, with auto attention enabled and 1-hour duration guard. OOM reproduction confirmed the VRAM leak is NOT in parakeet /v2/transcribe code — the prod OOM was caused by something in the full pipeline (WebSocket /v3/stream, diarizer, concurrent sessions). - **Auto attention mode** — dynamically switches between full and local attention based on audio duration (threshold 300s). torch.compile is skipped in auto mode - **Duration guard** — rejects files >3600s (1 hour) before they reach the GPU - **BF16 dtype tracking** — fixes dtype mismatch after attention mode switch - **Soundfile detection** — handles FLAC, OGG, and other non-WAV formats in the pre-batch duration check - **Fail-closed on unprobeable uploads** — returns 413 instead of sending unknown-duration files to GPU - **Metrics poisoning fix** — inf values from unprobeable files no longer corrupt the AUDIO_DURATION histogram - **Sustained VRAM leak test** — new test script + container test class that detects monotonic VRAM accumulation via linear regression slope analysis - **Chaos OOM test** — mixed /v2/transcribe + /v3/stream load test with varying audio durations ### What changed from PR #8428 | Feature | PR #8428 | This PR | |---------|----------|---------| | Auto attention switching | Included (caused OOMs) | Enabled — OOM root cause confirmed outside parakeet | | Duration guard | MAX_FILE_DURATION=0 (disabled) | MAX_FILE_DURATION=3600 (1 hour) | | BF16 recast fix | Included | Included (unchanged) | | Soundfile detection | Included | Included (unchanged) | | Metrics poisoning fix | Included | Included (unchanged) | | torch.compile | Disabled by auto mode | Disabled by auto mode (same) | | VRAM leak detection | None | New sustained leak test + chaos test scripts | ### Production config ```yaml PARAKEET_ATTENTION_MODE: "auto" # dynamic full/local switching PARAKEET_MAX_FILE_DURATION: "3600" # reject >1hr files PARAKEET_AUTO_ATTN_THRESHOLD: "300" # switch to local at 5min PARAKEET_LOCAL_ATTN_CONTEXT: "128,128" # local attention window PARAKEET_TORCH_COMPILE: "true" # configured but skipped by auto mode ``` ### Test evidence - **[Chaos OOM test results](#8486 (comment) — 632 requests (mixed batch + WebSocket), 100% success, zero OOMs, VRAM slope +2.2 MiB/min - **[Reproduction guide with scripts](#8486 (comment) — step-by-step setup, audio generation, and all test commands - **OOM reproduction on exact prod image (a5a4262)** — 20-min sustained load, 1200 requests, slope +5.7 MiB/min, zero OOMs — confirmed leak is NOT in parakeet code ### Scripts in this PR | Script | Purpose | |--------|---------| | `backend/scripts/parakeet_chaos_oom_test.py` | Mixed REST+WebSocket chaos test with VRAM monitoring | | `backend/scripts/parakeet_vram_leak_test.py` | Sustained VRAM leak detection via linear regression | | `backend/scripts/reproduce_parakeet_oom.py` | OOM reproduction with escalating durations | | `backend/tests/container/test_parakeet_vram_stress.py` | pytest container tests (burst + sustained) | ## Test plan - [x] 89 gpu_worker unit tests pass (including attention switching, BF16, duration guard) - [x] 30 endpoint unit tests pass (including duration guard 413 tests) - [x] Sustained VRAM leak test passes on exact prod image (a5a4262) - [x] Chaos OOM test passes — 632 mixed requests, zero OOMs, zero errors - [x] Attention switching exercised ~80 times (long files >300s interleaved with short) - [ ] Deploy with `gcp_parakeet.yml` and verify pod starts cleanly - [ ] Monitor VRAM + OOM rate for 1 hour post-deploy Replaces reverted #8428 and closed #8484. _by AI for @beastoin_
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PARAKEET_MAX_FILE_DURATION=600in prod Helm valuesATTENTION_MODE=full+torch.compile=true(proven stable config from PR Fix parakeet OOM on long audio: auto attention switching + duration guard #8428)Context
PR #8428 deployed the auto-attention system, but Phase 2 (enabling
ATTENTION_MODE=auto) was rolled back after 14 OOMs and 22% error rate in 27 minutes. Root cause: auto mode disablestorch.compile, which increases VRAM ~3x under load.Recommended approach (from @zen): keep full attention + torch.compile + duration guard. Omi audio is short (p50=34s, p95=59s) — no files need >10 min full attention. The duration guard rejects anything near the OOM boundary before it reaches the GPU.
What changes
PARAKEET_MAX_FILE_DURATION0(disabled)600(reject >10 min)PARAKEET_ATTENTION_MODEfullfull(unchanged)Deployment
Single-step deploy — no behavior change except 413 rejection for >10 min files:
Risk
Low — only adds a pre-inference guard. Files under 10 min (>99% of Omi traffic) are unaffected.
by AI for @beastoin