diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

[Maintenance] Updating fast pipeline tests to rely on common `PipelineTesterMixin`

Open anton-l opened this issue 3 years ago • 0 comments

Context

The #1526 PR implemented a PipelineTesterMixin with common fast tests for pipelines to inherit: saving/loading, casting to fp16, checking tuple outputs, attention slicing, etc. To support PipelineTesterMixin, a fast tests class has to:

  1. Inherit form the mixin https://github.com/huggingface/diffusers/blob/02d83c9ff1b93f2c6f9c94f9369b3e4bc1ba8ce7/tests/pipelines/stable_diffusion/test_stable_diffusion.py#L45
  2. Implement pipeline_class https://github.com/huggingface/diffusers/blob/02d83c9ff1b93f2c6f9c94f9369b3e4bc1ba8ce7/tests/pipelines/stable_diffusion/test_stable_diffusion.py#L46
  3. Implement get_dummy_components() https://github.com/huggingface/diffusers/blob/02d83c9ff1b93f2c6f9c94f9369b3e4bc1ba8ce7/tests/pipelines/stable_diffusion/test_stable_diffusion.py#L48-L53
  4. Implement get_dummy_inputs(device, seed) https://github.com/huggingface/diffusers/blob/02d83c9ff1b93f2c6f9c94f9369b3e4bc1ba8ce7/tests/pipelines/stable_diffusion/test_stable_diffusion.py#L102-L109

And that's it! Then the rest of the fast tests can either be trimmed (like checking tuple outputs and fp16, bacause they're already in the PipelineTesterMixin), or updated to use get_dummy_components() and get_dummy_inputs() instead of self.dummy_unet, self.dummy_text_encoder, self.dummy_image.

The list of tests to update

  • [x] AltDiffusionPipelineFastTests (:red_circle: #1629)
  • [ ] AltDiffusionImg2ImgPipelineFastTests
  • [ ] AudioDiffusionPipelineFastTests (currently named PipelineFastTests)
  • [x] DanceDiffusionPipelineFastTests (:yellow_circle: #1630)
  • [x] DDIMPipelineFastTests
  • [ ] DDPMPipelineFastTests
  • [ ] KarrasVePipelineFastTests
  • [x] LDMTextToImagePipelineFastTests
  • [ ] LDMSuperResolutionPipelineFastTests
  • [ ] LDMPipelineFastTests
  • [x] PaintByExamplePipelineFastTests
  • [ ] PNDMPipelineFastTests
  • [x] RepaintPipelineIntegrationTests
  • [ ] ScoreSdeVeipelineFastTests
  • [x] CycleDiffusionPipelineFastTests (:yellow_circle: #1630)
  • [x] StableDiffusionPipelineFastTests
  • [x] StableDiffusionImageVariationPipelineFastTests
  • [x] StableDiffusionImg2ImgPipelineFastTests (:yellow_circle: #1630)
  • [x] StableDiffusionInpaintPipelineFastTests
  • [ ] StableDiffusionInpaintLegacyPipelineFastTests
  • [x] StableDiffusion2PipelineFastTests
  • [x] StableDiffusiondepth2imgPipelineFastTests (:red_circle: https://github.com/huggingface/diffusers/issues/1631 https://github.com/huggingface/diffusers/issues/1634)
  • [x] StableDiffusion2InpaintPipelineFastTests
  • [ ] StableDiffusionUpscalePipelineFastTests
  • [ ] StableDiffusion2VPredictionPipelineFastTests
  • [ ] SafeDiffusionPipelineFastTests
  • [ ] VersatileDiffusionDualGuidedPipelineFastTests
  • [ ] VersatileDiffusionImageVariationPipelineFastTests
  • [ ] VersatileDiffusionMegaPipelineFastTests
  • [ ] VersatileDiffusionTextToImagePipelineFastTests
  • [ ] VQDiffusionPipelineFastTests

cc @patrickvonplaten @patil-suraj @pcuenca @williamberman

anton-l avatar Dec 06 '22 18:12 anton-l