Skip to content

Use fp16 fdot2 for bf16 int4 GEMV dequant on RDNA 3.5#877

Draft
mgehre-amd wants to merge 1 commit intogfx11from
matthias.bf16-fdot2-dequant
Draft

Use fp16 fdot2 for bf16 int4 GEMV dequant on RDNA 3.5#877
mgehre-amd wants to merge 1 commit intogfx11from
matthias.bf16-fdot2-dequant

Conversation

@mgehre-amd
Copy link
Copy Markdown

@mgehre-amd mgehre-amd commented Apr 15, 2026

Replace the scalar bf16→f32 dequant path in wvSplitK_int4 with an optimized path that dequantizes INT4 weights to fp16 using the bit-trick (same as the fp16 path), converts bf16 activations to fp16, then uses the native __builtin_amdgcn_fdot2 instruction for the dot product.

This is ~2.5x fewer ALU ops than the scalar bf16 conversion path.

Replace the scalar bf16→f32 dequant path in wvSplitK_int4 with an
optimized path that dequantizes INT4 weights to fp16 using the bit-trick
(same as the fp16 path), converts bf16 activations to fp16, then uses
the native __builtin_amdgcn_fdot2 instruction for the dot product.

This is ~2.5x fewer ALU ops than the scalar bf16 conversion path.

Signed-off-by: Matthias Gehre <matthias.gehre@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant