Skip to content

Commit 0a982a4

Browse files
committed
ggml: copy q->f32 assumes some contiguity in the destination
1 parent 305dc66 commit 0a982a4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ggml/src/ggml-cpu/ggml-cpu.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3982,6 +3982,11 @@ static void ggml_compute_forward_dup_q(
39823982
size_t qk = ggml_blck_size(type);
39833983
const int64_t nr = ggml_nelements(src1) / qk;
39843984

3985+
// destination must be contiguous in the first dimension
3986+
GGML_ASSERT(nb10 == ggml_type_size(dst->type));
3987+
// must either have first dimension large enough to hold a row, or fully contiguous
3988+
GGML_ASSERT((ne10 % qk) == 0 || ggml_is_contiguous(dst));
3989+
39853990
const int ith = params->ith;
39863991
const int nth = params->nth;
39873992

0 commit comments

Comments
 (0)