Skip to content
Open
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
10 changes: 10 additions & 0 deletions tests/lora/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2105,6 +2105,11 @@ def test_correct_lora_configs_with_different_ranks(self):
self.assertTrue(not np.allclose(original_output, lora_output_diff_alpha, atol=1e-3, rtol=1e-3))
self.assertTrue(not np.allclose(lora_output_diff_alpha, lora_output_same_rank, atol=1e-3, rtol=1e-3))

@pytest.mark.xfail(
condition=torch_device == "mps",
reason="MPS does not support float8 casting.",
strict=True,
)
def test_layerwise_casting_inference_denoiser(self):
from diffusers.hooks._common import _GO_LC_SUPPORTED_PYTORCH_LAYERS
from diffusers.hooks.layerwise_casting import DEFAULT_SKIP_MODULES_PATTERN
Expand Down Expand Up @@ -2149,6 +2154,11 @@ def initialize_pipeline(storage_dtype=None, compute_dtype=torch.float32):
pipe_float8_e4m3_bf16 = initialize_pipeline(storage_dtype=torch.float8_e4m3fn, compute_dtype=torch.bfloat16)
pipe_float8_e4m3_bf16(**inputs, generator=torch.manual_seed(0))[0]

@pytest.mark.xfail(
condition=torch_device == "mps",
reason="MPS does not support float8 casting.",
strict=True,
)
@require_peft_version_greater("0.14.0")
def test_layerwise_casting_peft_input_autocast_denoiser(self):
r"""
Expand Down
10 changes: 10 additions & 0 deletions tests/models/testing_utils/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ class LayerwiseCastingTesterMixin:
- get_dummy_inputs(): Returns dict of inputs to pass to the model forward pass
"""

@pytest.mark.xfail(
condition=torch_device == "mps",
reason="MPS does not support float8 casting.",
strict=True,
)
@torch.no_grad()
def test_layerwise_casting_memory(self):
MB_TOLERANCE = 0.2
Expand Down Expand Up @@ -436,6 +441,11 @@ def get_memory_usage(storage_dtype, compute_dtype):
or abs(fp8_e4m3_fp32_max_memory - fp32_max_memory) < MB_TOLERANCE
), "Peak memory should be lower or within tolerance with fp8 storage"

@pytest.mark.xfail(
condition=torch_device == "mps",
reason="MPS does not support float8 casting.",
strict=True,
)
def test_layerwise_casting_training(self):
def test_fn(storage_dtype, compute_dtype):
if torch.device(torch_device).type == "cpu" and compute_dtype == torch.bfloat16:
Expand Down
5 changes: 5 additions & 0 deletions tests/pipelines/test_pipelines_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2292,6 +2292,11 @@ def test_save_load_dduf(self, atol=1e-4, rtol=1e-4):
elif isinstance(pipeline_out, torch.Tensor) and isinstance(loaded_pipeline_out, torch.Tensor):
assert torch.allclose(pipeline_out, loaded_pipeline_out, atol=atol, rtol=rtol)

@pytest.mark.xfail(
condition=torch_device == "mps",
reason="MPS does not support float8 casting.",
strict=True,
)
def test_layerwise_casting_inference(self):
if not self.test_layerwise_casting:
return
Expand Down
Loading