]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
ggml : require contiguous src for ROLL on CUDA and Metal (#25928)
authorYash Raj Pandey <redacted>
Mon, 10 Aug 2026 12:01:44 +0000 (08:01 -0400)
committerGitHub <redacted>
Mon, 10 Aug 2026 12:01:44 +0000 (15:01 +0300)
commitf8def7fe168bab245fbf15d3f18b26dbb1ef73c8
treefcf13de1a67f7a9977e999526c6f2b8e11a32e68
parent4dee52f82dc455a035e900fed6a40cb45cd7a454
ggml : require contiguous src for ROLL on CUDA and Metal (#25928)

ggml_roll only asserts nb[0] == ggml_type_size, so a permuted src is a
valid input, but the CUDA and Metal roll kernels index by ne alone and
never read the nb strides. A non-contiguous src therefore produced
silently wrong results. Neither backend declared a contiguity
requirement in supports_op, so the scheduler did not fall back to the
CPU implementation, which does handle strides correctly.

Add the requirement to both backends, matching the existing
GGML_OP_ROPE guard, and add a permuted test_roll case.
ggml/src/ggml-cuda/ggml-cuda.cu
ggml/src/ggml-metal/ggml-metal-device.m
tests/test-backend-ops.cpp