From: Georgi Gerganov Date: Sun, 26 May 2024 15:35:23 +0000 (+0300) Subject: ggml : restore ggml_rope_xpos_inplace (#0) X-Git-Tag: upstream/0.0.1642~647 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ff1c61c3b98e516f9b5502d3470eb53c7f7a5989;p=pkg%2Fggml%2Fsources%2Fggml ggml : restore ggml_rope_xpos_inplace (#0) ggml-ci --- diff --git a/include/ggml/ggml.h b/include/ggml/ggml.h index f803ba72..6706807b 100644 --- a/include/ggml/ggml.h +++ b/include/ggml/ggml.h @@ -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]); diff --git a/src/ggml.c b/src/ggml.c index 5145ceec..535a3680 100644 --- a/src/ggml.c +++ b/src/ggml.c @@ -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(