summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2024-05-26 18:35:23 +0300
committerGeorgi Gerganov <ggerganov@gmail.com>2024-05-29 14:29:33 +0300
commit72de268bec49f67e2883880f573c55cea32de736 (patch)
treec79389a7cdd6684513240c2bd5047c54f7c61b0e
parent0e8d8bfd6caf1d0a8cbdf9d3d5c06fbbb9dfced8 (diff)
ggml : restore ggml_rope_xpos_inplace (ggml/0)
ggml-ci
-rw-r--r--ggml.c10
-rw-r--r--ggml.h8
2 files changed, 18 insertions, 0 deletions
diff --git a/ggml.c b/ggml.c
index 8bfb9531..5025ec23 100644
--- a/ggml.c
+++ b/ggml.c
@@ -6392,6 +6392,16 @@ struct ggml_tensor * ggml_rope_custom_inplace(
);
}
+struct ggml_tensor * ggml_rope_xpos_inplace(
+ struct ggml_context * ctx,
+ struct ggml_tensor * a,
+ struct ggml_tensor * b,
+ int n_dims,
+ float base,
+ bool down) {
+ 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);
+}
+
// ggml_rope_back
struct ggml_tensor * ggml_rope_back(
diff --git a/ggml.h b/ggml.h
index 4e6bcb30..3859895b 100644
--- a/ggml.h
+++ b/ggml.h
@@ -1548,6 +1548,14 @@ extern "C" {
float beta_slow),
"use ggml_rope_ext_inplace instead");
+ struct ggml_tensor * ggml_rope_xpos_inplace(
+ struct ggml_context * ctx,
+ struct ggml_tensor * a,
+ struct ggml_tensor * b,
+ int n_dims,
+ float base,
+ bool down);
+
// compute correction dims for YaRN RoPE scaling
GGML_CALL void ggml_rope_yarn_corr_dims(
int n_dims, int n_orig_ctx, float freq_base, float beta_fast, float beta_slow, float dims[2]);