From: Piotr Wilkin (ilintar) Date: Wed, 19 Nov 2025 09:36:33 +0000 (+0100) Subject: Fix too relaxed check on CUDA "fast copy" (can_be_transposed) condition (llama/17332) X-Git-Tag: upstream/1.8.3~271 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=746cbed20adadcc199e9e1c50173411276e6a360;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp Fix too relaxed check on CUDA "fast copy" (can_be_transposed) condition (llama/17332) * Fix too relaxed check on CUDA "fast copy" (can_be_transposed) condition * Argh. * Making CISC happy ;) * Integrate CONT tests * Use loopy loop * Skip new tests for (B)F16 for now. --- diff --git a/ggml/src/ggml-cuda/cpy.cu b/ggml/src/ggml-cuda/cpy.cu index 50612237..c1afde96 100644 --- a/ggml/src/ggml-cuda/cpy.cu +++ b/ggml/src/ggml-cuda/cpy.cu @@ -384,7 +384,8 @@ void ggml_cuda_cpy(ggml_backend_cuda_context & ctx, const ggml_tensor * src0, gg char * src1_ddc = (char *) src1->data; const bool contiguous_srcs = ggml_is_contiguous(src0) && ggml_is_contiguous(src1); - const bool can_be_transposed = nb01 == (int64_t)ggml_element_size(src0) && src0->ne[3] == 1; + const bool can_be_transposed = nb01 == (int64_t)ggml_element_size(src0) && + src0->ne[3] == 1 && nb02 == ne00 * ne01 * (int64_t)ggml_element_size(src0); if (src0->type == src1->type && contiguous_srcs) { GGML_ASSERT(ggml_nbytes(src0) == ggml_nbytes(src1));