From b2c055b8af854c36f81979fad6a4085dc5844528 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Thu, 15 Feb 2024 14:30:50 +0200 Subject: [PATCH] ggml : fix pos ptr when no ALiBi ggml-ci --- ggml.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ggml.c b/ggml.c index afaeb74b9..6ddcd5f56 100644 --- a/ggml.c +++ b/ggml.c @@ -11518,7 +11518,8 @@ static void ggml_compute_forward_soft_max_f32( float * wp = (float *) params->wdata + (nc + CACHE_LINE_SIZE_F32) * ith; - float * pos = (float *) src2->data; + // when max_bias <= 0.0f, src2 is not used and we default it to src0 to avoid branching + float * pos = src2 ? (float *) src2->data : src0->data; for (int i1 = ir0; i1 < ir1; i1++) { float * sp = (float *)((char *) src0->data + i1*src0->nb[1]);