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
7 changes: 7 additions & 0 deletions tests/lora/test_lora_layers_cogvideox.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import unittest

import numpy as np
import pytest
import torch
from transformers import AutoTokenizer, T5EncoderModel

Expand All @@ -29,6 +30,7 @@
from diffusers.utils.testing_utils import (
floats_tensor,
is_peft_available,
is_torch_version,
require_peft_backend,
skip_mps,
torch_device,
Expand Down Expand Up @@ -126,6 +128,11 @@ def get_dummy_inputs(self, with_generator=True):
return noise, input_ids, pipeline_inputs

@skip_mps
@pytest.mark.xfail(
condtion=torch.device(torch_device).type == "cpu" and is_torch_version(">=", "2.5"),
reason="Test currently fails on CPU and PyTorch 2.5.1 but not on PyTorch 2.4.1.",
strict=True,
)
def test_lora_fuse_nan(self):
for scheduler_cls in self.scheduler_classes:
components, text_lora_config, denoiser_lora_config = self.get_dummy_components(scheduler_cls)
Expand Down
7 changes: 7 additions & 0 deletions tests/lora/test_lora_layers_mochi.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
import unittest

import numpy as np
import pytest
import torch
from transformers import AutoTokenizer, T5EncoderModel

from diffusers import AutoencoderKLMochi, FlowMatchEulerDiscreteScheduler, MochiPipeline, MochiTransformer3DModel
from diffusers.utils.testing_utils import (
floats_tensor,
is_peft_available,
is_torch_version,
require_peft_backend,
skip_mps,
torch_device,
Expand Down Expand Up @@ -105,6 +107,11 @@ def get_dummy_inputs(self, with_generator=True):

return noise, input_ids, pipeline_inputs

@pytest.mark.xfail(
condtion=torch.device(torch_device).type == "cpu" and is_torch_version(">=", "2.5"),
reason="Test currently fails on CPU and PyTorch 2.5.1 but not on PyTorch 2.4.1.",
strict=True,
)
def test_lora_fuse_nan(self):
for scheduler_cls in self.scheduler_classes:
components, text_lora_config, denoiser_lora_config = self.get_dummy_components(scheduler_cls)
Expand Down
7 changes: 7 additions & 0 deletions tests/lora/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from itertools import product

import numpy as np
import pytest
import torch

from diffusers import (
Expand All @@ -32,6 +33,7 @@
from diffusers.utils.testing_utils import (
CaptureLogger,
floats_tensor,
is_torch_version,
require_peft_backend,
require_peft_version_greater,
require_transformers_version_greater,
Expand Down Expand Up @@ -1510,6 +1512,11 @@ def test_simple_inference_with_text_denoiser_multi_adapter_weighted(self):
)

@skip_mps
@pytest.mark.xfail(
condtion=torch.device(torch_device).type == "cpu" and is_torch_version(">=", "2.5"),
reason="Test currently fails on CPU and PyTorch 2.5.1 but not on PyTorch 2.4.1.",
strict=True,
)
def test_lora_fuse_nan(self):
for scheduler_cls in self.scheduler_classes:
components, text_lora_config, denoiser_lora_config = self.get_dummy_components(scheduler_cls)
Expand Down
Loading