From eac9aca460ee7afb6d0cbc61ae43a95120d34f29 Mon Sep 17 00:00:00 2001 From: justheuristic Date: Sat, 17 Sep 2022 23:38:09 +0300 Subject: cast bias too --- bitsandbytes/autograd/_functions.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bitsandbytes/autograd/_functions.py') diff --git a/bitsandbytes/autograd/_functions.py b/bitsandbytes/autograd/_functions.py index dc79bb1..6d9229b 100644 --- a/bitsandbytes/autograd/_functions.py +++ b/bitsandbytes/autograd/_functions.py @@ -234,6 +234,8 @@ class MatMul8bitLt(torch.autograd.Function): if A_dtype != torch.float16: warnings.warn(f"MatMul8bitLt: input matrix will be converted from {A_dtype} to float16") A = A.to(torch.float16) + if bias is not None: + bias = bias.to(torch.float16) # 1. Quantize A if len(A.shape) == 3: -- cgit v1.2.3