Skip to content

Commit 6613a8c

Browse files
make CI happy
1 parent d9c449e commit 6613a8c

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

tests/test_models_unet.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import gc
1717
import math
18-
import os
1918
import tracemalloc
2019
import unittest
2120

@@ -270,13 +269,6 @@ def prepare_init_args_and_inputs_for_common(self):
270269

271270
def test_gradient_checkpointing(self):
272271
# enable deterministic behavior for gradient checkpointing
273-
torch.use_deterministic_algorithms(True)
274-
275-
# from torch docs: "A handful of CUDA operations are nondeterministic if the CUDA version is 10.2 or greater,
276-
# unless the environment variable CUBLAS_WORKSPACE_CONFIG=:4096:8 or CUBLAS_WORKSPACE_CONFIG=:16:8 is set."
277-
# https://pytorch.org/docs/stable/generated/torch.use_deterministic_algorithms.html
278-
os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":16:8"
279-
280272
init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_common()
281273
model = self.model_class(**init_dict)
282274
model.to(torch_device)
@@ -313,10 +305,6 @@ def test_gradient_checkpointing(self):
313305
for name in grad_checkpointed:
314306
self.assertTrue(torch.allclose(grad_checkpointed[name], grad_not_checkpointed[name], atol=5e-5))
315307

316-
# disable deterministic behavior for gradient checkpointing
317-
del os.environ["CUBLAS_WORKSPACE_CONFIG"]
318-
torch.use_deterministic_algorithms(False)
319-
320308

321309
# TODO(Patrick) - Re-add this test after having cleaned up LDM
322310
# def test_output_pretrained_spatial_transformer(self):

0 commit comments

Comments
 (0)