Skip to content

[Refactor] Remove resampy dependency#39524

Merged
vllm-bot merged 8 commits intovllm-project:mainfrom
Isotr0py:remove-resampy
Apr 16, 2026
Merged

[Refactor] Remove resampy dependency#39524
vllm-bot merged 8 commits intovllm-project:mainfrom
Isotr0py:remove-resampy

Conversation

@Isotr0py
Copy link
Copy Markdown
Member

@Isotr0py Isotr0py commented Apr 10, 2026

Purpose

Actually, pyav performs audio resample much better than resampy, so there is not necessary to align with librosa's original implementation:
https://github.com/librosa/librosa/blob/e403272fc984bc4aeb316e5f15899042224bb9fe/librosa/core/audio.py#L637-L678

Performance Benchmark

Method Mean (ms) Median (ms) Std (ms) Min (ms) Max (ms)
pyav 10.847 10.870 0.444 10.247 11.578
resampy 443.071 444.638 8.233 428.089 458.172

Quality Metrics (vs soxr reference)

Method RMSE MAE SNR (dB) Correlation Aliasing Spectral Conv.
pyav 0.03880904 0.00805858 +23.7606 0.99789495 0.27869838 0.06436387
resampy 0.06202365 0.00902251 +19.6881 0.99463281 0.26626801 0.10365593

Test Plan

pytest -s -v tests/entrypoints/openai/correctness/test_transcription_api_correctness.py

Test Result

Correctness tests still pass after using pyav resampler.


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
@mergify mergify Bot added ci/build multi-modality Related to multi-modality (#4194) rocm Related to AMD ROCm labels Apr 10, 2026
@github-project-automation github-project-automation Bot moved this to Todo in AMD Apr 10, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the resampy dependency across the project, updating requirement files, setup.py, and audio processing modules. The default resampling method is transitioned to pyav. Feedback indicates that hardcoding resample_audio_pyav in load_audio_soundfile may cause runtime errors if the av package is missing, suggesting the use of AudioResampler or a fallback to scipy instead.


if sr is not None and sr != native_sr:
y = resampy.resample(y, sr_orig=native_sr, sr_new=sr)
y = resample_audio_pyav(y, orig_sr=native_sr, target_sr=sr)
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.

high

In load_audio_soundfile, the resampling logic now hardcodes resample_audio_pyav. If the av package is not installed (e.g., if the user didn't install vllm[audio]), this will raise an error from the PlaceholderModule when resampling is required. It might be safer to use the AudioResampler class or provide a fallback to scipy if av is unavailable, especially since load_audio is a general utility.

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 10, 2026

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @Isotr0py.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Apr 10, 2026
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
@Isotr0py Isotr0py marked this pull request as ready for review April 11, 2026 07:48
@DarkLight1337 DarkLight1337 enabled auto-merge (squash) April 11, 2026 09:08
@github-project-automation github-project-automation Bot moved this to Ready in NVIDIA Apr 11, 2026
@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Apr 11, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 14, 2026

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @Isotr0py.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Apr 14, 2026
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 14, 2026

Hi @Isotr0py, the pre-commit checks have failed. Please run:

uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy failing?
mypy is run differently in CI. If the failure is related to this check, please use the following command to run it locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10

@mergify mergify Bot removed the needs-rebase label Apr 14, 2026
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
@vllm-bot vllm-bot merged commit 82531ed into vllm-project:main Apr 16, 2026
140 of 146 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in NVIDIA Apr 16, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in AMD Apr 16, 2026
@Isotr0py Isotr0py deleted the remove-resampy branch April 16, 2026 15:52
bnellnm pushed a commit to neuralmagic/vllm that referenced this pull request Apr 20, 2026
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
baonudesifeizhai pushed a commit to baonudesifeizhai/vllm that referenced this pull request Apr 23, 2026
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
whk-lab pushed a commit to whk-lab/vllm that referenced this pull request Apr 23, 2026
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build multi-modality Related to multi-modality (#4194) nvidia ready ONLY add when PR is ready to merge/full CI is needed rocm Related to AMD ROCm

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants