Skip to content

Commit 17ec4b5

Browse files
committed
tests
1 parent be49c79 commit 17ec4b5

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

tests/lora/test_lora_layers_cogvideox.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from diffusers.utils.testing_utils import (
3131
floats_tensor,
3232
is_peft_available,
33+
is_torch_version,
3334
require_peft_backend,
3435
skip_mps,
3536
torch_device,
@@ -128,7 +129,7 @@ def get_dummy_inputs(self, with_generator=True):
128129

129130
@skip_mps
130131
@pytest.mark.xfail(
131-
condtion=torch.device(torch_device).type == "cpu",
132+
condtion=torch.device(torch_device).type == "cpu" and is_torch_version(">=", "2.5"),
132133
reason="Test currently fails on CPU and PyTorch 2.5.1 but not on PyTorch 2.4.1.",
133134
strict=True,
134135
)

tests/lora/test_lora_layers_mochi.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
import unittest
1717

1818
import numpy as np
19+
import pytest
1920
import torch
2021
from transformers import AutoTokenizer, T5EncoderModel
2122

2223
from diffusers import AutoencoderKLMochi, FlowMatchEulerDiscreteScheduler, MochiPipeline, MochiTransformer3DModel
2324
from diffusers.utils.testing_utils import (
2425
floats_tensor,
2526
is_peft_available,
27+
is_torch_version,
2628
require_peft_backend,
2729
skip_mps,
2830
torch_device,
@@ -105,6 +107,11 @@ def get_dummy_inputs(self, with_generator=True):
105107

106108
return noise, input_ids, pipeline_inputs
107109

110+
@pytest.mark.xfail(
111+
condtion=torch.device(torch_device).type == "cpu" and is_torch_version(">=", "2.5"),
112+
reason="Test currently fails on CPU and PyTorch 2.5.1 but not on PyTorch 2.4.1.",
113+
strict=True,
114+
)
108115
def test_lora_fuse_nan(self):
109116
for scheduler_cls in self.scheduler_classes:
110117
components, text_lora_config, denoiser_lora_config = self.get_dummy_components(scheduler_cls)

tests/lora/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from diffusers.utils.testing_utils import (
3434
CaptureLogger,
3535
floats_tensor,
36+
is_torch_version,
3637
require_peft_backend,
3738
require_peft_version_greater,
3839
require_transformers_version_greater,
@@ -1512,7 +1513,7 @@ def test_simple_inference_with_text_denoiser_multi_adapter_weighted(self):
15121513

15131514
@skip_mps
15141515
@pytest.mark.xfail(
1515-
condtion=torch.device(torch_device).type == "cpu",
1516+
condtion=torch.device(torch_device).type == "cpu" and is_torch_version(">=", "2.5"),
15161517
reason="Test currently fails on CPU and PyTorch 2.5.1 but not on PyTorch 2.4.1.",
15171518
strict=True,
15181519
)

0 commit comments

Comments
 (0)