From 0a982a414ee68f06c6d667ae29b018478c931846 Mon Sep 17 00:00:00 2001 From: Jeff Bolz Date: Sat, 11 Jan 2025 08:57:32 -0600 Subject: [PATCH] ggml: copy q->f32 assumes some contiguity in the destination --- ggml/src/ggml-cpu/ggml-cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ggml/src/ggml-cpu/ggml-cpu.c b/ggml/src/ggml-cpu/ggml-cpu.c index f249ba344..9a3afb51f 100644 --- a/ggml/src/ggml-cpu/ggml-cpu.c +++ b/ggml/src/ggml-cpu/ggml-cpu.c @@ -3982,6 +3982,11 @@ static void ggml_compute_forward_dup_q( size_t qk = ggml_blck_size(type); const int64_t nr = ggml_nelements(src1) / qk; + // destination must be contiguous in the first dimension + GGML_ASSERT(nb10 == ggml_type_size(dst->type)); + // must either have first dimension large enough to hold a row, or fully contiguous + GGML_ASSERT((ne10 % qk) == 0 || ggml_is_contiguous(dst)); + const int ith = params->ith; const int nth = params->nth;