Skip to content

linalg/block_quant: W4A8 GEMM for Q4_0 (int8-dot decode path)#2431

Open
czoli1976 wants to merge 1 commit into
sonos:mainfrom
czoli1976:feature/w4a8-q4_0-gemm
Open

linalg/block_quant: W4A8 GEMM for Q4_0 (int8-dot decode path)#2431
czoli1976 wants to merge 1 commit into
sonos:mainfrom
czoli1976:feature/w4a8-q4_0-gemm

Conversation

@czoli1976

Copy link
Copy Markdown
Contributor

Follow-up to #2348: generalises the M == 1 W4A8 GEMV to a GEMM that decodes each Q4_0 weight block once and reuses it across the M activation rows, writing into a caller-provided [m, n] buffer — the allocation-free &mut [f32] output you flagged on #2348. Correctness is covered by asserting the GEMM is bit-identical to the per-row GEMV, plus an approximate check against the f32-dequant matmul.

🍍

Generalize the M==1 W4A8 GEMV to a GEMM that decodes each Q4_0 weight
block once and reuses it across the M activation rows, computing per-block
int8 dot products of the unpacked 4-bit weights against int8-quantized
activations. Writes into a caller-provided [m, n] buffer to stay
allocation-free on the hot path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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