Qwen checkpoints with block FP8 weights
Esta página aún no está disponible en tu idioma.
The Rust CUDA loader accepts the official Qwen3.8 block-FP8 layout: original
F8_E4M3 weight bytes and weight_scale_inv on a 128-by-128 block grid. The
checkpoint must declare quant_method: fp8 and weight_block_size: [128,128].
BF16 block scales expand exactly to F32; they remain dequantization multipliers,
not reciprocals. Mixed BF16/F16 tensors, including the output head, retain their
original representation. Existing checkpoints with one weight_scale per row
continue through the existing row-scaled path.
The block path keeps the original quantized weights resident and applies block multipliers inside the projection reduction. It uses F32 activations and accumulation without weight or activation requantization. It is a CUDA correctness baseline, not a Tensor Core throughput implementation. Report its compute path alongside the checkpoint identity when comparing engines: equal checkpoint bytes do not imply identical activation arithmetic or kernels.
Attention, GDN and FFN projections use the same block operator for decode and prefill. Grouped tensors retain their own block-row origin; the row-FP8 fusion is not applied to them. Partial block rows/columns use ceil-divided scale grids. E5M2 encodings, ambiguous row/block scales, malformed grids and incompatible checkpoint declarations refuse before model upload.
The same representation applies to the checkpoint’s MTP sidecar projections.
Its geometry and scale grids are validated even when speculative generation is
off. Mixed BF16 input projection and floating-point norms stay unchanged;
BUTTER_QWEN35_MTP_FP8 controls conversion of floating-point matrices only and
never requantizes an original block-FP8 matrix.
CPU checks from rust/:
cargo test --locked -p wh-butter-models fp8_block_testscargo test --locked -p wh-butter-ops block_fp8cargo test --locked -p wh-butter-loaderThe CUDA numerical integration test is block_fp8_linear. It requires
BUTTER_BLOCK_FP8_ORACLE_DIR pointing at independently generated original-byte,
BF16-scale, input and expected-output fixtures, then an explicitly assigned
idle GPU:
cargo test --locked -p wh-butter-cuda --features cuda --test block_fp8_linear \ -- --ignored --nocapture --test-threads=1The fixtures distinguish scale direction, unequal K blocks, non-square tails, member-local scale origins and dense accumulation. Retain their hashes with actual GPU results. An ignored test or CPU compile is not a GPU pass; run the checkpoint’s normal boot/coherency sequence before interpreting throughput.
