(ctx: Any, grad_output: torch.Tensor)
| 280 | |
| 281 | @staticmethod |
| 282 | def backward(ctx: Any, grad_output: torch.Tensor) -> Tuple[None, torch.Tensor]: |
| 283 | |
| 284 | input, weight = ctx.saved_tensors |
| 285 | grad_input = grad_output.matmul(weight) |
| 286 | handle = dist.all_reduce(grad_input.contiguous(), group=ctx.group, async_op=True) |
| 287 | grad_weight = grad_output.view(-1, grad_output.shape[-1]).t().matmul(input.view(-1, input.shape[-1])) |
| 288 | grad_bias = grad_output.sum(0) if ctx.use_bias else None |
| 289 | handle.wait() |
| 290 | return None, grad_input, grad_weight, grad_bias, None |
| 291 | |
| 292 | |
| 293 | class ColumnParallel(torch.autograd.Function): |
nothing calls this directly
no test coverage detected