diff --git a/unsloth/kernels/moe/grouped_gemm/interface.py b/unsloth/kernels/moe/grouped_gemm/interface.py index cf88d8777c..d69af9ebee 100644 --- a/unsloth/kernels/moe/grouped_gemm/interface.py +++ b/unsloth/kernels/moe/grouped_gemm/interface.py @@ -746,6 +746,7 @@ class GroupedGemm(torch.autograd.Function): @staticmethod def backward(ctx, dY): + dY = dY.contiguous() X, W, m_sizes, gather_indices = ctx.saved_tensors topk = ctx.topk permute_x = ctx.permute_x