1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

use deterministic to get stable result (#11663)

* use deterministic to get stable result

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>

* add deterministic for int8 test

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>

---------

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
This commit is contained in:
jiqing-feng
2025-06-06 11:44:00 +08:00
committed by GitHub
parent 745199a869
commit 0f91f2f6fc
2 changed files with 2 additions and 0 deletions

View File

@@ -476,6 +476,7 @@ class SlowBnb4BitTests(Base4bitTests):
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,

View File

@@ -478,6 +478,7 @@ class SlowBnb8bitTests(Base8bitTests):
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,