perf(whisper): remove long-form decode overhead - #1
Open
unohee wants to merge 1 commit into
Open
Conversation
Owner
Author
|
Final ceiling audit:
KT-641 is complete; correctness-changing timestamp semantics remain isolated in KT-642. |
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
Exact-output benchmark
Fixed MLX seed, 71-minute production recording, word timestamps enabled:
a6b25f7a526e47193c77324b45a4bb8cfe1e717cffe63c1c852a17df2dbd3a26The benchmark used
MLX_METAL_FAST_SYNCH=1; the code-only fallback baseline was 127.0028s and the candidate retained full JSON parity.Rejected candidates
Review
OpenSwarm Codex reviewer, 600,000ms timeout: APPROVE. The reviewer-found
filter_width=1boundary regression was fixed before approval.Tracking
Note
Medium Risk
Touches autoregressive timestamp logit rules and word-alignment numerics on a hot path; changes are tuned for exact JSON parity but regressions would affect segment/word timestamps and fallback decoding behavior.
Overview
Cuts long-form MLX Whisper latency (~13% in the PR benchmark) while keeping bit-identical transcript JSON on a 71-minute word-timestamp run.
ApplyTimestampRulesstops per-batch Python/tolist()work and builds timestamp suppression with vectorized MLX boolean masks (cached vocab indices). Legacy position-based timestamp lower-bound behavior is explicitly preserved for parity; token-value semantics are deferred to KT-642.Word-alignment path:
median_filterdrops SciPy for an MLX reflect-pad +partitionmedian;dtw_cpugets Numbacache=True;find_alignmentbatches GPU sync withmx.evalbefore NumPy conversion.Temperature fallback in
decode_with_fallbackreuses encodedaudio_featuresfrom the firstmodel.decodeinstead of re-running the encoder on each temperature retry.Reviewed by Cursor Bugbot for commit 4d1120c. Bugbot is set up for automated code reviews on this repo. Configure here.