File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -12258,7 +12258,11 @@ static void ggml_compute_forward_soft_max_f32(
12258
12258
const float slope = h < n_head_log2 ? powf(m0, h + 1) : powf(m1, 2*(h - n_head_log2) + 1);
12259
12259
12260
12260
for (int i = 0; i < nc; i++) {
12261
- wp[i] = wp[i] - slope*abs(i1%nc - i);
12261
+ if (pos == NULL) {
12262
+ wp[i] = wp[i] + pos[i];
12263
+ } else {
12264
+ wp[i] = wp[i] - slope*abs(i1%nc - i);
12265
+ }
12262
12266
}
12263
12267
}
12264
12268
@@ -12472,7 +12476,6 @@ static void ggml_compute_forward_alibi_f32(
12472
12476
12473
12477
for (int64_t i = 0; i < ne0; i++) {
12474
12478
for (int64_t j = 0; j < ne1; j++) {
12475
- float * const src = (float *)((char *) src0->data + i*nb0 + j*nb1 + k*nb2);
12476
12479
float * pdst = (float *)((char *) dst->data + i*nb0 + j*nb1 + k*nb2);
12477
12480
pdst[0] = -1.0f * i * m_k;
12478
12481
}
You can’t perform that action at this time.
0 commit comments