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
Quantize an [n, k] BF16 dense weight to block-scaled FP8 E4M3 on GPU.
Returns a Fp8Weight tagged Fp8BlockScaled, laid out exactly as the
on-disk Qwen FP8 releases are after widening, so every consumer that
already accepts those accepts this with no change.
Called once per projection at load time, never on the hot path. The BF16 source is the caller’s to free — this does not take ownership.