Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/quantization/bnb/test_4bit.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@ class Base4bitTests(unittest.TestCase):

@classmethod
def setUpClass(cls):
torch.use_deterministic_algorithms(True)
cls.is_deterministic_enabled = torch.are_deterministic_algorithms_enabled()
if not cls.is_deterministic_enabled:
torch.use_deterministic_algorithms(True)

@classmethod
def tearDownClass(cls):
if not cls.is_deterministic_enabled:
torch.use_deterministic_algorithms(False)

def get_dummy_inputs(self):
prompt_embeds = load_pt(
Expand Down
9 changes: 8 additions & 1 deletion tests/quantization/bnb/test_mixed_int8.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ class Base8bitTests(unittest.TestCase):

@classmethod
def setUpClass(cls):
torch.use_deterministic_algorithms(True)
cls.is_deterministic_enabled = torch.are_deterministic_algorithms_enabled()
if not cls.is_deterministic_enabled:
torch.use_deterministic_algorithms(True)

@classmethod
def tearDownClass(cls):
if not cls.is_deterministic_enabled:
torch.use_deterministic_algorithms(False)

def get_dummy_inputs(self):
prompt_embeds = load_pt(
Expand Down