Skip to content

Conversation

rohansjoshi
Copy link
Contributor

Summary:
Running Whisper to convert audio -> text consists of two steps:
(1) Audio preprocessor (aka Mel spectrogram feature extractor), and
(2) Whisper model (encoder+decoder)
Currently, in examples/qualcomm/oss_scripts/whisper, we have a flow for exporting Whisper encoder+decoder (2) and running it on device. It can take in Mel spectrogram tensors as input and produce text output

This class implements part (1), the audio processing stage, in PyTorch. It is equivalent to HuggingFace WhisperFeatureExtractor (which computes Mel spectrograms with NumPy). It takes in an audio waveform at 16KHz (as a 1D tensor) and outputs Mel spectrograms that can be fed directly to the Whisper model (2).

The script (see test plan) compares this class agains WhisperFeatureExtractor, they have a very small numerical discrepancy (<1e-5).

Differential Revision: D80215714

Copy link

pytorch-bot bot commented Aug 20, 2025

🔗 Helpful Links

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

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

❌ 3 New Failures, 17 Pending, 1 Unrelated Failure

As of commit d64bdba with merge base 9359481 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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 Aug 20, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80215714

Copy link

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.

rohansjoshi added a commit to rohansjoshi/executorch that referenced this pull request Aug 20, 2025
Summary:

Running Whisper to convert audio -> text consists of two steps: 
(1) Audio preprocessor (aka Mel spectrogram feature extractor), and 
(2) Whisper model (encoder+decoder)
Currently, in examples/qualcomm/oss_scripts/whisper, we have a flow for exporting Whisper encoder+decoder (2) and running it on device. It can take in Mel spectrogram tensors as input and produce text output

**This class implements part (1), the audio processing stage, in PyTorch.** It is equivalent to HuggingFace WhisperFeatureExtractor (which computes Mel spectrograms with NumPy). It takes in an audio waveform at 16KHz (as a 1D tensor) and outputs Mel spectrograms that can be fed directly to the Whisper model (2).

The script (see test plan) compares this class agains WhisperFeatureExtractor, they have a very small numerical discrepancy (<1e-5).

Differential Revision: D80215714
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80215714

rohansjoshi added a commit to rohansjoshi/executorch that referenced this pull request Aug 20, 2025
Summary:
Pull Request resolved: pytorch#13538

Running Whisper to convert audio -> text consists of two steps:
(1) Audio preprocessor (aka Mel spectrogram feature extractor), and
(2) Whisper model (encoder+decoder)
Currently, in examples/qualcomm/oss_scripts/whisper, we have a flow for exporting Whisper encoder+decoder (2) and running it on device. It can take in Mel spectrogram tensors as input and produce text output

**This class implements part (1), the audio processing stage, in PyTorch.** It is equivalent to HuggingFace WhisperFeatureExtractor (which computes Mel spectrograms with NumPy). It takes in an audio waveform at 16KHz (as a 1D tensor) and outputs Mel spectrograms that can be fed directly to the Whisper model (2).

The script (see test plan) compares this class agains WhisperFeatureExtractor, they have a very small numerical discrepancy (<1e-5).

Differential Revision: D80215714
Copy link
Contributor

@cccclai cccclai left a comment

Choose a reason for hiding this comment

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

Please update the output file in the unit test and it's all good

@mergennachin
Copy link
Contributor

cc @msluszniak @chmjkb @mkopcins FYI the audio preprocessing part can be now just exported

rohansjoshi added a commit to rohansjoshi/executorch that referenced this pull request Aug 20, 2025
Summary:

Running Whisper to convert audio -> text consists of two steps: 
(1) Audio preprocessor (aka Mel spectrogram feature extractor), and 
(2) Whisper model (encoder+decoder)
Currently, in examples/qualcomm/oss_scripts/whisper, we have a flow for exporting Whisper encoder+decoder (2) and running it on device. It can take in Mel spectrogram tensors as input and produce text output

**This class implements part (1), the audio processing stage, in PyTorch.** It is equivalent to HuggingFace WhisperFeatureExtractor (which computes Mel spectrograms with NumPy). It takes in an audio waveform at 16KHz (as a 1D tensor) and outputs Mel spectrograms that can be fed directly to the Whisper model (2).

The script (see test plan) compares this class agains WhisperFeatureExtractor, they have a very small numerical discrepancy (<1e-5).

Reviewed By: jackzhxng

Differential Revision: D80215714
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80215714

rohansjoshi added a commit to rohansjoshi/executorch that referenced this pull request Aug 20, 2025
Summary:

Running Whisper to convert audio -> text consists of two steps: 
(1) Audio preprocessor (aka Mel spectrogram feature extractor), and 
(2) Whisper model (encoder+decoder)
Currently, in examples/qualcomm/oss_scripts/whisper, we have a flow for exporting Whisper encoder+decoder (2) and running it on device. It can take in Mel spectrogram tensors as input and produce text output

**This class implements part (1), the audio processing stage, in PyTorch.** It is equivalent to HuggingFace WhisperFeatureExtractor (which computes Mel spectrograms with NumPy). It takes in an audio waveform at 16KHz (as a 1D tensor) and outputs Mel spectrograms that can be fed directly to the Whisper model (2).

The script (see test plan) compares this class agains WhisperFeatureExtractor, they have a very small numerical discrepancy (<1e-5).

