Skip to content

Commit 288b0cc

Browse files
committed
use xfail
1 parent d255604 commit 288b0cc

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

tests/lora/test_lora_layers_cogvideox.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import unittest
1717

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

@@ -29,7 +30,6 @@
2930
from diffusers.utils.testing_utils import (
3031
floats_tensor,
3132
is_peft_available,
32-
is_torch_version,
3333
require_peft_backend,
3434
skip_mps,
3535
torch_device,
@@ -127,10 +127,7 @@ def get_dummy_inputs(self, with_generator=True):
127127
return noise, input_ids, pipeline_inputs
128128

129129
@skip_mps
130-
@unittest.skipIf(
131-
torch.device(torch_device).type == "cpu" and is_torch_version(">=", "2.5"),
132-
"Test not supported on PyTorch 2.5 and CPU.",
133-
)
130+
@pytest.mark.xfail("Test currently fails on CPU and PyTorch 2.5.1 but not on PyTorch 2.4.1.", strict=True)
134131
def test_lora_fuse_nan(self):
135132
for scheduler_cls in self.scheduler_classes:
136133
components, text_lora_config, denoiser_lora_config = self.get_dummy_components(scheduler_cls)

tests/lora/utils.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from itertools import product
2020

2121
import numpy as np
22+
import pytest
2223
import torch
2324

2425
from diffusers import (
@@ -32,7 +33,6 @@
3233
from diffusers.utils.testing_utils import (
3334
CaptureLogger,
3435
floats_tensor,
35-
is_torch_version,
3636
require_peft_backend,
3737
require_peft_version_greater,
3838
require_transformers_version_greater,
@@ -1511,10 +1511,7 @@ def test_simple_inference_with_text_denoiser_multi_adapter_weighted(self):
15111511
)
15121512

15131513
@skip_mps
1514-
@unittest.skipIf(
1515-
torch.device(torch_device).type == "cpu" and is_torch_version(">=", "2.5"),
1516-
"Test not supported on PyTorch 2.5 and CPU.",
1517-
)
1514+
@pytest.mark.xfail("Test currently fails on CPU and PyTorch 2.5.1 but not on PyTorch 2.4.1.", strict=True)
15181515
def test_lora_fuse_nan(self):
15191516
for scheduler_cls in self.scheduler_classes:
15201517
components, text_lora_config, denoiser_lora_config = self.get_dummy_components(scheduler_cls)

0 commit comments

Comments
 (0)