Skip to content
Open
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
6 changes: 3 additions & 3 deletions tile_kernels/modeling/mhc/ops/norm_fn.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def forward(
def backward(
ctx: 'MHCPreNormFn',
out_grad: torch.Tensor,
) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor, None, None]:
) -> tuple[torch.Tensor | None, torch.Tensor, None, None, None]:
x, fn, out_mul, sqrsum = ctx.saved_tensors
norm_eps = ctx.norm_eps

Expand Down Expand Up @@ -166,8 +166,8 @@ def backward(

if ctx.fuse_grad_acc:
del x.untyped_storage().grad_from_mhc_post
return None, fn_grad, None, None, None, None
return x_grad, fn_grad, None, None, None, None
return None, fn_grad, None, None, None
return x_grad, fn_grad, None, None, None


def mhc_pre_norm_fn(
Expand Down