Skip to content

Bug: rope-scale and rope-scaling parameters not being parsed in llama.cpp server #10355

Description

@henryclw

What happened?

I'm running llama.cpp server with docker. My docker compose command set as the following:

services:
  llama-cpp:
    image: ghcr.io/ggerganov/llama.cpp:server-cuda
    command: ["-m", "/models/Qwen2.5-7B-Instruct-Q4_K_M.gguf", "--port", "8000", "--n-gpu-layers", "49", "--no-mmap", "--ctx-size", "131072", "--rope-scaling", "yarn", "--rope-scale", "4", "--flash-attn"]
    environment:
      LLAMA_ARG_ROPE_SCALING_TYPE: yarn
      LLAMA_ARG_ROPE_SCALE: 4

Expectation: the rope scaling type should set to yarn and the rope scale should set to 4
Current result: the rope scaling type is still linear and the scale is still 2, which are all the default options

P.S. I even set the environment variables, and the log showed:

2024-11-17 00:33:21 warn: LLAMA_ARG_ROPE_SCALING_TYPE environment variable is set, but will be overwritten by command line argument --rope-scaling
2024-11-17 00:33:21 warn: LLAMA_ARG_ROPE_SCALE environment variable is set, but will be overwritten by command line argument --rope-scale

But somehow things still didn't work

Name and Version

build: 4112 (eda7e1d) with cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 for x86_64-linux-gnu

What operating system are you seeing the problem on?

Linux, Windows

Relevant log output

