mirror of
https://github.com/ml-explore/mlx.git
synced 2025-07-15 04:51:13 +08:00
Fix tolerance in de-/quantization test (#295)
This commit is contained in:
parent
fc4e5b476b
commit
447bc089b9
@ -13,7 +13,8 @@ class TestQuantized(mlx_tests.MLXTestCase):
|
|||||||
w_q, scales, biases = mx.quantize(w, 64, b)
|
w_q, scales, biases = mx.quantize(w, 64, b)
|
||||||
w_hat = mx.dequantize(w_q, scales, biases, 64, b)
|
w_hat = mx.dequantize(w_q, scales, biases, 64, b)
|
||||||
errors = (w - w_hat).abs().reshape(*scales.shape, -1)
|
errors = (w - w_hat).abs().reshape(*scales.shape, -1)
|
||||||
self.assertTrue((errors <= scales[..., None] / 2).all())
|
eps = 1e-6
|
||||||
|
self.assertTrue((errors <= (scales[..., None] / 2 + eps)).all())
|
||||||
|
|
||||||
def test_qmm(self):
|
def test_qmm(self):
|
||||||
key = mx.random.key(0)
|
key = mx.random.key(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user