]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
opencl: avoid the vec path in GEMV for unaligned row stride (#25671)
authorHongqiang Wang <redacted>
Tue, 14 Jul 2026 19:27:56 +0000 (12:27 -0700)
committerGitHub <redacted>
Tue, 14 Jul 2026 19:27:56 +0000 (12:27 -0700)
commita4ce2595c55eaed284f509fab398f4ddafe5a3a4
tree96e59e6bdc95c87ef0a2dab97905832f65fb23c8
parentc71854292f7c367cc3b35939f88121d81945472f
opencl: avoid the vec path in GEMV for unaligned row stride (#25671)

The f16 GEMV kernels take a vectorized path for ne00 >= 128 that casts the row
pointers to half4 or float4. When the row stride is not aligned, the wide load
becomes misaligned. On devices that require natural alignment for vector loads,
the kernel reads garbage. This is the case Intel GPUs and the kernels produce
incorrect results there. Adreno happpens to be byte addressable and the kernels
happen to work.
ggml/src/ggml-opencl/kernels/mul_mv_f16_f16.cl
ggml/src/ggml-opencl/kernels/mul_mv_f16_f32.cl
ggml/src/ggml-opencl/kernels/mul_mv_f16_f32_1row.cl