pub fn cublas_fp8_proj_prequant(
gpu: &dyn GpuBackend,
scale_kmajor_k: KernelHandle,
act_fp8: DevicePtr,
act_scale: DevicePtr,
act_scale_kmajor: DevicePtr,
fp8w: &Fp8Weight,
out: DevicePtr,
m: u32,
n: u32,
k: u32,
stream: u64,
) -> Result<()>Expand description
2026-09-25: cublas_fp8_proj for an activation the caller already ran
through per_token_group_quant_fp8, so one quantization can feed several
projections (the dense FFN’s gate and up share one).
With cublas_scale_layout_kmajor on, the scales are first transposed
into act_scale_kmajor; a zero kernel handle or scratch pointer is an
error.
cuBLASLt is handed ceil16(M) rows (cublas_fp8_m_pad), so:
outmust holdceil16(M) * NBF16 elements; the pad rows are written.act_fp8must holdceil16(M) * Kbytes; the pad rows are zeroed here.act_scale_kmajormust holdceil16(M) * (K/128)f32, andact_scaleM * (K/128)f32, orceil16(M) * (K/128)underrowmajor, where the pad rows are zeroed in place.