Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
33293ed5
Unverified
Commit
33293ed5
authored
Oct 23, 2023
by
Dhruv Nair
Committed by
GitHub
Oct 23, 2023
Browse files
Fix Slow Tests (#5469)
fix tests
parent
48ce118d
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
329 additions
and
110 deletions
+329
-110
docker/diffusers-pytorch-cuda/Dockerfile
docker/diffusers-pytorch-cuda/Dockerfile
+2
-1
tests/pipelines/kandinsky/test_kandinsky_combined.py
tests/pipelines/kandinsky/test_kandinsky_combined.py
+1
-1
tests/pipelines/stable_diffusion/test_stable_diffusion.py
tests/pipelines/stable_diffusion/test_stable_diffusion.py
+2
-2
tests/pipelines/stable_diffusion/test_stable_diffusion_adapter.py
...pelines/stable_diffusion/test_stable_diffusion_adapter.py
+322
-104
tests/pipelines/stable_diffusion_2/test_stable_diffusion_v_pred.py
...elines/stable_diffusion_2/test_stable_diffusion_v_pred.py
+2
-2
No files found.
docker/diffusers-pytorch-cuda/Dockerfile
View file @
33293ed5
...
...
@@ -40,6 +40,7 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip && \
scipy
\
tensorboard
\
transformers
\
omegaconf
omegaconf
\
pytorch-lightning
CMD
["/bin/bash"]
tests/pipelines/kandinsky/test_kandinsky_combined.py
View file @
33293ed5
...
...
@@ -134,7 +134,7 @@ class KandinskyPipelineCombinedFastTests(PipelineTesterMixin, unittest.TestCase)
super
().
test_inference_batch_single_identical
(
expected_max_diff
=
1e-2
)
def
test_float16_inference
(
self
):
super
().
test_float16_inference
(
expected_max_diff
=
1
e-1
)
super
().
test_float16_inference
(
expected_max_diff
=
2
e-1
)
def
test_dict_tuple_outputs_equivalent
(
self
):
super
().
test_dict_tuple_outputs_equivalent
(
expected_max_difference
=
5e-4
)
...
...
tests/pipelines/stable_diffusion/test_stable_diffusion.py
View file @
33293ed5
...
...
@@ -641,7 +641,7 @@ class StableDiffusionPipelineSlowTests(unittest.TestCase):
image_slice
=
image
[
0
,
-
3
:,
-
3
:,
-
1
].
flatten
()
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
expected_slice
=
np
.
array
([
0.
3149
,
0.5246
,
0.4
796
,
0.3
218
,
0.4
469
,
0.
4729
,
0.5151
,
0.3597
,
0.3954
])
expected_slice
=
np
.
array
([
0.
4363
,
0.4
355
,
0.3
667
,
0.4
066
,
0.
3970
,
0.3866
,
0.4394
,
0.4356
,
0.4059
])
assert
np
.
abs
(
image_slice
-
expected_slice
).
max
()
<
3e-3
def
test_stable_diffusion_v1_4_with_freeu
(
self
):
...
...
@@ -668,7 +668,7 @@ class StableDiffusionPipelineSlowTests(unittest.TestCase):
image_slice
=
image
[
0
,
-
3
:,
-
3
:,
-
1
].
flatten
()
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
expected_slice
=
np
.
array
([
0.
3458
,
0.512
0
,
0.4
800
,
0.31
1
6
,
0.
434
8
,
0.
4802
,
0.5
237
,
0.
3467
,
0.3991
])
expected_slice
=
np
.
array
([
0.
574
0
,
0.4
784
,
0.316
2
,
0.
635
8
,
0.
5831
,
0.5505
,
0.5
082
,
0.
5631
,
0.5575
])
assert
np
.
abs
(
image_slice
-
expected_slice
).
max
()
<
3e-3
def
test_stable_diffusion_ddim
(
self
):
...
...
tests/pipelines/stable_diffusion/test_stable_diffusion_adapter.py
View file @
33293ed5
This diff is collapsed.
Click to expand it.
tests/pipelines/stable_diffusion_2/test_stable_diffusion_v_pred.py
View file @
33293ed5
...
...
@@ -367,9 +367,9 @@ class StableDiffusion2VPredictionPipelineIntegrationTests(unittest.TestCase):
output
=
pipe
([
prompt
],
generator
=
generator
,
guidance_scale
=
7.5
,
num_inference_steps
=
10
,
output_type
=
"numpy"
)
image
=
output
.
images
# make sure that more than
5.5
GB is allocated
# make sure that more than
3.0
GB is allocated
mem_bytes
=
torch
.
cuda
.
max_memory_allocated
()
assert
mem_bytes
>
5.5
*
10
**
9
assert
mem_bytes
>
3
*
10
**
9
max_diff
=
numpy_cosine_similarity_distance
(
image
.
flatten
(),
image_chunked
.
flatten
())
assert
max_diff
<
1e-3
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment