Commit 140cdbe8 authored by justheuristic's avatar justheuristic
Browse files

check dtypes first

parent a9c7953e
...@@ -354,7 +354,7 @@ def test_matmullt( ...@@ -354,7 +354,7 @@ def test_matmullt(
state.SCB, state.SCB,
SCBt, SCBt,
coo_tensorB, coo_tensorB,
) = bnb.functional.double_quant(B2.half()) ) = bnb.functional.double_quant(B2.to(torch.float16))
B2 = state.CB B2 = state.CB
if not transpose[0] and transpose[1]: if not transpose[0] and transpose[1]:
...@@ -367,6 +367,8 @@ def test_matmullt( ...@@ -367,6 +367,8 @@ def test_matmullt(
if has_bias: if has_bias:
out_torch += bias out_torch += bias
assert out_bnb.dtype == torch.dtype
n = out_bnb.numel() n = out_bnb.numel()
err = torch.abs(out_bnb - out_torch).mean().item() err = torch.abs(out_bnb - out_torch).mean().item()
# print(f'abs error {err:.4f}') # print(f'abs error {err:.4f}')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment