flashinfer.gated_act_mxfp8.silu_and_mul_mxfp8_quantize_backward¶
- flashinfer.gated_act_mxfp8.silu_and_mul_mxfp8_quantize_backward(gated_input: Tensor, grad_output: Tensor, *, rowwise: bool = True, colwise: bool = False) Tuple[Tensor, Tensor, Tensor, Tensor]¶
Apply the SwiGLU backward transform and emit RCEIL MXFP8 outputs.
The logical result concatenates the gate-input and up-input gradients, producing shape
[M, 2K]before quantization. No intermediate BF16 result is materialized in global memory.- Parameters:
gated_input (torch.Tensor) – Contiguous BF16 CUDA tensor with shape
[M, 2K].grad_output (torch.Tensor) – Contiguous BF16 CUDA tensor with shape
[M, K].rowwise (bool, optional) – Whether to emit rowwise MXFP8 values and scales.
colwise (bool, optional) – Whether to emit colwise MXFP8 values and scales.
- Returns:
Rowwise values, colwise values, rowwise scales, and colwise scales for the concatenated gate-input and up-input gradients. Outputs for disabled orientations are zero-sized tensors.
- Return type:
tuple of torch.Tensor