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
89177694
Unverified
Commit
89177694
authored
May 18, 2023
by
Will Berman
Committed by
GitHub
May 18, 2023
Browse files
attend and excite tests disable determinism on the class level (#3478)
parent
49b7ccfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
tests/pipelines/stable_diffusion_2/test_stable_diffusion_attend_and_excite.py
...le_diffusion_2/test_stable_diffusion_attend_and_excite.py
+26
-1
No files found.
tests/pipelines/stable_diffusion_2/test_stable_diffusion_attend_and_excite.py
View file @
89177694
...
...
@@ -34,7 +34,6 @@ from ..test_pipelines_common import PipelineLatentTesterMixin, PipelineTesterMix
torch
.
backends
.
cuda
.
matmul
.
allow_tf32
=
False
torch
.
use_deterministic_algorithms
(
False
)
@
skip_mps
...
...
@@ -47,6 +46,19 @@ class StableDiffusionAttendAndExcitePipelineFastTests(
batch_params
=
TEXT_TO_IMAGE_BATCH_PARAMS
.
union
({
"token_indices"
})
image_params
=
TEXT_TO_IMAGE_IMAGE_PARAMS
# Attend and excite requires being able to run a backward pass at
# inference time. There's no deterministic backward operator for pad
@
classmethod
def
setUpClass
(
cls
):
super
().
setUpClass
()
torch
.
use_deterministic_algorithms
(
False
)
@
classmethod
def
tearDownClass
(
cls
):
super
().
tearDownClass
()
torch
.
use_deterministic_algorithms
(
True
)
def
get_dummy_components
(
self
):
torch
.
manual_seed
(
0
)
unet
=
UNet2DConditionModel
(
...
...
@@ -171,6 +183,19 @@ class StableDiffusionAttendAndExcitePipelineFastTests(
@
require_torch_gpu
@
slow
class
StableDiffusionAttendAndExcitePipelineIntegrationTests
(
unittest
.
TestCase
):
# Attend and excite requires being able to run a backward pass at
# inference time. There's no deterministic backward operator for pad
@
classmethod
def
setUpClass
(
cls
):
super
().
setUpClass
()
torch
.
use_deterministic_algorithms
(
False
)
@
classmethod
def
tearDownClass
(
cls
):
super
().
tearDownClass
()
torch
.
use_deterministic_algorithms
(
True
)
def
tearDown
(
self
):
super
().
tearDown
()
gc
.
collect
()
...
...
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