fp8_gemm_act_weight_t_blkscaled

Function fp8_gemm_act_weight_t_blkscaled 

Source
pub fn fp8_gemm_act_weight_t_blkscaled(
    act_fp8: u64,
    act_scale: u64,
    weight_fp8: u64,
    weight_block_scale: u64,
    out: u64,
    m: u32,
    n: u32,
    k: u32,
    stream: u64,
) -> Result<()>
Expand description

2026-09-25: FP8 E4M3 out[M,N] = act[M,K] @ weight[N,K]ᵀ, BF16 output, with FP32 block scales: BLK128x128_32F on the weight (cuBLASLt’s A) and VEC128_32F on the activation (B). The scale layouts are in super::scale_layout:

  • weight_block_scale is the checkpoint’s row-major [N/128, K/128] grid, passed unchanged, which requires blk128x128_stride_ok(k); this function does not check it.
  • act_scale is expected as [K/128, m], token index contiguous (vec128_b_index): the transpose of the [M, K/128] that per_token_group_quant_fp8 writes. The fp8_act_scale_to_kmajor kernel converts one to the other.

m goes to cuBLASLt unchanged; the callers pass a padded count (m_pad), and act_fp8 and act_scale must cover it. The output is contiguous [m, N]; fp8_gemm_act_weight_t_blkscaled_ldc takes an output row pitch.