Skip to content

Commit

Permalink
Move more slow tests to nightly (huggingface#5220)
Browse files Browse the repository at this point in the history
* move to nightly

* fix mistake
  • Loading branch information
DN6 authored Sep 28, 2023
1 parent 622f35b commit c78ee14
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 28 deletions.
4 changes: 2 additions & 2 deletions tests/pipelines/audio_diffusion/test_audio_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
UNet2DConditionModel,
UNet2DModel,
)
from diffusers.utils.testing_utils import enable_full_determinism, nightly, require_torch_gpu, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, nightly, require_torch_gpu, torch_device


enable_full_determinism()
Expand Down Expand Up @@ -95,7 +95,7 @@ def dummy_vqvae_and_unet(self):
)
return vqvae, unet

@slow
@nightly
def test_audio_diffusion(self):
device = "cpu" # ensure determinism for the device-dependent torch.Generator
mel = Mel(
Expand Down
4 changes: 2 additions & 2 deletions tests/pipelines/audioldm/test_audioldm.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
UNet2DConditionModel,
)
from diffusers.utils import is_xformers_available
from diffusers.utils.testing_utils import enable_full_determinism, nightly, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, nightly, torch_device

from ..pipeline_params import TEXT_TO_AUDIO_BATCH_PARAMS, TEXT_TO_AUDIO_PARAMS
from ..test_pipelines_common import PipelineTesterMixin
Expand Down Expand Up @@ -369,7 +369,7 @@ def test_xformers_attention_forwardGenerator_pass(self):
self._test_xformers_attention_forwardGenerator_pass(test_mean_pixel_difference=False)


@slow
@nightly
class AudioLDMPipelineSlowTests(unittest.TestCase):
def tearDown(self):
super().tearDown()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
floats_tensor,
load_image,
load_numpy,
nightly,
require_torch_gpu,
slow,
torch_device,
)

Expand Down Expand Up @@ -232,7 +232,7 @@ def test_float16_inference(self):
super().test_float16_inference(expected_max_diff=2e-1)


