quantize_to_fp8_blockscaled

Function quantize_to_fp8_blockscaled 

Source
pub fn quantize_to_fp8_blockscaled(
    bf16_weight: &DenseWeight,
    n: usize,
    k: usize,
    gpu: &dyn GpuBackend,
    quantize_kernel: KernelHandle,
    stream: u64,
) -> Result<Fp8Weight>
Expand description

2026-09-25: Quantize an [n, k] BF16 dense weight to block-scaled FP8 E4M3 on the GPU, as an Fp8Weight tagged Fp8BlockScaled with FP32 scales [ceil(n/128), ceil(k/128)].

It does not synchronize stream and does not free the BF16 source; the caller must synchronize before freeing it.