Skip to content

Commit b316088

Browse files
jiqing-fengefraimdahl
authored andcommitted
TST Increase tolerance in some tests for xpu (huggingface#2475)
Numerical stability is lower, increase tolerances.
1 parent ff0e09e commit b316088

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_gpu_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2199,8 +2199,8 @@ class TestLoftQ:
21992199
# The error factor indicates by how much the quantization error should be decreased when using LoftQ compared to
22002200
# quantization without LoftQ. Thus 1.03 means that the error should be decreased by 3% at least. This is a very
22012201
# conservative value to prevent flakiness, in practice most gains are > 1.5
2202-
error_factor = 1.03
22032202
device = infer_device()
2203+
error_factor = 1.005 if device in ("xpu", "cpu") else 1.03
22042204

22052205
def get_input(self, model_id, device):
22062206
tokenizer = AutoTokenizer.from_pretrained(model_id)

0 commit comments

Comments
 (0)