@slow
@nightly
@require_torch_gpu
class KandinskyV22ControlnetImg2ImgPipelineIntegrationTests(unittest.TestCase):
def tearDown(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from transformers import CLIPTextConfig, CLIPTextModel

from diffusers import DDIMScheduler, LDMPipeline, UNet2DModel, VQModel
from diffusers.utils.testing_utils import enable_full_determinism, require_torch, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, nightly, require_torch, torch_device


enable_full_determinism()
Expand Down Expand Up @@ -96,7 +96,7 @@ def test_inference_uncond(self):
assert np.abs(image_from_tuple_slice.flatten() - expected_slice).max() < tolerance


@slow
@nightly
@require_torch
class LDMPipelineIntegrationTests(unittest.TestCase):
def test_inference_uncond(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
import torch

from diffusers import StableDiffusionKDiffusionPipeline
from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, nightly, require_torch_gpu, torch_device


enable_full_determinism()


@slow
@nightly
@require_torch_gpu
class StableDiffusionPipelineIntegrationTests(unittest.TestCase):
def tearDown(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
StableDiffusionModelEditingPipeline,
UNet2DConditionModel,
)
from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu, skip_mps, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, nightly, require_torch_gpu, skip_mps, torch_device

from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS
from ..test_pipelines_common import PipelineKarrasSchedulerTesterMixin, PipelineLatentTesterMixin, PipelineTesterMixin
Expand Down Expand Up @@ -184,7 +184,7 @@ def test_attention_slicing_forward_pass(self):
super().test_attention_slicing_forward_pass(expected_max_diff=5e-3)


@slow
@nightly
@require_torch_gpu
class StableDiffusionModelEditingSlowTests(unittest.TestCase):
def tearDown(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
)
from diffusers.utils.testing_utils import (
enable_full_determinism,
nightly,
require_torch_gpu,
slow,
torch_device,
)

Expand Down Expand Up @@ -188,7 +188,7 @@ def test_stable_diffusion_paradigms_negative_prompt(self):
assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2


@slow
@nightly
@require_torch_gpu
class StableDiffusionParadigmsPipelineSlowTests(unittest.TestCase):
def tearDown(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/pipelines/stable_diffusion/test_stable_diffusion_sag.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
StableDiffusionSAGPipeline,
UNet2DConditionModel,
)
from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, nightly, require_torch_gpu, torch_device

from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS
from ..test_pipelines_common import PipelineLatentTesterMixin, PipelineTesterMixin
Expand Down Expand Up @@ -115,7 +115,7 @@ def test_inference_batch_single_identical(self):
super().test_inference_batch_single_identical(expected_max_diff=3e-3)


@slow
@nightly
@require_torch_gpu
class StableDiffusionPipelineIntegrationTests(unittest.TestCase):
def tearDown(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
)
from diffusers.utils.testing_utils import (
load_numpy,
nightly,
numpy_cosine_similarity_distance,
require_torch_gpu,
skip_mps,
slow,
)

from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS
Expand Down Expand Up @@ -187,7 +187,7 @@ def test_save_load_optional_components(self):


@require_torch_gpu
@slow
@nightly
class StableDiffusionAttendAndExcitePipelineIntegrationTests(unittest.TestCase):
# Attend and excite requires being able to run a backward pass at
# inference time. There's no deterministic backward operator for pad
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
nightly,
numpy_cosine_similarity_distance,
require_torch_gpu,
slow,
torch_device,
)

Expand Down Expand Up @@ -292,7 +291,7 @@ def test_inversion_dpm(self):


@require_torch_gpu
@slow
@nightly
class StableDiffusionDiffEditPipelineIntegrationTests(unittest.TestCase):
def tearDown(self):
super().tearDown()
Expand Down
4 changes: 2 additions & 2 deletions tests/pipelines/stable_unclip/test_stable_unclip.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
UNet2DConditionModel,
)
from diffusers.pipelines.stable_diffusion.stable_unclip_image_normalizer import StableUnCLIPImageNormalizer
from diffusers.utils.testing_utils import enable_full_determinism, load_numpy, require_torch_gpu, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, load_numpy, nightly, require_torch_gpu, torch_device

from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS
from ..test_pipelines_common import (
Expand Down Expand Up @@ -185,7 +185,7 @@ def test_inference_batch_single_identical(self):
self._test_inference_batch_single_identical(expected_max_diff=1e-3)


@slow
@nightly
@require_torch_gpu
class StableUnCLIPPipelineIntegrationTests(unittest.TestCase):
def tearDown(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/pipelines/stable_unclip/test_stable_unclip_img2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
floats_tensor,
load_image,
load_numpy,
nightly,
require_torch_gpu,
skip_mps,
slow,
torch_device,
)

Expand Down Expand Up @@ -206,7 +206,7 @@ def test_xformers_attention_forwardGenerator_pass(self):
self._test_xformers_attention_forwardGenerator_pass(test_max_difference=False)


@slow
@nightly
@require_torch_gpu
class StableUnCLIPImg2ImgPipelineIntegrationTests(unittest.TestCase):
def tearDown(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/pipelines/text_to_video/test_text_to_video_zero.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
import torch

from diffusers import DDIMScheduler, TextToVideoZeroPipeline
from diffusers.utils.testing_utils import load_pt, require_torch_gpu, slow
from diffusers.utils.testing_utils import load_pt, nightly, require_torch_gpu

from ..test_pipelines_common import assert_mean_pixel_difference


@slow
@nightly
@require_torch_gpu
class TextToVideoZeroPipelineSlowTests(unittest.TestCase):
def test_full_model(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/pipelines/text_to_video/test_video_to_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
enable_full_determinism,
floats_tensor,
is_flaky,
nightly,
numpy_cosine_similarity_distance,
skip_mps,
slow,
torch_device,
)

Expand Down Expand Up @@ -195,7 +195,7 @@ def test_progress_bar(self):
return super().test_progress_bar()


@slow
@nightly
@skip_mps
class VideoToVideoSDPipelineSlowTests(unittest.TestCase):
def test_two_step_model(self):
Expand Down

0 comments on commit c78ee14

Please sign in to comment.