Skip to content

Commit 8776967

Browse files
authored
Set seed in numeric tests to make them more reliable (#2924)
1 parent f35ae41 commit 8776967

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/prototype/test_dynamic_activation_lut.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def run_before_and_after_tests():
8383
@pytest.mark.parametrize("lead_dim", [(5,), (2, 3)])
8484
@pytest.mark.skipif(not is_arm64_mac, reason="requires arm64 mac")
8585
def test_parq_conversion(dtype, granularity, bit_width, lead_dim):
86+
torch.manual_seed(0)
8687
quantizer = StretchedUnifTorchaoQuantizer(bit_width)
8788
config = StretchedIntxWeightOnlyConfig(
8889
b=bit_width,
@@ -126,7 +127,7 @@ def test_parq_conversion(dtype, granularity, bit_width, lead_dim):
126127
if dtype == torch.float32:
127128
assert sqnr > 40.0, f"sqnr {sqnr} is too low"
128129
elif dtype == torch.bfloat16:
129-
assert sqnr > 15.0, f"sqnr {sqnr} is too low"
130+
assert sqnr > 25.0, f"sqnr {sqnr} is too low"
130131
else:
131132
raise ValueError(f"Unsupported dtype {dtype}")
132133

0 commit comments

Comments
 (0)