Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/lora/test_lora_layers_sana.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from diffusers import AutoencoderDC, FlowMatchEulerDiscreteScheduler, SanaPipeline, SanaTransformer2DModel

from ..testing_utils import floats_tensor, require_peft_backend
from ..testing_utils import IS_GITHUB_ACTIONS, floats_tensor, require_peft_backend


sys.path.append(".")
Expand Down Expand Up @@ -136,3 +136,7 @@ def test_simple_inference_with_text_lora_fused(self):
@unittest.skip("Text encoder LoRA is not supported in SANA.")
def test_simple_inference_with_text_lora_save_load(self):
pass

@unittest.skipIf(IS_GITHUB_ACTIONS, reason="Skipping test inside GitHub Actions environment")
def test_layerwise_casting_inference_denoiser(self):
return super().test_layerwise_casting_inference_denoiser()
10 changes: 5 additions & 5 deletions tests/models/autoencoders/test_models_autoencoder_dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@

from diffusers import AutoencoderDC

from ...testing_utils import (
enable_full_determinism,
floats_tensor,
torch_device,
)
from ...testing_utils import IS_GITHUB_ACTIONS, enable_full_determinism, floats_tensor, torch_device
from ..test_modeling_common import ModelTesterMixin
from .testing_utils import AutoencoderTesterMixin

Expand Down Expand Up @@ -82,3 +78,7 @@ def prepare_init_args_and_inputs_for_common(self):
init_dict = self.get_autoencoder_dc_config()
inputs_dict = self.dummy_input
return init_dict, inputs_dict

@unittest.skipIf(IS_GITHUB_ACTIONS, reason="Skipping test inside GitHub Actions environment")
def test_layerwise_casting_inference(self):
super().test_layerwise_casting_inference()
5 changes: 5 additions & 0 deletions tests/pipelines/sana/test_sana.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from diffusers import AutoencoderDC, FlowMatchEulerDiscreteScheduler, SanaPipeline, SanaTransformer2DModel

from ...testing_utils import (
IS_GITHUB_ACTIONS,
backend_empty_cache,
enable_full_determinism,
require_torch_accelerator,
Expand Down Expand Up @@ -304,6 +305,10 @@ def test_float16_inference(self):
# Requires higher tolerance as model seems very sensitive to dtype
super().test_float16_inference(expected_max_diff=0.08)

@unittest.skipIf(IS_GITHUB_ACTIONS, reason="Skipping test inside GitHub Actions environment")
def test_layerwise_casting_inference(self):
super().test_layerwise_casting_inference()


@slow
@require_torch_accelerator
Expand Down
9 changes: 5 additions & 4 deletions tests/pipelines/sana/test_sana_controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
)
from diffusers.utils.torch_utils import randn_tensor

from ...testing_utils import (
enable_full_determinism,
torch_device,
)
from ...testing_utils import IS_GITHUB_ACTIONS, enable_full_determinism, 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 PipelineTesterMixin, to_np

Expand Down Expand Up @@ -326,3 +323,7 @@ def test_inference_batch_single_identical(self):
def test_float16_inference(self):
# Requires higher tolerance as model seems very sensitive to dtype
super().test_float16_inference(expected_max_diff=0.08)

@unittest.skipIf(IS_GITHUB_ACTIONS, reason="Skipping test inside GitHub Actions environment")
def test_layerwise_casting_inference(self):
super().test_layerwise_casting_inference()
9 changes: 5 additions & 4 deletions tests/pipelines/sana/test_sana_sprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@

from diffusers import AutoencoderDC, SanaSprintPipeline, SanaTransformer2DModel, SCMScheduler

from ...testing_utils import (
enable_full_determinism,
torch_device,
)
from ...testing_utils import IS_GITHUB_ACTIONS, enable_full_determinism, 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 PipelineTesterMixin, to_np

Expand Down Expand Up @@ -300,3 +297,7 @@ def test_inference_batch_single_identical(self):
def test_float16_inference(self):
# Requires higher tolerance as model seems very sensitive to dtype
super().test_float16_inference(expected_max_diff=0.08)

@unittest.skipIf(IS_GITHUB_ACTIONS, reason="Skipping test inside GitHub Actions environment")
def test_layerwise_casting_inference(self):
super().test_layerwise_casting_inference()
9 changes: 5 additions & 4 deletions tests/pipelines/sana/test_sana_sprint_img2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
from diffusers import AutoencoderDC, SanaSprintImg2ImgPipeline, SanaTransformer2DModel, SCMScheduler
from diffusers.utils.torch_utils import randn_tensor

from ...testing_utils import (
enable_full_determinism,
torch_device,
)
from ...testing_utils import IS_GITHUB_ACTIONS, enable_full_determinism, torch_device
from ..pipeline_params import (
IMAGE_TO_IMAGE_IMAGE_PARAMS,
TEXT_GUIDED_IMAGE_VARIATION_BATCH_PARAMS,
Expand Down Expand Up @@ -312,3 +309,7 @@ def test_inference_batch_single_identical(self):
def test_float16_inference(self):
# Requires higher tolerance as model seems very sensitive to dtype
super().test_float16_inference(expected_max_diff=0.08)

@unittest.skipIf(IS_GITHUB_ACTIONS, reason="Skipping test inside GitHub Actions environment")
def test_layerwise_casting_inference(self):
super().test_layerwise_casting_inference()
2 changes: 2 additions & 0 deletions tests/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
IS_CUDA_SYSTEM = False
IS_XPU_SYSTEM = False

IS_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true" and os.getenv("DIFFUSERS_IS_CI") == "yes"

global_rng = random.Random()

logger = get_logger(__name__)
Expand Down
Loading