File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,14 @@ class Base4bitTests(unittest.TestCase):
9898
9999 @classmethod
100100 def setUpClass (cls ):
101- torch .use_deterministic_algorithms (True )
101+ cls .is_deterministic_enabled = torch .are_deterministic_algorithms_enabled ()
102+ if not cls .is_deterministic_enabled :
103+ torch .use_deterministic_algorithms (True )
104+
105+ @classmethod
106+ def tearDownClass (cls ):
107+ if not cls .is_deterministic_enabled :
108+ torch .use_deterministic_algorithms (False )
102109
103110 def get_dummy_inputs (self ):
104111 prompt_embeds = load_pt (
Original file line number Diff line number Diff line change @@ -99,7 +99,14 @@ class Base8bitTests(unittest.TestCase):
9999
100100 @classmethod
101101 def setUpClass (cls ):
102- torch .use_deterministic_algorithms (True )
102+ cls .is_deterministic_enabled = torch .are_deterministic_algorithms_enabled ()
103+ if not cls .is_deterministic_enabled :
104+ torch .use_deterministic_algorithms (True )
105+
106+ @classmethod
107+ def tearDownClass (cls ):
108+ if not cls .is_deterministic_enabled :
109+ torch .use_deterministic_algorithms (False )
103110
104111 def get_dummy_inputs (self ):
105112 prompt_embeds = load_pt (
You can’t perform that action at this time.
0 commit comments