Skip to content

Commit

Permalink
remove inference calls from loading tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Oct 7, 2024
1 parent 65a366c commit 7789a7f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions tests/onnxruntime/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ def test_load_stable_diffusion_model_from_hub(self):
self.assertIsInstance(model.vae_encoder, ORTModelVaeEncoder)
self.assertIsInstance(model.unet, ORTModelUnet)
self.assertIsInstance(model.config, Dict)
model(prompt="cat", num_inference_steps=2)

@require_diffusers
@require_torch_gpu
Expand All @@ -333,7 +332,6 @@ def test_load_stable_diffusion_model_cuda_provider(self):
self.assertListEqual(model.vae_decoder.session.get_providers(), model.providers)
self.assertListEqual(model.vae_encoder.session.get_providers(), model.providers)
self.assertEqual(model.device, torch.device("cuda:0"))
model(prompt="cat", num_inference_steps=2)

@require_diffusers
@require_torch_gpu
Expand All @@ -349,7 +347,6 @@ def test_load_stable_diffusion_model_rocm_provider(self):
self.assertListEqual(model.vae_decoder.session.get_providers(), model.providers)
self.assertListEqual(model.vae_encoder.session.get_providers(), model.providers)
self.assertEqual(model.device, torch.device("cuda:0"))
model(prompt="cat", num_inference_steps=2)

@require_diffusers
def test_load_stable_diffusion_model_cpu_provider(self):
Expand All @@ -362,7 +359,6 @@ def test_load_stable_diffusion_model_cpu_provider(self):
self.assertListEqual(model.vae_decoder.session.get_providers(), model.providers)
self.assertListEqual(model.vae_encoder.session.get_providers(), model.providers)
self.assertEqual(model.device, torch.device("cpu"))
model(prompt="cat", num_inference_steps=2)

@require_diffusers
def test_load_stable_diffusion_model_unknown_provider(self):
Expand Down Expand Up @@ -846,7 +842,6 @@ def test_stable_diffusion_model_on_cpu(self):
self.assertEqual(model.vae_decoder.session.get_providers()[0], "CPUExecutionProvider")
self.assertEqual(model.vae_encoder.session.get_providers()[0], "CPUExecutionProvider")
self.assertListEqual(model.providers, ["CPUExecutionProvider"])
model(prompt="cat", num_inference_steps=2)

@require_diffusers
def test_stable_diffusion_model_on_cpu_str(self):
Expand All @@ -863,7 +858,6 @@ def test_stable_diffusion_model_on_cpu_str(self):
self.assertEqual(model.vae_decoder.session.get_providers()[0], "CPUExecutionProvider")
self.assertEqual(model.vae_encoder.session.get_providers()[0], "CPUExecutionProvider")
self.assertListEqual(model.providers, ["CPUExecutionProvider"])
model(prompt="cat", num_inference_steps=2)

@require_diffusers
@require_torch_gpu
Expand All @@ -882,7 +876,6 @@ def test_stable_diffusion_model_on_gpu(self):
self.assertEqual(model.vae_decoder.session.get_providers()[0], "CUDAExecutionProvider")
self.assertEqual(model.vae_encoder.session.get_providers()[0], "CUDAExecutionProvider")
self.assertListEqual(model.providers, ["CUDAExecutionProvider", "CPUExecutionProvider"])
model(prompt="cat", num_inference_steps=2)

@require_diffusers
@require_torch_gpu
Expand All @@ -902,7 +895,6 @@ def test_stable_diffusion_model_on_rocm_ep(self):
self.assertEqual(model.vae_decoder.session.get_providers()[0], "ROCMExecutionProvider")
self.assertEqual(model.vae_encoder.session.get_providers()[0], "ROCMExecutionProvider")
self.assertListEqual(model.providers, ["ROCMExecutionProvider", "CPUExecutionProvider"])
model(prompt="cat", num_inference_steps=2)

@require_diffusers
@unittest.skipIf(get_gpu_count() <= 1, "this test requires multi-gpu")
Expand Down

0 comments on commit 7789a7f

Please sign in to comment.