Repository navigation
Conversation
…gface#1809 Preserve original prompt rows during normalization, align EOS and token-limit outputs through their predicting queries, and trim seek segments without retaining a discarded next query. Compare selected beam histories against the independent PR huggingface#1809 algorithm and update its real ASR goldens. Remove standalone benchmark scripts from the published patch while preserving local copies.
justsml
marked this pull request as ready for review
October 25, 2026 17:36
This was referenced Oct 21, 2026
This branch has not been deployed
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.
Adds beam-aware attention ancestry and Whisper token timestamps. Depends on #1539; this draft targets
mainuntil the beam-search foundation merges.Each returned hypothesis selects the attention rows that predicted its tokens, including the final prompt query and the row that predicts EOS. Short-form generation supports batches and multiple returned sequences. Public attentions retain raw per-step beam rows, with
beam_indicesandsequence_lengthsdescribing the selected hypotheses. Internal attention and encoder/cache allocations are released on success and failure while caller-owned tensors are preserved.Long-form seek requires one input and one returned sequence. Retaining attention history increases memory use with model size, beam count, and generated length.
This follows #1809's token-to-attention mapping and normalization order, with an independent reference implementation and its real-audio expected timestamps used for regression checks. Required seek bounds and resource cleanup overlap #1742 and #1755; those shared sections need reconciliation when the prerequisite fixes merge, rather than treating them as separate fixes supplied by this PR.
Validation:
The revised alignment is CPU-validated. Earlier NVIDIA/Apple GPU runs used the previous alignment convention and are not claimed as numerical validation of this revision. AMD testing and fresh GPU alignment checks remain outstanding, so this PR remains a draft.
Changes specific to this follow-up.
Related PRs:
Related issues:
num_return_sequencesnot working #1007 — multiple returned sequences are supplied by feat: add beam search, diverse beam search, and beam sampling to generate() #1539; this follow-up selects timestamp attention ancestry for each returned hypothesis.return_timestampsmodes) #1739 — related Whisper encoder/cache/attention lifetime problem, with cleanup overlapping Fix Whisper WebGPU memory leak during generation #1755. The reported long-audio GPU-memory reproduction remains a separate validation target.return_timestampsmodes) #1739, without an established common root cause.