File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
ggml/src/ggml-hexagon/htp Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments