[tests] Pipeline test refactor#14113
Conversation
|
/diffusers-bot pytest tests/pipelines/flux/test_pipeline_flux.py::TestFluxPipeline::test_float16_inference |
|
❌ |
| @@ -1,9 +1,15 @@ | |||
| import contextlib | |||
There was a problem hiding this comment.
Changes here are migrating to pytest.
|
|
||
|
|
||
| @is_staging_test | ||
| class PipelinePushToHubTester(unittest.TestCase): |
There was a problem hiding this comment.
Moved to tests/pipelines/test_pipeline_utils.py
|
All the failing tests are quite unrelated |
| @require_torch_accelerator | ||
| @slow | ||
| class Base4bitTests(unittest.TestCase): | ||
| class Base4bitTests: |
There was a problem hiding this comment.
For pipeline quantization tests, why not use the Mixin approach that we have with models? Or is that planned for a follow up?
|
@DN6 I believe I have resolved all your comments. PTAL. |
DN6
left a comment
There was a problem hiding this comment.
LGTM. Some minor additions requested.
| return all(shape == shapes[0] for shape in shapes[1:]) | ||
|
|
||
|
|
||
| def check_qkv_fusion_matches_attn_procs_length(model, original_attn_processors): |
There was a problem hiding this comment.
Okay to have these here. But my preference would be to remove these checks from pipeline level testing. This can be in a follow up after all pipeline tests are migrated to the new format.
There was a problem hiding this comment.
We should then ensure if these are included in the model level testing? I have included a TODO for that as a comment.
Notes
generate_pipeline_level_tests.pyscript. Will be done in subsequent PRs once other mixins, such as LoRA, are added.pytestfeatures as much as possible. This is particularly reflected in the use of custom fixtures. For example,base_pipe_output. This way, we don't have to compute it for every test that requires it.I have only refactored the Flux pipeline tests to use the new mixin, as we do in other PRs. Will open subsequent PRs for other pipelines and involve the community.