ggml : fix pos ptr when no ALiBi

ggml-ci
This commit is contained in:
Georgi Gerganov 2024-02-15 14:30:50 +02:00
parent e3d4b99a9e
commit b2c055b8af
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

3
ggml.c
View file

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