-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[Test] Add OmniGen2 online serving expansion L4 tests for Ulysses-SP and CFG-Parallel #2326
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
Open
yangjianjuan
wants to merge
1
commit into
vllm-project:main
Choose a base branch
from
yangjianjuan:omni_gen2_L4_UT
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| """ | ||
| Online serving diffusion feature coverage for OmniGen2. | ||
|
|
||
| Coverage: | ||
| - Ulysses-SP | ||
| - CFG-Parallel | ||
|
|
||
| assert_diffusion_response validates successful generation and the expected | ||
| image resolution. | ||
| """ | ||
|
|
||
| import pytest | ||
|
|
||
| from tests.conftest import ( | ||
| OmniServer, | ||
| OmniServerParams, | ||
| OpenAIClientHandler, | ||
| dummy_messages_from_mix_data, | ||
| ) | ||
| from tests.utils import hardware_marks | ||
|
|
||
| MODEL = "OmniGen2/OmniGen2" | ||
| PROMPT = "A sleek concept car parked beside a glass building at sunrise, cinematic lighting, ultra detailed." | ||
| NEGATIVE_PROMPT = "blurry, low quality, distorted, watermark" | ||
|
|
||
| SINGLE_CARD_FEATURE_MARKS = hardware_marks(res={"cuda": "L4"}) | ||
| PARALLEL_FEATURE_MARKS = { | ||
| "usp": hardware_marks(res={"cuda": "L4"}, num_cards=3), | ||
| "cfg_parallel": hardware_marks(res={"cuda": "L4"}, num_cards=2), | ||
| } | ||
|
|
||
|
|
||
| def _get_omnigen2_feature_cases(model: str): | ||
| """Return OmniGen2 online serving cases for SP, and CFG-Parallel.""" | ||
|
|
||
| return [ | ||
| pytest.param( | ||
| OmniServerParams( | ||
| model=model, | ||
| server_args=[ | ||
| "--usp", | ||
| "3", | ||
| ], | ||
| ), | ||
| id="ulysses_sp_3", | ||
| marks=PARALLEL_FEATURE_MARKS["usp"], | ||
| ), | ||
| pytest.param( | ||
| OmniServerParams( | ||
| model=model, | ||
| server_args=[ | ||
| "--cfg-parallel-size", | ||
| "2", | ||
| ], | ||
| ), | ||
| id="cfg_parallel_2", | ||
| marks=PARALLEL_FEATURE_MARKS["cfg_parallel"], | ||
| ), | ||
| ] | ||
|
|
||
|
|
||
| @pytest.mark.advanced_model | ||
| @pytest.mark.diffusion | ||
| @pytest.mark.parametrize( | ||
| "omni_server", | ||
| _get_omnigen2_feature_cases(MODEL), | ||
| indirect=True, | ||
| ) | ||
| def test_omnigen2( | ||
| omni_server: OmniServer, | ||
| openai_client: OpenAIClientHandler, | ||
| ): | ||
| """Validate OmniGen2 online serving for SP, and CFG-Parallel.""" | ||
|
|
||
| messages = dummy_messages_from_mix_data(content_text=PROMPT) | ||
|
|
||
| request_config = { | ||
| "model": omni_server.model, | ||
| "messages": messages, | ||
| "extra_body": { | ||
| "height": 1024, | ||
| "width": 1024, | ||
| "num_inference_steps": 2, | ||
| "negative_prompt": NEGATIVE_PROMPT, | ||
| "guidance_scale": 4.0, | ||
| "seed": 42, | ||
| }, | ||
| } | ||
|
|
||
| openai_client.send_diffusion_request(request_config) | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case claims CFG-parallel coverage for OmniGen2, but
OmniGen2Pipelinedoes not useCFGParallelMixin(or any rank-aware CFG split path), so--cfg-parallel-size 2does not actually exercise CFG-parallel behavior and can pass while that feature is effectively untested for this model. In practice this creates false confidence: regressions in real CFG-parallel execution would not be caught by this test.Useful? React with 👍 / 👎.