Reviewed By: jackzhxng

Differential Revision: D80215714
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80215714

rohansjoshi added a commit to rohansjoshi/executorch that referenced this pull request Aug 20, 2025
Summary:
Pull Request resolved: pytorch#13538

Running Whisper to convert audio -> text consists of two steps:
(1) Audio preprocessor (aka Mel spectrogram feature extractor), and
(2) Whisper model (encoder+decoder)
Currently, in examples/qualcomm/oss_scripts/whisper, we have a flow for exporting Whisper encoder+decoder (2) and running it on device. It can take in Mel spectrogram tensors as input and produce text output

**This class implements part (1), the audio processing stage, in PyTorch.** It is equivalent to HuggingFace WhisperFeatureExtractor (which computes Mel spectrograms with NumPy). It takes in an audio waveform at 16KHz (as a 1D tensor) and outputs Mel spectrograms that can be fed directly to the Whisper model (2).

The script (see test plan) compares this class agains WhisperFeatureExtractor, they have a very small numerical discrepancy (<1e-5).

Reviewed By: jackzhxng

Differential Revision: D80215714
rohansjoshi added a commit to rohansjoshi/executorch that referenced this pull request Aug 20, 2025
Summary:

Running Whisper to convert audio -> text consists of two steps: 
(1) Audio preprocessor (aka Mel spectrogram feature extractor), and 
(2) Whisper model (encoder+decoder)
Currently, in examples/qualcomm/oss_scripts/whisper, we have a flow for exporting Whisper encoder+decoder (2) and running it on device. It can take in Mel spectrogram tensors as input and produce text output

**This class implements part (1), the audio processing stage, in PyTorch.** It is equivalent to HuggingFace WhisperFeatureExtractor (which computes Mel spectrograms with NumPy). It takes in an audio waveform at 16KHz (as a 1D tensor) and outputs Mel spectrograms that can be fed directly to the Whisper model (2).

The script (see test plan) compares this class agains WhisperFeatureExtractor, they have a very small numerical discrepancy (<1e-5).

Reviewed By: jackzhxng

Differential Revision: D80215714
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80215714

rohansjoshi added a commit to rohansjoshi/executorch that referenced this pull request Aug 20, 2025
Summary:
Pull Request resolved: pytorch#13538

Running Whisper to convert audio -> text consists of two steps:
(1) Audio preprocessor (aka Mel spectrogram feature extractor), and
(2) Whisper model (encoder+decoder)
Currently, in examples/qualcomm/oss_scripts/whisper, we have a flow for exporting Whisper encoder+decoder (2) and running it on device. It can take in Mel spectrogram tensors as input and produce text output

**This class implements part (1), the audio processing stage, in PyTorch.** It is equivalent to HuggingFace WhisperFeatureExtractor (which computes Mel spectrograms with NumPy). It takes in an audio waveform at 16KHz (as a 1D tensor) and outputs Mel spectrograms that can be fed directly to the Whisper model (2).

The script (see test plan) compares this class agains WhisperFeatureExtractor, they have a very small numerical discrepancy (<1e-5).

Reviewed By: jackzhxng

Differential Revision: D80215714
rohansjoshi added a commit to rohansjoshi/executorch that referenced this pull request Aug 21, 2025
Summary:

Running Whisper to convert audio -> text consists of two steps:
(1) Audio preprocessor (aka Mel spectrogram feature extractor), and
(2) Whisper model (encoder+decoder)
Currently, in examples/qualcomm/oss_scripts/whisper, we have a flow for exporting Whisper encoder+decoder (2) and running it on device. It can take in Mel spectrogram tensors as input and produce text output

**This class implements part (1), the audio processing stage, in PyTorch.** It is equivalent to HuggingFace WhisperFeatureExtractor (which computes Mel spectrograms with NumPy). It takes in an audio waveform at 16KHz (as a 1D tensor) and outputs Mel spectrograms that can be fed directly to the Whisper model (2).

The script (see test plan) compares this class agains WhisperFeatureExtractor, they have a very small numerical discrepancy (<1e-5).

Reviewed By: jackzhxng

Differential Revision: D80215714
Summary:
Pull Request resolved: pytorch#13538

Running Whisper to convert audio -> text consists of two steps:
(1) Audio preprocessor (aka Mel spectrogram feature extractor), and
(2) Whisper model (encoder+decoder)
Currently, in examples/qualcomm/oss_scripts/whisper, we have a flow for exporting Whisper encoder+decoder (2) and running it on device. It can take in Mel spectrogram tensors as input and produce text output

**This class implements part (1), the audio processing stage, in PyTorch.** It is equivalent to HuggingFace WhisperFeatureExtractor (which computes Mel spectrograms with NumPy). It takes in an audio waveform at 16KHz (as a 1D tensor) and outputs Mel spectrograms that can be fed directly to the Whisper model (2).

The script (see test plan) compares this class agains WhisperFeatureExtractor, they have a very small numerical discrepancy (<1e-5).

Reviewed By: jackzhxng

Differential Revision: D80215714
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D80215714

@facebook-github-bot facebook-github-bot merged commit 624b38e into pytorch:main Aug 21, 2025
99 of 106 checks passed
agrima1304 pushed a commit to agrima1304/executorch that referenced this pull request Aug 26, 2025
Differential Revision: D80215714

Pull Request resolved: pytorch#13538
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. fb-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants