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]);