Skip to content

Commit ded54b5

Browse files
committed
Replace powf with sycl::pow in ggml-sycl.cpp
Signed-off-by: Joe Todd <[email protected]>
1 parent abd7c7b commit ded54b5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ggml-sycl.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -8877,7 +8877,7 @@ static void rope_norm(
88778877
const int i = row*ne0 + i0;
88788878
const int i2 = row/p_delta_rows;
88798879

8880-
const float theta_base = pos[i2]*powf(theta_scale, i0/2.0f);
8880+
const float theta_base = pos[i2]*sycl::pow(theta_scale, i0/2.0f);
88818881
const float freq_factor = has_ff ? freq_factors[i0 / 2] : 1.0f;
88828882

88838883
float cos_theta, sin_theta;
@@ -8919,7 +8919,7 @@ static void rope_neox(const T *x, T *dst, int ne0, int n_dims,
89198919
const int i = row*ne0 + i0/2;
89208920
const int i2 = row/p_delta_rows;
89218921

8922-
const float theta_base = pos[i2]*powf(theta_scale, i0/2.0f);
8922+
const float theta_base = pos[i2]*sycl::pow(theta_scale, i0/2.0f);
89238923
const float freq_factor = has_ff ? freq_factors[i0/2] : 1.0f;
89248924

89258925
float cos_theta, sin_theta;
@@ -12388,7 +12388,7 @@ static void rope_norm_sycl(const T *x, T *dst, int ne0, int n_dims, int nr,
1238812388
const int n_blocks_x = (ne0 + 2*SYCL_ROPE_BLOCK_SIZE - 1) / (2*SYCL_ROPE_BLOCK_SIZE);
1238912389
const sycl::range<3> block_nums(1, n_blocks_x, nr);
1239012390

12391-
const float theta_scale = powf(freq_base, -2.0f/n_dims);
12391+
const float theta_scale = sycl::pow(freq_base, -2.0f/n_dims);
1239212392

1239312393
if (freq_factors == nullptr) {
1239412394
/*
@@ -12436,7 +12436,7 @@ static void rope_neox_sycl(const T *x, T *dst, int ne0, int n_dims, int nr,
1243612436
const int n_blocks_x = (ne0 + 2*SYCL_ROPE_BLOCK_SIZE - 1) / (2*SYCL_ROPE_BLOCK_SIZE);
1243712437
const sycl::range<3> block_nums(1, n_blocks_x, nr);
1243812438

12439-
const float theta_scale = powf(freq_base, -2.0f/n_dims);
12439+
const float theta_scale = sycl::pow(freq_base, -2.0f/n_dims);
1244012440

1244112441
dpct::has_capability_or_fail(stream->get_device(),
1244212442
{sycl::aspect::fp16});
@@ -12575,8 +12575,8 @@ static void soft_max_f32_sycl(const float * x, const float * mask,
1257512575
const uint32_t n_head_kv = nrows_x/nrows_y;
1257612576
const uint32_t n_head_log2 = 1u << (uint32_t) floorf(log2f((float) n_head_kv));
1257712577

12578-
const float m0 = powf(2.0f, -(max_bias ) / n_head_log2);
12579-
const float m1 = powf(2.0f, -(max_bias / 2.0f) / n_head_log2);
12578+
const float m0 = sycl::pow(2.0f, -(max_bias ) / n_head_log2);
12579+
const float m1 = sycl::pow(2.0f, -(max_bias / 2.0f) / n_head_log2);
1258012580

1258112581
const size_t local_mem_size = stream->get_device().get_info<sycl::info::device::local_mem_size>();
1258212582
if (n_local_scratch*sizeof(float) < local_mem_size) {

0 commit comments

Comments
 (0)