Skip to content

Commit 86a239c

Browse files
committed
Correctly account for parameter shift
1 parent b2aa4fb commit 86a239c

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

ggml/src/ggml-cpu/unary-ops.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,11 @@ static float softplus(float input, float beta=1.0f, float threshold=20.0f) {
201201

202202
void ggml_compute_forward_xielu(const ggml_compute_params * params, ggml_tensor * dst) {
203203
// Get the XIELU parameters from the operation
204-
const float * op_params = (const float*)dst->op_params;
205-
float alpha_n = op_params[0];
206-
float alpha_p = op_params[1];
207-
const float beta = op_params[2];
208-
const float eps = op_params[3];
209-
204+
float alpha_n = ggml_get_op_params_f32(dst, 1);
205+
float alpha_p = ggml_get_op_params_f32(dst, 2);
206+
const float beta = ggml_get_op_params_f32(dst, 3);
207+
const float eps = ggml_get_op_params_f32(dst, 4);
208+
210209
const auto xielu_op_params = [alpha_n, alpha_p, beta, eps](float f) {
211210
return op_xielu(f, alpha_n, alpha_p, beta, eps);
212211
};

ggml/src/ggml-cuda/unary.cu

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,6 @@ void ggml_cuda_op_geglu_quick(ggml_backend_cuda_context & ctx, ggml_tensor * dst
407407
// xIELU
408408
void ggml_cuda_op_xielu(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {
409409
// Get the XIELU parameters from the operation
410-
411-
const float * op_params = (const float*)dst->op_params;
412410
float alpha_n = ggml_get_op_params_f32(dst, 1);
413411
float alpha_p = ggml_get_op_params_f32(dst, 2);
414412
const float beta = ggml_get_op_params_f32(dst, 3);

0 commit comments

Comments
 (0)