Skip to content

Commit 72de268

Browse files
committed
ggml : restore ggml_rope_xpos_inplace (ggml/0)
ggml-ci
1 parent 0e8d8bf commit 72de268

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

ggml.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6392,6 +6392,16 @@ struct ggml_tensor * ggml_rope_custom_inplace(
63926392
);
63936393
}
63946394

6395+
struct ggml_tensor * ggml_rope_xpos_inplace(
6396+
struct ggml_context * ctx,
6397+
struct ggml_tensor * a,
6398+
struct ggml_tensor * b,
6399+
int n_dims,
6400+
float base,
6401+
bool down) {
6402+
return ggml_rope_impl(ctx, a, b, NULL, n_dims, 0, 0, 0, 10000.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, base, down, true);
6403+
}
6404+
63956405
// ggml_rope_back
63966406

63976407
struct ggml_tensor * ggml_rope_back(

ggml.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,14 @@ extern "C" {
15481548
float beta_slow),
15491549
"use ggml_rope_ext_inplace instead");
15501550

1551+
struct ggml_tensor * ggml_rope_xpos_inplace(
1552+
struct ggml_context * ctx,
1553+
struct ggml_tensor * a,
1554+
struct ggml_tensor * b,
1555+
int n_dims,
1556+
float base,
1557+
bool down);
1558+
15511559
// compute correction dims for YaRN RoPE scaling
15521560
GGML_CALL void ggml_rope_yarn_corr_dims(
15531561
int n_dims, int n_orig_ctx, float freq_base, float beta_fast, float beta_slow, float dims[2]);

0 commit comments

Comments
 (0)