mirror of
https://github.com/ikawrakow/ik_llama.cpp.git
synced 2026-07-21 10:15:35 +00:00
The scalar fast-path in ggml_cuda_op_mul routes to ggml_cuda_op_scale_tensor, which reads src0 and writes dst as flat contiguous buffers. With a non-contiguous src0 (for example a row-gapped view) this ignored the per-row strides: only the first row was correct and later rows read the wrong memory. The CPU backend respects the strides, so the two backends diverged. Guard the fast-path on contiguous src0 and dst; non-contiguous inputs now fall through to the general bin_bcast path, which honours the strides. Add a non-contiguous test_bin_bcast variant covering both the scalar (scale) and vector (general) paths. Co-authored-by: Joel Farthing <262452229+joelfarthing@users.noreply.github.com>