Unverified Commit 6cbd7b8b authored by Patrick von Platen's avatar Patrick von Platen Committed by GitHub
Browse files

[Tests] Remove unnecessary tests (#2337)

parent bc0cee9d
...@@ -265,10 +265,6 @@ class StableDiffusionDepth2ImgPipelineFastTests(PipelineTesterMixin, unittest.Te ...@@ -265,10 +265,6 @@ class StableDiffusionDepth2ImgPipelineFastTests(PipelineTesterMixin, unittest.Te
max_diff = np.abs(output - output_tuple).max() max_diff = np.abs(output - output_tuple).max()
self.assertLess(max_diff, 1e-4) self.assertLess(max_diff, 1e-4)
@unittest.skipIf(torch_device == "mps", reason="The depth model does not support MPS yet")
def test_num_inference_steps_consistent(self):
super().test_num_inference_steps_consistent()
@unittest.skipIf(torch_device == "mps", reason="The depth model does not support MPS yet") @unittest.skipIf(torch_device == "mps", reason="The depth model does not support MPS yet")
def test_progress_bar(self): def test_progress_bar(self):
super().test_progress_bar() super().test_progress_bar()
......
...@@ -4,7 +4,6 @@ import inspect ...@@ -4,7 +4,6 @@ import inspect
import io import io
import re import re
import tempfile import tempfile
import time
import unittest import unittest
from typing import Callable, Union from typing import Callable, Union
...@@ -294,36 +293,6 @@ class PipelineTesterMixin: ...@@ -294,36 +293,6 @@ class PipelineTesterMixin:
max_diff = np.abs(output - output_tuple).max() max_diff = np.abs(output - output_tuple).max()
self.assertLess(max_diff, 1e-4) self.assertLess(max_diff, 1e-4)
def test_num_inference_steps_consistent(self):
components = self.get_dummy_components()
pipe = self.pipeline_class(**components)
pipe.to(torch_device)
pipe.set_progress_bar_config(disable=None)
# Warmup pass when using mps (see #372)
if torch_device == "mps":
_ = pipe(**self.get_dummy_inputs(torch_device))
outputs = []
times = []
for num_steps in [9, 6, 3]:
inputs = self.get_dummy_inputs(torch_device)
for arg in self.num_inference_steps_args:
inputs[arg] = num_steps
start_time = time.time()
output = pipe(**inputs)[0]
inference_time = time.time() - start_time
outputs.append(output)
times.append(inference_time)
# check that all outputs have the same shape
self.assertTrue(all(outputs[0].shape == output.shape for output in outputs))
# check that the inference time increases with the number of inference steps
self.assertTrue(all(times[i] < times[i - 1] for i in range(1, len(times))))
def test_components_function(self): def test_components_function(self):
init_components = self.get_dummy_components() init_components = self.get_dummy_components()
pipe = self.pipeline_class(**init_components) pipe = self.pipeline_class(**init_components)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment