Skip to content
Merged
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
5 changes: 1 addition & 4 deletions colossalai/quantization/fp8.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,14 +728,11 @@ def backward(ctx: Any, out_grad) -> Any:
return x_grad.reshape(ctx.x_shape), w_grad, bias_grad


@torch.compile(mode="reduce-overhead", disable=not SUPPORT_TORCH_COMPILE)
@torch.compile(mode="max-autotune-no-cudagraphs", disable=not SUPPORT_TORCH_COMPILE, dynamic=False)
def _linear_fp8(input: torch.Tensor, weight: torch.Tensor, bias: Optional[torch.Tensor] = None) -> torch.Tensor:
return _LinearFp8.apply(input, weight, bias)


def linear_fp8(input: torch.Tensor, weight: torch.Tensor, bias: Optional[torch.Tensor] = None) -> torch.Tensor:
out = _linear_fp8(input, weight, bias)
if SUPPORT_TORCH_COMPILE:
# avoid modifying the tensor created from cuda graph
out = out.clone()
return out