flashinfer.diffusion_ops.prepare_minimax_h3_fc2_weight_fp8¶
- flashinfer.diffusion_ops.prepare_minimax_h3_fc2_weight_fp8(fc2_weight: Tensor, chunk_rows: int = 1024) Tuple[Tensor, Tensor]¶
Quantize the FC2 weight for
minimax_h3_mlp_fp8_sm120().fc2_weightis the BF16nn.Linearmatrix[5376, 14336](output channels x FFN). Each output channel (row) is quantized to E4M3 withscale = RN(max(amax(row), 1e-12) / 448)(true IEEE division) andq = RN_sat(row / scale); the row order is unchanged.- Parameters:
fc2_weight (torch.Tensor) – CUDA
bfloat16[5376, 14336]FC2 weight matrix.chunk_rows (int) – Number of output channels quantized per chunk (default:
1024).
- Returns:
(fc2_weight_q, fc2_weight_scale):float8_e4m3fn[5376, 14336]weights andfloat32[5376]per-row scales.- Return type:
Tuple[torch.Tensor, torch.Tensor]