Skip to content

Commit c62b01b

Browse files
committed
default to disabling NTKv2 instead of enabling it
1 parent 6c416e3 commit c62b01b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/common.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ struct gpt_params {
3535
int32_t n_probs = 0; // if greater than 0, output the probabilities of top n_probs tokens.
3636
float rope_freq_base = 10000.0f; // RoPE base frequency
3737
float rope_freq_scale = 1.0f; // RoPE frequency scaling factor
38-
float rope_ntk_factor = 1.0f; // RoPE NTK mix factor
39-
float rope_extrapolation_factor = 1.0f; // RoPE extrapolation mix factor
38+
float rope_ntk_factor = 0.0f; // RoPE NTK mix factor
39+
float rope_extrapolation_factor = 0.0f; // RoPE extrapolation mix factor
4040

4141
// sampling parameters
4242
std::unordered_map<llama_token, float> logit_bias; // logit bias for specific tokens

ggml.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7005,7 +7005,7 @@ struct ggml_tensor * ggml_rope(
70057005
int n_dims,
70067006
int mode,
70077007
int n_ctx) {
7008-
return ggml_rope_impl(ctx, a, n_past, n_dims, mode, 10000.0f, 1.0f, 1.0f, 1.0f, n_ctx, false);
7008+
return ggml_rope_impl(ctx, a, n_past, n_dims, mode, 10000.0f, 1.0f, 0.0f, 0.0f, n_ctx, false);
70097009
}
70107010

70117011
struct ggml_tensor * ggml_rope_inplace(
@@ -7015,7 +7015,7 @@ struct ggml_tensor * ggml_rope_inplace(
70157015
int n_dims,
70167016
int mode,
70177017
int n_ctx) {
7018-
return ggml_rope_impl(ctx, a, n_past, n_dims, mode, 10000.0f, 1.0f, 1.0f, 1.0f, n_ctx, true);
7018+
return ggml_rope_impl(ctx, a, n_past, n_dims, mode, 10000.0f, 1.0f, 0.0f, 0.0f, n_ctx, true);
70197019
}
70207020

70217021
struct ggml_tensor * ggml_rope_custom_inplace(

llama.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ struct llama_hparams {
193193

194194
float rope_freq_base = 10000.0f;
195195
float rope_freq_scale = 1.0f;
196-
float rope_ntk_factor = 1.0f;
197-
float rope_extrapolation_factor = 1.0f;
196+
float rope_ntk_factor = 0.0f;
197+
float rope_extrapolation_factor = 0.0f;
198198

199199
enum llama_ftype ftype = LLAMA_FTYPE_MOSTLY_F16;
200200

@@ -852,8 +852,8 @@ struct llama_context_params llama_context_default_params() {
852852
/*.tensor_split =*/ {0},
853853
/*.rope_freq_base =*/ 10000.0f,
854854
/*.rope_freq_scale =*/ 1.0f,
855-
/*.rope_ntk_factor =*/ 1.0f,
856-
/*.rope_extrapolation_factor =*/ 1.0f,
855+
/*.rope_ntk_factor =*/ 0.0f,
856+
/*.rope_extrapolation_factor =*/ 0.0f,
857857
/*.progress_callback =*/ nullptr,
858858
/*.progress_callback_user_data =*/ nullptr,
859859
/*.low_vram =*/ false,

0 commit comments

Comments
 (0)