MCPcopy Create free account
hub / github.com/ml-explore/mlx / ulp_bf16_at

Function ulp_bf16_at

examples/python/qqmm.py:14–19  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

12# therefore I suspect that the discrepancy comes from
13# the mxfp8 matmul implementation in cuBLASLt..
14def ulp_bf16_at(x):
15 ax = mx.abs(x)
16 min_normal = mx.array(2.0**-126)
17 ax = mx.where(ax < min_normal, min_normal, ax)
18 e = mx.floor(mx.log2(ax))
19 return mx.power(2.0, e - 7.0)
20
21
22def test_qqmm():

Callers 2

test_qqmmFunction · 0.85
test_qqmm_vjpFunction · 0.85

Calls 1

arrayMethod · 0.60

Tested by 2

test_qqmmFunction · 0.68
test_qqmm_vjpFunction · 0.68