File tree 1 file changed +26
-1
lines changed
tests/pipelines/stable_diffusion_2
1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 34
34
35
35
36
36
torch .backends .cuda .matmul .allow_tf32 = False
37
- torch .use_deterministic_algorithms (False )
38
37
39
38
40
39
@skip_mps
@@ -47,6 +46,19 @@ class StableDiffusionAttendAndExcitePipelineFastTests(
47
46
batch_params = TEXT_TO_IMAGE_BATCH_PARAMS .union ({"token_indices" })
48
47
image_params = TEXT_TO_IMAGE_IMAGE_PARAMS
49
48
49
+ # Attend and excite requires being able to run a backward pass at
50
+ # inference time. There's no deterministic backward operator for pad
51
+
52
+ @classmethod
53
+ def setUpClass (cls ):
54
+ super ().setUpClass ()
55
+ torch .use_deterministic_algorithms (False )
56
+
57
+ @classmethod
58
+ def tearDownClass (cls ):
59
+ super ().tearDownClass ()
60
+ torch .use_deterministic_algorithms (True )
61
+
50
62
def get_dummy_components (self ):
51
63
torch .manual_seed (0 )
52
64
unet = UNet2DConditionModel (
@@ -171,6 +183,19 @@ def test_save_load_optional_components(self):
171
183
@require_torch_gpu
172
184
@slow
173
185
class StableDiffusionAttendAndExcitePipelineIntegrationTests (unittest .TestCase ):
186
+ # Attend and excite requires being able to run a backward pass at
187
+ # inference time. There's no deterministic backward operator for pad
188
+
189
+ @classmethod
190
+ def setUpClass (cls ):
191
+ super ().setUpClass ()
192
+ torch .use_deterministic_algorithms (False )
193
+
194
+ @classmethod
195
+ def tearDownClass (cls ):
196
+ super ().tearDownClass ()
197
+ torch .use_deterministic_algorithms (True )
198
+
174
199
def tearDown (self ):
175
200
super ().tearDown ()
176
201
gc .collect ()
You can’t perform that action at this time.
0 commit comments