2024-11-17 00:33:21 ggml_cuda_init: GGML_CUDA_FORCE_MMQ:    no
2024-11-17 00:33:21 ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
2024-11-17 00:33:21 ggml_cuda_init: found 1 CUDA devices:
2024-11-17 00:33:21   Device 0: NVIDIA GeForce RTX 3060, compute capability 8.6, VMM: yes
2024-11-17 00:33:21 warn: LLAMA_ARG_ROPE_SCALING_TYPE environment variable is set, but will be overwritten by command line argument --rope-scaling
2024-11-17 00:33:21 warn: LLAMA_ARG_ROPE_SCALE environment variable is set, but will be overwritten by command line argument --rope-scale
2024-11-17 00:33:21 build: 4112 (eda7e1d4) with cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 for x86_64-linux-gnu
2024-11-17 00:33:21 system info: n_threads = 8, n_threads_batch = 8, total_threads = 16
2024-11-17 00:33:21 
2024-11-17 00:33:21 system_info: n_threads = 8 (n_threads_batch = 8) / 16 | AVX = 1 | AVX_VNNI = 0 | AVX2 = 1 | AVX512 = 0 | AVX512_VBMI = 0 | AVX512_VNNI = 0 | AVX512_BF16 = 0 | AMX_INT8 = 0 | FMA = 1 | NEON = 0 | SVE = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | RISCV_VECT = 0 | WASM_SIMD = 0 | SSE3 = 1 | SSSE3 = 1 | VSX = 0 | MATMUL_INT8 = 0 | LLAMAFILE = 1 | 
2024-11-17 00:33:21 
2024-11-17 00:33:21 main: HTTP server is listening, hostname: 0.0.0.0, port: 8000, http threads: 15
2024-11-17 00:33:21 main: loading model
2024-11-17 00:33:22 llama_load_model_from_file: using device CUDA0 (NVIDIA GeForce RTX 3060) - 11247 MiB free
2024-11-17 00:33:22 llama_model_loader: loaded meta data with 34 key-value pairs and 339 tensors from /models/Qwen2.5-7B-Instruct-Q4_K_M.gguf (version GGUF V3 (latest))
2024-11-17 00:33:22 llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
2024-11-17 00:33:22 llama_model_loader: - kv   0:                       general.architecture str              = qwen2
2024-11-17 00:33:22 llama_model_loader: - kv   1:                               general.type str              = model
2024-11-17 00:33:22 llama_model_loader: - kv   2:                               general.name str              = Qwen2.5 7B Instruct
2024-11-17 00:33:22 llama_model_loader: - kv   3:                           general.finetune str              = Instruct
2024-11-17 00:33:22 llama_model_loader: - kv   4:                           general.basename str              = Qwen2.5
2024-11-17 00:33:22 llama_model_loader: - kv   5:                         general.size_label str              = 7B
2024-11-17 00:33:22 llama_model_loader: - kv   6:                            general.license str              = apache-2.0
2024-11-17 00:33:22 llama_model_loader: - kv   7:                       general.license.link str              = https://huggingface.co/Qwen/Qwen2.5-7...
2024-11-17 00:33:22 llama_model_loader: - kv   8:                   general.base_model.count u32              = 1
2024-11-17 00:33:22 llama_model_loader: - kv   9:                  general.base_model.0.name str              = Qwen2.5 7B
2024-11-17 00:33:22 llama_model_loader: - kv  10:          general.base_model.0.organization str              = Qwen
2024-11-17 00:33:22 llama_model_loader: - kv  11:              general.base_model.0.repo_url str              = https://huggingface.co/Qwen/Qwen2.5-7B
2024-11-17 00:33:22 llama_model_loader: - kv  12:                               general.tags arr[str,2]       = ["chat", "text-generation"]
2024-11-17 00:33:22 llama_model_loader: - kv  13:                          general.languages arr[str,1]       = ["en"]
2024-11-17 00:33:22 llama_model_loader: - kv  14:                          qwen2.block_count u32              = 28
2024-11-17 00:33:22 llama_model_loader: - kv  15:                       qwen2.context_length u32              = 32768
2024-11-17 00:33:22 llama_model_loader: - kv  16:                     qwen2.embedding_length u32              = 3584
2024-11-17 00:33:22 llama_model_loader: - kv  17:                  qwen2.feed_forward_length u32              = 18944
2024-11-17 00:33:22 llama_model_loader: - kv  18:                 qwen2.attention.head_count u32              = 28
2024-11-17 00:33:22 llama_model_loader: - kv  19:              qwen2.attention.head_count_kv u32              = 4
2024-11-17 00:33:22 llama_model_loader: - kv  20:                       qwen2.rope.freq_base f32              = 1000000.000000
2024-11-17 00:33:22 llama_model_loader: - kv  21:     qwen2.attention.layer_norm_rms_epsilon f32              = 0.000001
2024-11-17 00:33:22 llama_model_loader: - kv  22:                          general.file_type u32              = 15
2024-11-17 00:33:22 llama_model_loader: - kv  23:                       tokenizer.ggml.model str              = gpt2
2024-11-17 00:33:22 llama_model_loader: - kv  24:                         tokenizer.ggml.pre str              = qwen2
2024-11-17 00:33:22 llama_model_loader: - kv  25:                      tokenizer.ggml.tokens arr[str,152064]  = ["!", "\"", "#", "$", "%", "&", "'", ...
2024-11-17 00:33:22 llama_model_loader: - kv  26:                  tokenizer.ggml.token_type arr[i32,152064]  = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
2024-11-17 00:33:22 llama_model_loader: - kv  27:                      tokenizer.ggml.merges arr[str,151387]  = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
2024-11-17 00:33:22 llama_model_loader: - kv  28:                tokenizer.ggml.eos_token_id u32              = 151645
2024-11-17 00:33:22 llama_model_loader: - kv  29:            tokenizer.ggml.padding_token_id u32              = 151643
2024-11-17 00:33:22 llama_model_loader: - kv  30:                tokenizer.ggml.bos_token_id u32              = 151643
2024-11-17 00:33:22 llama_model_loader: - kv  31:               tokenizer.ggml.add_bos_token bool             = false
2024-11-17 00:33:22 llama_model_loader: - kv  32:                    tokenizer.chat_template str              = {%- if tools %}\n    {{- '<|im_start|>...
2024-11-17 00:33:22 llama_model_loader: - kv  33:               general.quantization_version u32              = 2
2024-11-17 00:33:22 llama_model_loader: - type  f32:  141 tensors
2024-11-17 00:33:22 llama_model_loader: - type q4_K:  169 tensors
2024-11-17 00:33:22 llama_model_loader: - type q6_K:   29 tensors
2024-11-17 00:33:23 llm_load_vocab: special tokens cache size = 22
2024-11-17 00:33:23 llm_load_vocab: token to piece cache size = 0.9310 MB
2024-11-17 00:33:23 llm_load_print_meta: format           = GGUF V3 (latest)
2024-11-17 00:33:23 llm_load_print_meta: arch             = qwen2
2024-11-17 00:33:23 llm_load_print_meta: vocab type       = BPE
2024-11-17 00:33:23 llm_load_print_meta: n_vocab          = 152064
2024-11-17 00:33:23 llm_load_print_meta: n_merges         = 151387
2024-11-17 00:33:23 llm_load_print_meta: vocab_only       = 0
2024-11-17 00:33:23 llm_load_print_meta: n_ctx_train      = 32768
2024-11-17 00:33:23 llm_load_print_meta: n_embd           = 3584
2024-11-17 00:33:23 llm_load_print_meta: n_layer          = 28
2024-11-17 00:33:23 llm_load_print_meta: n_head           = 28
2024-11-17 00:33:23 llm_load_print_meta: n_head_kv        = 4
2024-11-17 00:33:23 llm_load_print_meta: n_rot            = 128
2024-11-17 00:33:23 llm_load_print_meta: n_swa            = 0
2024-11-17 00:33:23 llm_load_print_meta: n_embd_head_k    = 128
2024-11-17 00:33:23 llm_load_print_meta: n_embd_head_v    = 128
2024-11-17 00:33:23 llm_load_print_meta: n_gqa            = 7
2024-11-17 00:33:23 llm_load_print_meta: n_embd_k_gqa     = 512
2024-11-17 00:33:23 llm_load_print_meta: n_embd_v_gqa     = 512
2024-11-17 00:33:23 llm_load_print_meta: f_norm_eps       = 0.0e+00
2024-11-17 00:33:23 llm_load_print_meta: f_norm_rms_eps   = 1.0e-06
2024-11-17 00:33:23 llm_load_print_meta: f_clamp_kqv      = 0.0e+00
2024-11-17 00:33:23 llm_load_print_meta: f_max_alibi_bias = 0.0e+00
2024-11-17 00:33:23 llm_load_print_meta: f_logit_scale    = 0.0e+00
2024-11-17 00:33:23 llm_load_print_meta: n_ff             = 18944
2024-11-17 00:33:23 llm_load_print_meta: n_expert         = 0
2024-11-17 00:33:23 llm_load_print_meta: n_expert_used    = 0
2024-11-17 00:33:23 llm_load_print_meta: causal attn      = 1
2024-11-17 00:33:23 llm_load_print_meta: pooling type     = 0
2024-11-17 00:33:23 llm_load_print_meta: rope type        = 2
2024-11-17 00:33:23 llm_load_print_meta: rope scaling     = linear
2024-11-17 00:33:23 llm_load_print_meta: freq_base_train  = 1000000.0
2024-11-17 00:33:23 llm_load_print_meta: freq_scale_train = 1
2024-11-17 00:33:23 llm_load_print_meta: n_ctx_orig_yarn  = 32768
2024-11-17 00:33:23 llm_load_print_meta: rope_finetuned   = unknown
2024-11-17 00:33:23 llm_load_print_meta: ssm_d_conv       = 0
2024-11-17 00:33:23 llm_load_print_meta: ssm_d_inner      = 0
2024-11-17 00:33:23 llm_load_print_meta: ssm_d_state      = 0
2024-11-17 00:33:23 llm_load_print_meta: ssm_dt_rank      = 0
2024-11-17 00:33:23 llm_load_print_meta: ssm_dt_b_c_rms   = 0
2024-11-17 00:33:23 llm_load_print_meta: model type       = 7B
2024-11-17 00:33:23 llm_load_print_meta: model ftype      = Q4_K - Medium
2024-11-17 00:33:23 llm_load_print_meta: model params     = 7.62 B
2024-11-17 00:33:23 llm_load_print_meta: model size       = 4.36 GiB (4.91 BPW) 
2024-11-17 00:33:23 llm_load_print_meta: general.name     = Qwen2.5 7B Instruct
2024-11-17 00:33:23 llm_load_print_meta: BOS token        = 151643 '<|endoftext|>'
2024-11-17 00:33:23 llm_load_print_meta: EOS token        = 151645 '<|im_end|>'
2024-11-17 00:33:23 llm_load_print_meta: EOT token        = 151645 '<|im_end|>'
2024-11-17 00:33:23 llm_load_print_meta: PAD token        = 151643 '<|endoftext|>'
2024-11-17 00:33:23 llm_load_print_meta: LF token         = 148848 'ÄĬ'
2024-11-17 00:33:23 llm_load_print_meta: FIM PRE token    = 151659 '<|fim_prefix|>'
2024-11-17 00:33:23 llm_load_print_meta: FIM SUF token    = 151661 '<|fim_suffix|>'
2024-11-17 00:33:23 llm_load_print_meta: FIM MID token    = 151660 '<|fim_middle|>'
2024-11-17 00:33:23 llm_load_print_meta: FIM PAD token    = 151662 '<|fim_pad|>'
2024-11-17 00:33:23 llm_load_print_meta: FIM REP token    = 151663 '<|repo_name|>'
2024-11-17 00:33:23 llm_load_print_meta: FIM SEP token    = 151664 '<|file_sep|>'
2024-11-17 00:33:23 llm_load_print_meta: EOG token        = 151643 '<|endoftext|>'
2024-11-17 00:33:23 llm_load_print_meta: EOG token        = 151645 '<|im_end|>'
2024-11-17 00:33:23 llm_load_print_meta: EOG token        = 151662 '<|fim_pad|>'
2024-11-17 00:33:23 llm_load_print_meta: EOG token        = 151663 '<|repo_name|>'
2024-11-17 00:33:23 llm_load_print_meta: EOG token        = 151664 '<|file_sep|>'
2024-11-17 00:33:23 llm_load_print_meta: max token length = 256
2024-11-17 00:33:23 llm_load_tensors: offloading 28 repeating layers to GPU
2024-11-17 00:33:23 llm_load_tensors: offloading output layer to GPU
2024-11-17 00:33:23 llm_load_tensors: offloaded 29/29 layers to GPU
2024-11-17 00:33:23 llm_load_tensors:        CUDA0 model buffer size =  4168.09 MiB
2024-11-17 00:33:23 llm_load_tensors:          CPU model buffer size =   292.36 MiB
2024-11-17 00:34:09 .................................................................................
2024-11-17 00:34:09 llama_new_context_with_model: n_seq_max     = 1
2024-11-17 00:34:09 llama_new_context_with_model: n_ctx         = 131072
2024-11-17 00:34:09 llama_new_context_with_model: n_ctx_per_seq = 131072
2024-11-17 00:34:09 llama_new_context_with_model: n_batch       = 2048
2024-11-17 00:34:09 llama_new_context_with_model: n_ubatch      = 512
2024-11-17 00:34:09 llama_new_context_with_model: flash_attn    = 1
2024-11-17 00:34:09 llama_new_context_with_model: freq_base     = 1000000.0
2024-11-17 00:34:09 llama_new_context_with_model: freq_scale    = 0.25
2024-11-17 00:34:09 llama_new_context_with_model: n_ctx_pre_seq (131072) > n_ctx_train (32768) -- possible training context overflow
2024-11-17 00:34:09 llama_kv_cache_init:      CUDA0 KV buffer size =  7168.00 MiB
2024-11-17 00:34:09 llama_new_context_with_model: KV self size  = 7168.00 MiB, K (f16): 3584.00 MiB, V (f16): 3584.00 MiB
2024-11-17 00:34:09 llama_new_context_with_model:  CUDA_Host  output buffer size =     0.58 MiB
2024-11-17 00:34:10 llama_new_context_with_model:      CUDA0 compute buffer size =   412.00 MiB
2024-11-17 00:34:10 llama_new_context_with_model:  CUDA_Host compute buffer size =   263.01 MiB
2024-11-17 00:34:10 llama_new_context_with_model: graph nodes  = 875
2024-11-17 00:34:10 llama_new_context_with_model: graph splits = 2
2024-11-17 00:34:10 common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-unconfirmedmedium severityUsed to report medium severity bugs in llama.cpp (e.g. Malfunctioning Features but still useable)stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions