Skip to content

Add Whisper runner under examples/audio (#23904) - #23904

Open
JakeStevens wants to merge 2 commits into
pytorch:mainfrom
JakeStevens:export-D125296073
Open

JakeStevens wants to merge 2 commits into
pytorch:mainfrom
JakeStevens:export-D125296073

Conversation

@JakeStevens

@JakeStevens JakeStevens commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Add run_whisper to encode a raw fp32 log-mel window, project cross K/V once, prefill the forced prefix into the static KV cache, and greedily decode while advancing cache_position. Cross K/V input staging persists across executions. The default token budget is 32, matching the exporter, and is capped by remaining decoder context. A full-capacity prefix stays unchanged, and decoding stops without computing an unused token at the budget limit. --expected compares the complete ID sequence with eager vectors and returns exit 3 on mismatch.

EXECUTORCH_BUILD_NATIVE_AUDIO_RUNNER builds and installs the runner with Native Vulkan. Audio and vision runners share gflags resolution and runner_utils; either option enables the examples directory. The README documents matching export/run token budgets, and the Vulkan TODO records future zero-copy chaining and attention-weight storage work.

Token files and EOS lists reject partially numeric or invalid IDs with exit 1; comma-only EOS lists are rejected. Reference IDs are validated before executing the model. Integer parsing accepts surrounding whitespace and CRLF input.

Authored with Claude Code; updated with Codex.

Differential Revision: D125296073

@pytorch-bot

pytorch-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23904

Note: Links to docs will display an error until the docs builds have been completed.

❌ 4 New Failures, 1 Unrelated Failure, 2 Unclassified Failures

As of commit 789b93c with merge base a057bb4 (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 15, 2026
@meta-codesync

meta-codesync Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

@JakeStevens has exported this pull request. If you are a Meta employee, you can view the originating Diff in D125296073.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Summary:

Lower matrix row gathers from `aten.index.Tensor` through the existing embedding path and lower positive bounded `aten.repeat` shapes with `ggml_repeat`. Preserve snapshots when repeat aliases its input so later cache writes cannot change previously computed values.

Allow row-index validation to follow repeats and validate integer `aten.arange.start_step` bounds when building the graph. This supports Whisper's encoder position embeddings and decoder cache-position gathers while retaining input bounds checks on cached graph replay.

Review row-index validation and gather lowering first, then repeat lowering and the operator regressions.

Authored with assistance from Codex.

Differential Revision: D125479769
Summary:

Add `run_whisper` to encode a raw fp32 log-mel window, project cross K/V once, prefill the forced prefix into the static KV cache, and greedily decode while advancing `cache_position`. Cross K/V input staging persists across executions. The default token budget is 32, matching the exporter, and is capped by remaining decoder context. A full-capacity prefix stays unchanged, and decoding stops without computing an unused token at the budget limit. `--expected` compares the complete ID sequence with eager vectors and returns exit 3 on mismatch.

`EXECUTORCH_BUILD_NATIVE_AUDIO_RUNNER` builds and installs the runner with Native Vulkan. Audio and vision runners share gflags resolution and `runner_utils`; either option enables the examples directory. The README documents matching export/run token budgets, and the Vulkan TODO records future zero-copy chaining and attention-weight storage work.

Token files and EOS lists reject partially numeric or invalid IDs with exit 1; comma-only EOS lists are rejected. Reference IDs are validated before executing the model. Integer parsing accepts surrounding whitespace and CRLF input.

Authored with Claude Code; updated with Codex.

Differential Revision: D125296073
@meta-codesync meta-codesync Bot changed the title Add Whisper runner under examples/audio Add Whisper runner under examples/audio (#23904) Nov 3, 2026

@digantdesai digantdesai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants