Skip to content

Commit a6ef41f

Browse files
committed
wip
1 parent 010039a commit a6ef41f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ggml/src/ggml-hexagon/htp/rope-ops.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,9 @@ static void rope_hex_f32(struct rope_th_ctx * rope_ctx,
282282
freq_factors = (const float *) src2->data;
283283
}
284284

285-
const uint32_t i1_end = MIN(ir1, ne1);
286-
const int32_t half_dims = rope_ctx->n_dims / 2;
285+
const uint32_t i1_end = MIN(ir1, ne1);
286+
const int32_t half_dims = rope_ctx->n_dims / 2;
287+
const size_t remain_bytes = (ne0 - rope_ctx->n_dims) * sizeof(float);
287288
for (uint32_t i3 = 0; i3 < ne3; i3++) { // batch
288289
for (uint32_t i2 = 0; i2 < ne2; i2++) { // seq-len
289290
const int32_t p = pos[i2];
@@ -338,7 +339,7 @@ static void rope_hex_f32(struct rope_th_ctx * rope_ctx,
338339
}
339340

340341
// TODO: use simd to speed up the remaining elements copy
341-
memcpy(dst_data_loc, src_loc, (ne0 - rope_ctx->n_dims) * sizeof(float));
342+
memcpy(dst_data_loc, src_loc, remain_bytes);
342343
}
343344
}
344345
}

0 commit comments

Comments
 (0)