]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
[CUDA] Added a cudaMemcpy2DAsync fast path to ggml_cuda_cpy (#25057)
authorGaurav Garg <redacted>
Sat, 27 Jun 2026 12:16:21 +0000 (17:46 +0530)
committerGitHub <redacted>
Sat, 27 Jun 2026 12:16:21 +0000 (17:46 +0530)
commit0ed235ea2c17a19fc8238668653946721ed136fd
treec3ed2c39b9700f3aeff95ab391571db7dd7e0c39
parent9bebfcb4bc8b12a316e96ae03f33671eac1e72fd
[CUDA] Added a cudaMemcpy2DAsync fast path to ggml_cuda_cpy (#25057)

* [CUDA] Added a cudaMemcpy2DAsync fast path to ggml_cuda_cpy

Add a CUDA ggml_cpy fast path for same-type, same-shape strided copies that are just 2D pitched block copies.
When tensors are not fully contiguous but each row is contiguous, it now uses cudaMemcpy2DAsync instead of the slow element-wise scalar copy kernel.

This fixes the GDN recurrent snapshot update with -np 4, where rollback slots are separated by cache stride gaps.

* Add new tests that execute the new optimized strided copy path

* Return unsupported for strided copy in OpenVINO, as new tests are failing
ggml/src/ggml-cuda/cpy.cu
ggml/src/ggml-openvino/ggml-openvino.cpp
tests/test-backend-ops.cpp