]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ggml : restore ggml_rope_xpos_inplace (#0)
authorGeorgi Gerganov <redacted>
Sun, 26 May 2024 15:35:23 +0000 (18:35 +0300)
committerGeorgi Gerganov <redacted>
Tue, 28 May 2024 11:41:08 +0000 (14:41 +0300)
ggml-ci

include/ggml/ggml.h
src/ggml.c

index f803ba7241fe1b457f8ea10e93e4f72d9544288f..6706807b01ca14b45f1aa0d6ae8294c109efb926 100644 (file)
@@ -1547,6 +1547,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]);
index 5145ceec9f4b2a41d9f6deeb37d1532013461432..535a36800bc4ab1d08d2b57d2405db755b97f65c 100644 (file)
@@ -6378,6 +6378,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(