Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Fix gradients #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bitmat/bitlinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def forward(self, x):
self.convert_weights_to_parameters()
x_dtype = x.dtype
x = self.norm(x.to(self.norm.weight.dtype)).to(x_dtype)
output = bitmat(self.weight.data, x, scale_w=self.scale_w)
output = bitmat(self.weight, x, scale_w=self.scale_w)
if self.bias is not None:
output += self.bias.unsqueeze(0).expand_as(output)
return output
4 changes: 2 additions & 2 deletions bitmat/triton_kernels/rmsnorm_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ def backward(ctx, dY):
num_warps = ctx.num_warps,
)
dX = dY.view(*shape)
return dX, None, None, None
return None, dX, None, None
pass
pass

def fast_rms_layernorm(weight, X, eps, gemma = False):
out = Fast_RMS_Layernorm.apply(X, weight, eps, gemma)
return out
pass
pass