Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from diffusers.utils.import_utils import is_xformers_available
from diffusers.utils.testing_utils import (
CaptureLogger,
disable_full_determinism,
enable_full_determinism,
floats_tensor,
numpy_cosine_similarity_distance,
Expand All @@ -34,6 +33,9 @@
from ..test_pipelines_common import PipelineTesterMixin


enable_full_determinism()


def to_np(tensor):
if isinstance(tensor, torch.Tensor):
tensor = tensor.detach().cpu().numpy()
Expand Down Expand Up @@ -465,8 +467,6 @@ def test_model_cpu_offload_forward_pass(self, expected_max_diff=2e-4):
reason="XFormers attention is only available with CUDA and `xformers` installed",
)
def test_xformers_attention_forwardGenerator_pass(self):
disable_full_determinism()

expected_max_diff = 9e-4

if not self.test_xformers_attention:
Expand Down Expand Up @@ -496,8 +496,6 @@ def test_xformers_attention_forwardGenerator_pass(self):
max_diff = np.abs(to_np(output_with_offload) - to_np(output_without_offload)).max()
self.assertLess(max_diff, expected_max_diff, "XFormers attention should not affect the inference results")

enable_full_determinism()


@slow
@require_torch_gpu
Expand Down