From 7281f605723b5f8538130b17e537268c688aa29f Mon Sep 17 00:00:00 2001 From: xaedes Date: Fri, 28 Apr 2023 20:30:42 +0200 Subject: [PATCH] move dup call into the actual add_at functions --- ggml.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ggml.c b/ggml.c index 985ea7317..472203824 100644 --- a/ggml.c +++ b/ggml.c @@ -7948,6 +7948,8 @@ static void ggml_compute_forward_add_at_f32( // GGML_ASSERT(ggml_are_same_shape(src0, src1)); // TODO: assert that offset+len(src1) <= len(src1) GGML_ASSERT(ggml_are_same_shape(src0, dst)); + ggml_compute_forward_dup_same_cont(params, src0, dst); + if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) { return; } @@ -8007,6 +8009,8 @@ static void ggml_compute_forward_add_at_f16_f32( // GGML_ASSERT(ggml_are_same_shape(src0, src1)); // TODO: assert that offset+len(src1) <= len(src1) GGML_ASSERT(ggml_are_same_shape(src0, dst)); + ggml_compute_forward_dup_same_cont(params, src0, dst); + if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) { return; } @@ -8058,6 +8062,8 @@ static void ggml_compute_forward_add_at_f16_f16( // GGML_ASSERT(ggml_are_same_shape(src0, src1)); // TODO: assert that offset+len(src1) <= len(src1) GGML_ASSERT(ggml_are_same_shape(src0, dst)); + ggml_compute_forward_dup_same_cont(params, src0, dst); + if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) { return; } @@ -8109,6 +8115,8 @@ static void ggml_compute_forward_add_at_q_f32( // GGML_ASSERT(ggml_are_same_shape(src0, src1)); // TODO: assert that offset+len(src1) <= len(src1) GGML_ASSERT(ggml_are_same_shape(src0, dst)); + ggml_compute_forward_dup_same_cont(params, src0, dst); + if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) { return; } @@ -8217,7 +8225,6 @@ static void ggml_compute_forward_add_at( struct ggml_tensor * dst) { size_t offset; memcpy(&offset, dst->padding, sizeof(offset)); - ggml_compute_forward_dup_same_cont(params, src0, dst); switch (src0->type) { case GGML_TYPE_F32: {