Skip to content

Commit 43c7577

Browse files
authored
simplify by swapping op params
ggml-ci
1 parent 415b825 commit 43c7577

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

ggml/src/ggml-cuda/ggml-cuda.cu

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2852,10 +2852,8 @@ static void evaluate_and_capture_cuda_graph(ggml_backend_cuda_context * cuda_ctx
28522852
float scale = ggml_get_op_params_f32(node, 0);
28532853

28542854
i += 2; node = cgraph->nodes[i];
2855-
float softcap = ggml_get_op_params_f32(node, 0);
28562855

2857-
ggml_set_op_params_f32(node, 0, scale);
2858-
ggml_set_op_params_f32(node, 1, softcap);
2856+
ggml_set_op_params_f32(node, 1, scale);
28592857
node->src[0] = src0;
28602858

28612859
ggml_cuda_op_softcap(*cuda_ctx, node);

ggml/src/ggml-cuda/softcap.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ void ggml_cuda_op_softcap(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {
2626

2727
float scale;
2828
float softcap;
29-
memcpy(&scale, (float *) dst->op_params + 0, sizeof(float));
30-
memcpy(&softcap, (float *) dst->op_params + 1, sizeof(float));
29+
memcpy(&softcap, (float *) dst->op_params + 0, sizeof(float));
30+
memcpy(&scale, (float *) dst->op_params + 1, sizeof(float));
3131

3232
softcap_f32_cuda(src0_d, dst_d, scale, softcap, ggml_nelements(src0), stream);
3333
}

0 commit comments

Comments
 (0)