Skip to content

Commit a0a0f26

Browse files
committed
fix 8bit test
Signed-off-by: jiqing-feng <[email protected]>
1 parent ead9779 commit a0a0f26

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/quantization/bnb/test_mixed_int8.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ class Base8bitTests(unittest.TestCase):
9797
num_inference_steps = 10
9898
seed = 0
9999

100+
@classmethod
101+
def setUpClass(cls):
102+
torch.use_deterministic_algorithms(True)
103+
100104
def get_dummy_inputs(self):
101105
prompt_embeds = load_pt(
102106
"https://huggingface.co/datasets/hf-internal-testing/bnb-diffusers-testing-artifacts/resolve/main/prompt_embeds.pt",
@@ -485,7 +489,6 @@ def test_generate_quality_dequantize(self):
485489
r"""
486490
Test that loading the model and unquantize it produce correct results.
487491
"""
488-
torch.use_deterministic_algorithms(True)
489492
self.pipeline_8bit.transformer.dequantize()
490493
output = self.pipeline_8bit(
491494
prompt=self.prompt,

0 commit comments

Comments
 (0)