Skip to content

Commit 55d49d4

Browse files
authored
[ci] don't run sana layerwise casting tests in CI. (#12551)
* don't run sana layerwise casting tests in CI. * up
1 parent 40528e9 commit 55d49d4

File tree

7 files changed

+32
-18
lines changed

7 files changed

+32
-18
lines changed

tests/lora/test_lora_layers_sana.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
from diffusers import AutoencoderDC, FlowMatchEulerDiscreteScheduler, SanaPipeline, SanaTransformer2DModel
2222

23-
from ..testing_utils import floats_tensor, require_peft_backend
23+
from ..testing_utils import IS_GITHUB_ACTIONS, floats_tensor, require_peft_backend
2424

2525

2626
sys.path.append(".")
@@ -136,3 +136,7 @@ def test_simple_inference_with_text_lora_fused(self):
136136
@unittest.skip("Text encoder LoRA is not supported in SANA.")
137137
def test_simple_inference_with_text_lora_save_load(self):
138138
pass
139+
140+
@unittest.skipIf(IS_GITHUB_ACTIONS, reason="Skipping test inside GitHub Actions environment")
141+
def test_layerwise_casting_inference_denoiser(self):
142+
return super().test_layerwise_casting_inference_denoiser()

tests/models/autoencoders/test_models_autoencoder_dc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@
1717

1818
from diffusers import AutoencoderDC
1919

20-
from ...testing_utils import (
21-
enable_full_determinism,
22-
floats_tensor,
23-
torch_device,
24-
)
20+
from ...testing_utils import IS_GITHUB_ACTIONS, enable_full_determinism, floats_tensor, torch_device
2521
from ..test_modeling_common import ModelTesterMixin
2622
from .testing_utils import AutoencoderTesterMixin
2723

@@ -82,3 +78,7 @@ def prepare_init_args_and_inputs_for_common(self):
8278
init_dict = self.get_autoencoder_dc_config()
8379
inputs_dict = self.dummy_input
8480
return init_dict, inputs_dict
81+
82+
@unittest.skipIf(IS_GITHUB_ACTIONS, reason="Skipping test inside GitHub Actions environment")
83+
def test_layerwise_casting_inference(self):
84+
super().test_layerwise_casting_inference()

tests/pipelines/sana/test_sana.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from diffusers import AutoencoderDC, FlowMatchEulerDiscreteScheduler, SanaPipeline, SanaTransformer2DModel
2424

2525
from ...testing_utils import (
26+
IS_GITHUB_ACTIONS,
2627
backend_empty_cache,
2728
enable_full_determinism,
2829
require_torch_accelerator,
@@ -304,6 +305,10 @@ def test_float16_inference(self):
304305
# Requires higher tolerance as model seems very sensitive to dtype
305306
super().test_float16_inference(expected_max_diff=0.08)
306307

308+
@unittest.skipIf(IS_GITHUB_ACTIONS, reason="Skipping test inside GitHub Actions environment")
309+
def test_layerwise_casting_inference(self):
310+
super().test_layerwise_casting_inference()
311+
307312

308313
@slow
309314
@require_torch_accelerator

tests/pipelines/sana/test_sana_controlnet.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@
2828
)
2929
from diffusers.utils.torch_utils import randn_tensor
3030

31-
from ...testing_utils import (
32-
enable_full_determinism,
33-
torch_device,
34-
)
31+
from ...testing_utils import IS_GITHUB_ACTIONS, enable_full_determinism, torch_device
3532
from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS
3633
from ..test_pipelines_common import PipelineTesterMixin, to_np
3734

@@ -326,3 +323,7 @@ def test_inference_batch_single_identical(self):
326323
def test_float16_inference(self):
327324
# Requires higher tolerance as model seems very sensitive to dtype
328325
super().test_float16_inference(expected_max_diff=0.08)
326+
327+
@unittest.skipIf(IS_GITHUB_ACTIONS, reason="Skipping test inside GitHub Actions environment")
328+
def test_layerwise_casting_inference(self):
329+
super().test_layerwise_casting_inference()

tests/pipelines/sana/test_sana_sprint.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121

2222
from diffusers import AutoencoderDC, SanaSprintPipeline, SanaTransformer2DModel, SCMScheduler
2323

24-
from ...testing_utils import (
25-
enable_full_determinism,
26-
torch_device,
27-
)
24+
from ...testing_utils import IS_GITHUB_ACTIONS, enable_full_determinism, torch_device
2825
from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_IMAGE_PARAMS, TEXT_TO_IMAGE_PARAMS
2926
from ..test_pipelines_common import PipelineTesterMixin, to_np
3027

@@ -300,3 +297,7 @@ def test_inference_batch_single_identical(self):
300297
def test_float16_inference(self):
301298
# Requires higher tolerance as model seems very sensitive to dtype
302299
super().test_float16_inference(expected_max_diff=0.08)
300+
301+
@unittest.skipIf(IS_GITHUB_ACTIONS, reason="Skipping test inside GitHub Actions environment")
302+
def test_layerwise_casting_inference(self):
303+
super().test_layerwise_casting_inference()

tests/pipelines/sana/test_sana_sprint_img2img.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
from diffusers import AutoencoderDC, SanaSprintImg2ImgPipeline, SanaTransformer2DModel, SCMScheduler
2323
from diffusers.utils.torch_utils import randn_tensor
2424

25-
from ...testing_utils import (
26-
enable_full_determinism,
27-
torch_device,
28-
)
25+
from ...testing_utils import IS_GITHUB_ACTIONS, enable_full_determinism, torch_device
2926
from ..pipeline_params import (
3027
IMAGE_TO_IMAGE_IMAGE_PARAMS,
3128
TEXT_GUIDED_IMAGE_VARIATION_BATCH_PARAMS,
@@ -312,3 +309,7 @@ def test_inference_batch_single_identical(self):
312309
def test_float16_inference(self):
313310
# Requires higher tolerance as model seems very sensitive to dtype
314311
super().test_float16_inference(expected_max_diff=0.08)
312+
313+
@unittest.skipIf(IS_GITHUB_ACTIONS, reason="Skipping test inside GitHub Actions environment")
314+
def test_layerwise_casting_inference(self):
315+
super().test_layerwise_casting_inference()

tests/testing_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
IS_CUDA_SYSTEM = False
6464
IS_XPU_SYSTEM = False
6565

66+
IS_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true" and os.getenv("DIFFUSERS_IS_CI") == "yes"
67+
6668
global_rng = random.Random()
6769

6870
logger = get_logger(__name__)

0 commit comments

Comments
 (0)