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
OpenDAS
diffusers
Commits
431dd2f4
Unverified
Commit
431dd2f4
authored
Sep 19, 2023
by
Dhruv Nair
Committed by
GitHub
Sep 19, 2023
Browse files
Fix precision related issues in Kandinsky Pipelines (#5098)
* fix failing tests * make style
parent
edcbb6f4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
0 deletions
+39
-0
tests/pipelines/kandinsky/test_kandinsky_combined.py
tests/pipelines/kandinsky/test_kandinsky_combined.py
+9
-0
tests/pipelines/kandinsky/test_kandinsky_img2img.py
tests/pipelines/kandinsky/test_kandinsky_img2img.py
+3
-0
tests/pipelines/kandinsky_v22/test_kandinsky_combined.py
tests/pipelines/kandinsky_v22/test_kandinsky_combined.py
+18
-0
tests/pipelines/kandinsky_v22/test_kandinsky_inpaint.py
tests/pipelines/kandinsky_v22/test_kandinsky_inpaint.py
+9
-0
No files found.
tests/pipelines/kandinsky/test_kandinsky_combined.py
View file @
431dd2f4
...
...
@@ -133,6 +133,9 @@ class KandinskyPipelineCombinedFastTests(PipelineTesterMixin, unittest.TestCase)
def
test_inference_batch_single_identical
(
self
):
super
().
test_inference_batch_single_identical
(
expected_max_diff
=
1e-2
)
def
test_dict_tuple_outputs_equivalent
(
self
):
super
().
test_dict_tuple_outputs_equivalent
(
expected_max_difference
=
5e-4
)
class
KandinskyPipelineImg2ImgCombinedFastTests
(
PipelineTesterMixin
,
unittest
.
TestCase
):
pipeline_class
=
KandinskyImg2ImgCombinedPipeline
...
...
@@ -233,6 +236,9 @@ class KandinskyPipelineImg2ImgCombinedFastTests(PipelineTesterMixin, unittest.Te
def
test_inference_batch_single_identical
(
self
):
super
().
test_inference_batch_single_identical
(
expected_max_diff
=
1e-2
)
def
test_dict_tuple_outputs_equivalent
(
self
):
super
().
test_dict_tuple_outputs_equivalent
(
expected_max_difference
=
5e-4
)
class
KandinskyPipelineInpaintCombinedFastTests
(
PipelineTesterMixin
,
unittest
.
TestCase
):
pipeline_class
=
KandinskyInpaintCombinedPipeline
...
...
@@ -332,3 +338,6 @@ class KandinskyPipelineInpaintCombinedFastTests(PipelineTesterMixin, unittest.Te
def
test_inference_batch_single_identical
(
self
):
super
().
test_inference_batch_single_identical
(
expected_max_diff
=
1e-2
)
def
test_dict_tuple_outputs_equivalent
(
self
):
super
().
test_dict_tuple_outputs_equivalent
(
expected_max_difference
=
5e-4
)
tests/pipelines/kandinsky/test_kandinsky_img2img.py
View file @
431dd2f4
...
...
@@ -292,6 +292,9 @@ class KandinskyImg2ImgPipelineFastTests(PipelineTesterMixin, unittest.TestCase):
assert
np
.
abs
(
image_slices
[
0
]
-
image_slices
[
1
]).
max
()
<
1e-3
assert
np
.
abs
(
image_slices
[
0
]
-
image_slices
[
2
]).
max
()
<
1e-3
def
test_dict_tuple_outputs_equivalent
(
self
):
super
().
test_dict_tuple_outputs_equivalent
(
expected_max_difference
=
5e-4
)
@
slow
@
require_torch_gpu
...
...
tests/pipelines/kandinsky_v22/test_kandinsky_combined.py
View file @
431dd2f4
...
...
@@ -137,6 +137,12 @@ class KandinskyV22PipelineCombinedFastTests(PipelineTesterMixin, unittest.TestCa
def
test_inference_batch_single_identical
(
self
):
super
().
test_inference_batch_single_identical
(
expected_max_diff
=
1e-2
)
def
test_dict_tuple_outputs_equivalent
(
self
):
super
().
test_dict_tuple_outputs_equivalent
(
expected_max_difference
=
5e-4
)
def
test_model_cpu_offload_forward_pass
(
self
):
super
().
test_model_cpu_offload_forward_pass
(
expected_max_diff
=
5e-4
)
class
KandinskyV22PipelineImg2ImgCombinedFastTests
(
PipelineTesterMixin
,
unittest
.
TestCase
):
pipeline_class
=
KandinskyV22Img2ImgCombinedPipeline
...
...
@@ -237,6 +243,12 @@ class KandinskyV22PipelineImg2ImgCombinedFastTests(PipelineTesterMixin, unittest
def
test_inference_batch_single_identical
(
self
):
super
().
test_inference_batch_single_identical
(
expected_max_diff
=
1e-2
)
def
test_dict_tuple_outputs_equivalent
(
self
):
super
().
test_dict_tuple_outputs_equivalent
(
expected_max_difference
=
5e-4
)
def
test_model_cpu_offload_forward_pass
(
self
):
super
().
test_model_cpu_offload_forward_pass
(
expected_max_diff
=
5e-4
)
class
KandinskyV22PipelineInpaintCombinedFastTests
(
PipelineTesterMixin
,
unittest
.
TestCase
):
pipeline_class
=
KandinskyV22InpaintCombinedPipeline
...
...
@@ -336,3 +348,9 @@ class KandinskyV22PipelineInpaintCombinedFastTests(PipelineTesterMixin, unittest
def
test_inference_batch_single_identical
(
self
):
super
().
test_inference_batch_single_identical
(
expected_max_diff
=
1e-2
)
def
test_dict_tuple_outputs_equivalent
(
self
):
super
().
test_dict_tuple_outputs_equivalent
(
expected_max_difference
=
5e-4
)
def
test_model_cpu_offload_forward_pass
(
self
):
super
().
test_model_cpu_offload_forward_pass
(
expected_max_diff
=
5e-4
)
tests/pipelines/kandinsky_v22/test_kandinsky_inpaint.py
View file @
431dd2f4
...
...
@@ -240,6 +240,15 @@ class KandinskyV22InpaintPipelineFastTests(PipelineTesterMixin, unittest.TestCas
def
test_inference_batch_single_identical
(
self
):
super
().
test_inference_batch_single_identical
(
expected_max_diff
=
3e-3
)
def
test_model_cpu_offload_forward_pass
(
self
):
super
().
test_inference_batch_single_identical
(
expected_max_diff
=
5e-4
)
def
test_save_load_optional_components
(
self
):
super
().
test_save_load_optional_components
(
expected_max_difference
=
5e-4
)
def
test_sequential_cpu_offload_forward_pass
(
self
):
super
().
test_sequential_cpu_offload_forward_pass
(
expected_max_diff
=
5e-4
)
@
slow
@
require_torch_gpu
...
...
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