Skip to content

Commit

Permalink
default to disabling NTKv2 instead of enabling it
Browse files Browse the repository at this point in the history
  • Loading branch information
cebtenzzre committed Jul 20, 2023
1 parent 6c416e3 commit c62b01b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ struct gpt_params {
int32_t n_probs = 0; // if greater than 0, output the probabilities of top n_probs tokens.
float rope_freq_base = 10000.0f; // RoPE base frequency
float rope_freq_scale = 1.0f; // RoPE frequency scaling factor
float rope_ntk_factor = 1.0f; // RoPE NTK mix factor
float rope_extrapolation_factor = 1.0f; // RoPE extrapolation mix factor
float rope_ntk_factor = 0.0f; // RoPE NTK mix factor
float rope_extrapolation_factor = 0.0f; // RoPE extrapolation mix factor

// sampling parameters
std::unordered_map<llama_token, float> logit_bias; // logit bias for specific tokens
Expand Down
4 changes: 2 additions & 2 deletions ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -7005,7 +7005,7 @@ struct ggml_tensor * ggml_rope(
int n_dims,
int mode,
int n_ctx) {
return ggml_rope_impl(ctx, a, n_past, n_dims, mode, 10000.0f, 1.0f, 1.0f, 1.0f, n_ctx, false);
return ggml_rope_impl(ctx, a, n_past, n_dims, mode, 10000.0f, 1.0f, 0.0f, 0.0f, n_ctx, false);
}

struct ggml_tensor * ggml_rope_inplace(
Expand All @@ -7015,7 +7015,7 @@ struct ggml_tensor * ggml_rope_inplace(
int n_dims,
int mode,
int n_ctx) {
return ggml_rope_impl(ctx, a, n_past, n_dims, mode, 10000.0f, 1.0f, 1.0f, 1.0f, n_ctx, true);
return ggml_rope_impl(ctx, a, n_past, n_dims, mode, 10000.0f, 1.0f, 0.0f, 0.0f, n_ctx, true);
}

struct ggml_tensor * ggml_rope_custom_inplace(
Expand Down
8 changes: 4 additions & 4 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ struct llama_hparams {

float rope_freq_base = 10000.0f;
float rope_freq_scale = 1.0f;
float rope_ntk_factor = 1.0f;
float rope_extrapolation_factor = 1.0f;
float rope_ntk_factor = 0.0f;
float rope_extrapolation_factor = 0.0f;

enum llama_ftype ftype = LLAMA_FTYPE_MOSTLY_F16;

Expand Down Expand Up @@ -852,8 +852,8 @@ struct llama_context_params llama_context_default_params() {
/*.tensor_split =*/ {0},
/*.rope_freq_base =*/ 10000.0f,
/*.rope_freq_scale =*/ 1.0f,
/*.rope_ntk_factor =*/ 1.0f,
/*.rope_extrapolation_factor =*/ 1.0f,
/*.rope_ntk_factor =*/ 0.0f,
/*.rope_extrapolation_factor =*/ 0.0f,
/*.progress_callback =*/ nullptr,
/*.progress_callback_user_data =*/ nullptr,
/*.low_vram =*/ false,
Expand Down

0 comments on commit c62b01b

Please sign in to comment.