You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] GGUF_CPP (CPU and CUDA) ggml path error is ~7e-3 to 1e-2 even with fp32 input; whether it's used depends on a timing benchmark (CPU) or on bias presence (CUDA) #4219
ggml quantizes activations to Q8_1 / Q8_K before the K-quant dot product. So GGUF_CPP output differs from the dequantized-weight oracle by well over the 2e-3 tolerance:
Path
Relative error vs oracle
CUDA, no bias, fp16
3.6e-3
CUDA, no bias, bf16
7.7e-3
CUDA, no bias, fp32
7.1e-3
CPU
6–10e-3
Which path runs is not stable:
CPU:_use_ggml_cpu_matmul (gguf_cpp.py:~949-976) chooses ggml vs dense by a timing benchmark, so the numerics vary from run to run and machine to machine.
CUDA with a bias:_finish_ggml_output (~L843-867) discards the ggml result and recomputes a dense fp32 matmul, so the result is exact.
Expected
Either keep the result within tolerance, or document and explicitly gate the activation quantization. Numerics shouldn't depend on timing or on whether a bias exists.
Found during an AI-assisted review (Claude Code) of 9dad249; repros were run on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.
Activity
fix: make the GGUF_CPP CPU matmul path capability-based instead of ti…
fix(gguf): bound the GGUF_CPP activation-quantization loss and make t…