-
Notifications
You must be signed in to change notification settings - Fork 1k
[Test] Add Stable Audio offline e2e TeaCache Test #2377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hsliuustc0106
merged 29 commits into
vllm-project:main
from
zhangj1an:jian/add_test_teacache
Apr 14, 2026
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
41dbfe6
add teacache test
zhangj1an 405f591
update to match new diffusion user guide
zhangj1an 1ae71f3
Merge branch 'main' into jian/add_test_teacache
zhangj1an 8038dcb
register B60
zhangj1an 6d41eed
Merge branch 'main' into jian/add_test_teacache
zhangj1an 193cd56
resolve review comments
zhangj1an 1b04399
Merge branch 'main' into jian/add_test_teacache
zhangj1an 466396b
reset a file
zhangj1an f28d463
Merge branch 'main' into jian/add_test_teacache
zhangj1an e05b372
add nightly test
zhangj1an e1f7f02
Merge branch 'main' into jian/add_test_teacache
zhangj1an 1bed83b
Merge branch 'main' into jian/add_test_teacache
zhangj1an f624a21
Merge branch 'main' into jian/add_test_teacache
zhangj1an 3c3a262
add comment to explain confusing config
zhangj1an 4ce6d4f
remove duplicated test
zhangj1an 2763982
still use offline test for stable audio until PR 2452 is merged
zhangj1an 0d9f44b
merge 3 tests into 1
zhangj1an 8ac69cb
Merge branch 'main' into jian/add_test_teacache
zhangj1an 2d04271
Merge branch 'main' into jian/add_test_teacache
zhangj1an 9b36b0b
Merge branch 'main' into jian/add_test_teacache
zhangj1an d84a78f
merge main branch
zhangj1an 7e6fe00
chore(docs): drop manual edits to generated offline_inference text_to…
zhangj1an 7e4cf69
Merge branch 'main' into jian/add_test_teacache
zhangj1an a1b7616
Merge branch 'main' into jian/add_test_teacache
zhangj1an bd186c9
Merge branch 'main' into jian/add_test_teacache
zhangj1an f60d90a
Merge branch 'main' into jian/add_test_teacache
zhangj1an eaf6f7f
Merge branch 'jian/add_test_teacache' of https://github.com/zhangj1an…
zhangj1an b95ec8d
merge origin/main, resolve conflict by keeping test_stable_audio_mode…
zhangj1an 8d072d7
adapt to pr 2711
zhangj1an File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
99 changes: 99 additions & 0 deletions
99
tests/e2e/offline_inference/test_stable_audio_expansion.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
|
|
||
| """Stable Audio offline e2e: real weights, FP8 + TeaCache (single job to save GPU). | ||
|
|
||
| NOTE: This test instantiates Omni directly instead of using the omni_runner | ||
| fixture (introduced in PR #2711) because the fixture's parametrize interface | ||
| only accepts (model, stage_config_path) and does not support extra kwargs like | ||
| quantization, cache_backend, or cache_config. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import numpy as np | ||
| import pytest | ||
| import torch | ||
|
|
||
| from tests.conftest import assert_audio_valid | ||
| from tests.utils import hardware_test | ||
| from vllm_omni import Omni | ||
| from vllm_omni.inputs.data import OmniDiffusionSamplingParams | ||
| from vllm_omni.outputs import OmniRequestOutput | ||
| from vllm_omni.platforms import current_omni_platform | ||
|
|
||
| _SAMPLE_RATE = 44100 | ||
| _CLIP_DURATION_S = 2.0 | ||
|
|
||
|
|
||
| def generate_stable_audio_short_clip( | ||
| omni: Omni, | ||
| *, | ||
| audio_start_in_s: float = 0.0, | ||
| audio_end_in_s: float = 2.0, | ||
| num_inference_steps: int = 4, | ||
| seed: int = 42, | ||
| ) -> np.ndarray: | ||
| """Run a minimal Stable Audio generation and return audio as (batch, channels, samples).""" | ||
| outputs = omni.generate( | ||
| prompts={ | ||
| "prompt": "The sound of a dog barking", | ||
| "negative_prompt": "Low quality.", | ||
| }, | ||
| sampling_params_list=OmniDiffusionSamplingParams( | ||
| num_inference_steps=num_inference_steps, | ||
| guidance_scale=7.0, | ||
| generator=torch.Generator(current_omni_platform.device_type).manual_seed(seed), | ||
| num_outputs_per_prompt=1, | ||
| extra_args={ | ||
| "audio_start_in_s": audio_start_in_s, | ||
| "audio_end_in_s": audio_end_in_s, | ||
| }, | ||
| ), | ||
| ) | ||
|
|
||
| assert outputs is not None | ||
| first_output = outputs[0] | ||
| # Outer OmniRequestOutput.final_output_type comes from get_stage_metadata. | ||
| # The nested request_output is the worker OmniRequestOutput | ||
| # (e.g. final_output_type="audio") and holds the multimodal payload. | ||
| # Follow-up: add StableAudioPipeline stage YAML, and pass model into | ||
| # _create_default_diffusion_stage_cfg so default diffusion metadata can set | ||
| # final_output_type to "audio" for future audio pipelines without YAML. | ||
| assert first_output.final_output_type == "image" | ||
| assert hasattr(first_output, "request_output") and first_output.request_output | ||
|
|
||
| req_out = first_output.request_output | ||
| assert isinstance(req_out, OmniRequestOutput) | ||
| assert req_out.final_output_type == "audio" | ||
| assert hasattr(req_out, "multimodal_output") and req_out.multimodal_output | ||
| audio = req_out.multimodal_output.get("audio") | ||
| assert isinstance(audio, np.ndarray) | ||
| return audio | ||
|
|
||
|
|
||
| @pytest.mark.advanced_model | ||
| @pytest.mark.diffusion | ||
| @pytest.mark.cache | ||
| @hardware_test(res={"cuda": "L4", "xpu": "B60"}) | ||
| def test_stable_audio_quantization_and_teacache() -> None: | ||
| """Stable Audio Open on real Hub weights with FP8 + TeaCache (covers former L2 smoke + L4 features). | ||
|
|
||
| CI should provide ``HF_TOKEN`` if the checkpoint is gated. | ||
| """ | ||
| m = Omni( | ||
| model="stabilityai/stable-audio-open-1.0", | ||
| quantization="fp8", | ||
| cache_backend="tea_cache", | ||
| cache_config={"rel_l1_thresh": 0.2}, | ||
| ) | ||
| try: | ||
| audio = generate_stable_audio_short_clip(m) | ||
| assert_audio_valid( | ||
| audio, | ||
| sample_rate=_SAMPLE_RATE, | ||
| channels=2, | ||
| duration_s=_CLIP_DURATION_S, | ||
| ) | ||
| finally: | ||
| m.close() |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.