You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request refactors the test suites for the Qwen image pipelines to use the unified DiffSynthEngine interface and configuration objects, and adds parallelism and FSDP (Fully Sharded Data Parallel) test coverage. The changes improve consistency, extensibility, and maintainability of the tests, while also ensuring GPU memory is properly released after each test class.
Test pipeline refactoring and improvements:
All Qwen image pipeline tests now use DiffSynthEngine with QwenImagePipelineConfig instead of individual pipeline classes, improving consistency and future extensibility. (tests/test_pipelines/test_qwen_image.py, tests/test_pipelines/test_qwen_image_edit.py, tests/test_pipelines/test_qwen_image_edit_plus_2509.py, tests/test_pipelines/test_qwen_image_edit_plus_2511.py, tests/test_pipelines/test_qwen_image_layered.py) [1][2][3][4][5]
The .generate() method of DiffSynthEngine replaces direct pipeline calls, standardizing how image generation and editing are invoked in all tests. [1][2][3][4][5]
Parallelism and FSDP test coverage:
Added new test classes for parallel and FSDP execution modes for both image generation and editing, ensuring these distributed features are tested and validated. [1][2]
Test resource management:
All test classes now explicitly delete the engine and clear CUDA memory in tearDownClass, reducing the risk of out-of-memory errors in CI or local runs. [1][2][3][4][5]
Layered pipeline test adjustments:
The layered image test now expects 3 layers instead of 4, and the SSIM threshold for image comparison is slightly relaxed for improved robustness.
Overall, these changes modernize and strengthen the test suite for Qwen image pipelines, aligning it with the latest engine interface and distributed features.
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors Qwen image pipeline tests to use the unified DiffSynthEngine and QwenImagePipelineConfig, and adds new test cases for parallelism and FSDP. Feedback recommends explicitly calling engine.shutdown() in teardown methods for resource cleanup and requests clarification on the reduction of layers and threshold adjustments in the layered image test.
The reason will be displayed to describe this comment to others. Learn more.
Explicitly calling cls.engine.shutdown() before deleting the engine is recommended to ensure that worker processes are terminated immediately and resources (like GPU memory and multiprocessing pipes) are released. Relying solely on del and garbage collection can be unreliable in some environments, potentially leading to resource leaks or port conflicts in subsequent tests.
The reason will be displayed to describe this comment to others. Learn more.
Explicitly calling cls.engine.shutdown() before deleting the engine is recommended to ensure that worker processes are terminated immediately and resources are released.
The reason will be displayed to describe this comment to others. Learn more.
Explicitly calling cls.engine.shutdown() before deleting the engine is recommended to ensure that worker processes are terminated immediately and resources are released.
The reason will be displayed to describe this comment to others. Learn more.
Explicitly calling cls.engine.shutdown() before deleting the engine is recommended to ensure that worker processes are terminated immediately and resources are released.
The reason will be displayed to describe this comment to others. Learn more.
Explicitly calling cls.engine.shutdown() before deleting the engine is recommended to ensure that worker processes are terminated immediately and resources are released.
The reason will be displayed to describe this comment to others. Learn more.
Explicitly calling cls.engine.shutdown() before deleting the engine is recommended to ensure that worker processes are terminated immediately and resources are released.
The reason will be displayed to describe this comment to others. Learn more.
Explicitly calling cls.engine.shutdown() before deleting the engine is recommended to ensure that worker processes are terminated immediately and resources are released.
The reason will be displayed to describe this comment to others. Learn more.
Explicitly calling cls.engine.shutdown() before deleting the engine is recommended to ensure that worker processes are terminated immediately and resources are released.
The reason will be displayed to describe this comment to others. Learn more.
The number of layers has been reduced from 4 to 3, which is also reflected in the assertion on line 40. Since 4 is the default value for the layers parameter in QwenImageLayeredPipeline, could you clarify why the test was changed to use 3 layers? If this was done to align with changed model behavior on Torch 2.10.0, it might be masking a regression in the model's ability to produce the expected number of layers.
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
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.
This pull request refactors the test suites for the Qwen image pipelines to use the unified
DiffSynthEngineinterface and configuration objects, and adds parallelism and FSDP (Fully Sharded Data Parallel) test coverage. The changes improve consistency, extensibility, and maintainability of the tests, while also ensuring GPU memory is properly released after each test class.Test pipeline refactoring and improvements:
All Qwen image pipeline tests now use
DiffSynthEnginewithQwenImagePipelineConfiginstead of individual pipeline classes, improving consistency and future extensibility. (tests/test_pipelines/test_qwen_image.py,tests/test_pipelines/test_qwen_image_edit.py,tests/test_pipelines/test_qwen_image_edit_plus_2509.py,tests/test_pipelines/test_qwen_image_edit_plus_2511.py,tests/test_pipelines/test_qwen_image_layered.py) [1] [2] [3] [4] [5]The
.generate()method ofDiffSynthEnginereplaces direct pipeline calls, standardizing how image generation and editing are invoked in all tests. [1] [2] [3] [4] [5]Parallelism and FSDP test coverage:
Test resource management:
tearDownClass, reducing the risk of out-of-memory errors in CI or local runs. [1] [2] [3] [4] [5]Layered pipeline test adjustments:
Overall, these changes modernize and strengthen the test suite for Qwen image pipelines, aligning it with the latest engine interface and distributed features.