diff --git a/tests/quantization/bnb/test_4bit.py b/tests/quantization/bnb/test_4bit.py index acc6d30b793a..ac1b0cf3ce6b 100644 --- a/tests/quantization/bnb/test_4bit.py +++ b/tests/quantization/bnb/test_4bit.py @@ -476,6 +476,7 @@ def test_generate_quality_dequantize(self): r""" Test that loading the model and unquantize it produce correct results. """ + torch.use_deterministic_algorithms(True) self.pipeline_4bit.transformer.dequantize() output = self.pipeline_4bit( prompt=self.prompt, diff --git a/tests/quantization/bnb/test_mixed_int8.py b/tests/quantization/bnb/test_mixed_int8.py index 7abb907ff9cf..98575b86cdcc 100644 --- a/tests/quantization/bnb/test_mixed_int8.py +++ b/tests/quantization/bnb/test_mixed_int8.py @@ -478,6 +478,7 @@ def test_generate_quality_dequantize(self): r""" Test that loading the model and unquantize it produce correct results. """ + torch.use_deterministic_algorithms(True) self.pipeline_8bit.transformer.dequantize() output = self.pipeline_8bit( prompt=self.prompt,