File tree Expand file tree Collapse file tree 1 file changed +0
-12
lines changed
Expand file tree Collapse file tree 1 file changed +0
-12
lines changed Original file line number Diff line number Diff line change 1515
1616import gc
1717import math
18- import os
1918import tracemalloc
2019import 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):
You can’t perform that action at this time.
0 commit comments