-
Notifications
You must be signed in to change notification settings - Fork 6.5k
[modular] add tests for qwen modular #12585
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
base: main
Are you sure you want to change the base?
Conversation
| @property | ||
| def inputs(self) -> List[InputParam]: | ||
| return [ | ||
| InputParam("latents"), |
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.
Similar to how it's done in the other pipelines.
| ) | ||
| ] | ||
| * block_state.batch_size | ||
| for _ in range(block_state.batch_size) |
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.
We have two options:
- Either this
- Or how it's done in edit:
diffusers/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit.py
Lines 752 to 757 in 325a950
img_shapes = [ [ (1, height // self.vae_scale_factor // 2, width // self.vae_scale_factor // 2), (1, calculated_height // self.vae_scale_factor // 2, calculated_width // self.vae_scale_factor // 2), ] ] * batch_size
Regardless, the current implementation isn't exactly the same as how the standard pipeline implements it and would break for the batched input tests we have.
| block_state = self.get_block_state(state) | ||
|
|
||
| # YiYi Notes: remove support for output_type = "latents', we can just skip decode/encode step in modular | ||
| vae_scale_factor = 2 ** len(components.vae.temperal_downsample) |
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.
Keeping vae_scale_factor fixed to 8, for example, would break the tests as we use a smaller VAE.
| block_state.negative_prompt_embeds = None | ||
| block_state.negative_prompt_embeds_mask = None |
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.
Otherwise, no CFG settings would break.
| @pytest.mark.xfail(condition=True, reason="Batch of multiple images needs to be revisited", strict=True) | ||
| def test_num_images_per_prompt(self): | ||
| super().test_num_images_per_prompt() | ||
|
|
||
| @pytest.mark.xfail(condition=True, reason="Batch of multiple images needs to be revisited", strict=True) | ||
| def test_inference_batch_consistent(): | ||
| super().test_inference_batch_consistent() | ||
|
|
||
| @pytest.mark.xfail(condition=True, reason="Batch of multiple images needs to be revisited", strict=True) | ||
| def test_inference_batch_single_identical(): | ||
| super().test_inference_batch_single_identical() |
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.
These are skipped in the standard pipeline tests, too.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
With Update: Checking with the All of those tests work with |
DN6
left a comment
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.
Just comments on aligning with new testing structure.
tests/modular_pipelines/qwen/test_modular_pipeline_qwenimage.py
Outdated
Show resolved
Hide resolved
tests/modular_pipelines/qwen/test_modular_pipeline_qwenimage.py
Outdated
Show resolved
Hide resolved
tests/modular_pipelines/qwen/test_modular_pipeline_qwenimage.py
Outdated
Show resolved
Hide resolved
tests/modular_pipelines/qwen/test_modular_pipeline_qwenimage.py
Outdated
Show resolved
Hide resolved
tests/modular_pipelines/qwen/test_modular_pipeline_qwenimage.py
Outdated
Show resolved
Hide resolved
|
I will wait for your #12579 PR to get merged first. Easier that way for me to apply your suggestions. |
|
@DN6 I have aligned the tests to follow the current structure. PTAL. |
|
@DN6 the following tests are failing: FAILED tests/modular_pipelines/stable_diffusion_xl/test_modular_pipeline_stable_diffusion_xl.py::TestSDXLModularPipelineFast::test_float16_inference - RuntimeError: expected scalar type Half but found Float
FAILED tests/modular_pipelines/stable_diffusion_xl/test_modular_pipeline_stable_diffusion_xl.py::TestSDXLImg2ImgModularPipelineFast::test_float16_inference - RuntimeError: expected scalar type Half but found FloatI think it's probably because of #12512 |
What does this PR do?
Some things came up with the tests that needed fixing. But LMK if you would like me to revert them.
I also fixed a bunch of small things related to tests as I was running them on both GPU and CPU.
Will propagate the changes from #12579 once it's merged.