abetlen / abetlen/llama-cpp-python

Qwen 72B GGUF needs manual rope frequency with llama-cpp-python, llama.cpp gets it right

Ouverte
#1,271 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
Python
Étoiles
10.6k
Forks
1.4k
Métriques de merge des PR
Métriques de PR en attente

Description

Running the official Qwen 72B GGUF gives no output with tokens bigger then ~2000 tokens, while running the same prompt through llama.cpp with the same settings directly does give output.

I tried reinstalling and building everything from scratch but the problem stays the same. Running the exact same code with Mixtral works fine.

```
llm = LlamaCpp(
model_kwargs={"split_mode": 2, "tensor_split": [40, 60], "offload_kqv": False},
model_path="/models/Liberated-Qwen1.5-72B-Q3_K_M.gguf",
n_gpu_layers=1000,
n_batch=256,
n_threads=20,
verbose=True,
n_ctx=12000,
max_tokens=30000,
temperature=0.7
)

output = llm(
file_content, # Prompt
max_tokens=3200, # Generate up to 32 tokens, set to None to generate up to the end of the context window
stop=["<|im_end|>"], # Stop generating just before the model would generate a new question
echo=True # Echo the prompt back in the output
) # Generate a completion, can also call create_completion
```

```
ggml_init_cublas: GGML_CUDA_FORCE_MMQ: no
ggml_init_cublas: CUDA_USE_TENSOR_CORES: yes
ggml_init_cublas: found 2 CUDA devices:
Device 0: Tesla P40, compute capability 6.1, VMM: yes
Device 1: Tesla P40, compute capability 6.1, VMM: yes
llama_model_loader: loaded meta data with 21 key-value pairs and 963 tensors from /models/qwen1_5-72b-chat-q3_k_m.gguf (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv 0: general.architecture str = qwen2
llama_model_loader: - kv 1: general.name str = Qwen1.5-72B-Chat-AWQ-fp16
llama_model_loader: - kv 2: qwen2.block_count u32 = 80
llama_model_loader: - kv 3: qwen2.context_length u32 = 32768
llama_model_loader: - kv 4: qwen2.embedding_length u32 = 8192
llama_model_loader: - kv 5: qwen2.feed_forward_length u32 = 24576
llama_model_loader: - kv 6: qwen2.attention.head_count u32 = 64
llama_model_loader: - kv 7: qwen2.attention.head_count_kv u32 = 64
llama_model_loader: - kv 8: qwen2.attention.layer_norm_rms_epsilon f32 = 0.000001
llama_model_loader: - kv 9: qwen2.rope.freq_base f32 = 1000000.000000
llama_model_loader: - kv 10: qwen2.use_parallel_residual bool = true
llama_model_loader: - kv 11: tokenizer.ggml.model str = gpt2
llama_model_loader: - kv 12: tokenizer.ggml.tokens arr[str,152064] = ["!", "\"", "#", "$", "%", "&", "'", ...
llama_model_loader: - kv 13: tokenizer.ggml.token_type arr[i32,152064] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
llama_model_loader: - kv 14: tokenizer.ggml.merges arr[str,151387] = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",...
llama_model_loader: - kv 15: tokenizer.ggml.eos_token_id u32 = 151645
llama_model_loader: - kv 16: tokenizer.ggml.padding_token_id u32 = 151643
llama_model_loader: - kv 17: tokenizer.ggml.bos_token_id u32 = 151643
llama_model_loader: - kv 18: tokenizer.chat_template str = {% for message in messages %}{{'<|im_...
llama_model_loader: - kv 19: general.quantization_version u32 = 2
llama_model_loader: - kv 20: general.file_type u32 = 12
llama_model_loader: - type f32: 401 tensors
llama_model_loader: - type q3_K: 321 tensors
llama_model_loader: - type q4_K: 155 tensors
llama_model_loader: - type q5_K: 85 tensors
llama_model_loader: - type q6_K: 1 tensors
llm_load_vocab: special tokens definition check successful ( 421/152064 ).
llm_load_print_meta: format = GGUF V3 (latest)
llm_load_print_meta: arch = qwen2
llm_load_print_meta: vocab type = BPE
llm_load_print_meta: n_vocab = 152064
llm_load_print_meta: n_merges = 151387
llm_load_print_meta: n_ctx_train = 32768
llm_load_print_meta: n_embd = 8192
llm_load_print_meta: n_head = 64
llm_load_print_meta: n_head_kv = 64
llm_load_print_meta: n_layer = 80
llm_load_print_meta: n_rot = 128
llm_load_print_meta: n_embd_head_k = 128
llm_load_print_meta: n_embd_head_v = 128
llm_load_print_meta: n_gqa = 1
llm_load_print_meta: n_embd_k_gqa = 8192
llm_load_print_meta: n_embd_v_gqa = 8192
llm_load_print_meta: f_norm_eps = 0.0e+00
llm_load_print_meta: f_norm_rms_eps = 1.0e-06
llm_load_print_meta: f_clamp_kqv = 0.0e+00
llm_load_print_meta: f_max_alibi_bias = 0.0e+00
llm_load_print_meta: n_ff = 24576
llm_load_print_meta: n_expert = 0
llm_load_print_meta: n_expert_used = 0
llm_load_print_meta: pooling type = 0
llm_load_print_meta: rope type = 2
llm_load_print_meta: rope scaling = linear
llm_load_print_meta: freq_base_train = 1000000.0
llm_load_print_meta: freq_scale_train = 1
llm_load_print_meta: n_yarn_orig_ctx = 32768
llm_load_print_meta: rope_finetuned = unknown
llm_load_print_meta: ssm_d_conv = 0
llm_load_print_meta: ssm_d_inner = 0
llm_load_print_meta: ssm_d_state = 0
llm_load_print_meta: ssm_dt_rank = 0
llm_load_print_meta: model type = 70B
llm_load_print_meta: model ftype = Q3_K - Medium
llm_load_print_meta: model params = 72.29 B
llm_load_print_meta: model size = 33.45 GiB (3.98 BPW)
llm_load_print_meta: general.name = Qwen1.5-72B-Chat-AWQ-fp16
llm_load_print_meta: BOS token = 151643 '<|endoftext|>'
llm_load_print_meta: EOS token = 151645 '<|im_end|>'
llm_load_print_meta: PAD token = 151643 '<|endoftext|>'
llm_load_print_meta: LF token = 148848 'ÄĬ'
llm_load_tensors: ggml ctx size = 1.10 MiB
llm_load_tensors: offloading 80 repeating layers to GPU
llm_load_tensors: offloading non-repeating layers to GPU
llm_load_tensors: offloaded 81/81 layers to GPU
llm_load_tensors: CUDA_Split buffer size = 33734.53 MiB
llm_load_tensors: CPU buffer size = 510.47 MiB
llm_load_tensors: CUDA0 buffer size = 12.53 MiB
...................................................................................................
llama_new_context_with_model: n_ctx = 12000
llama_new_context_with_model: freq_base = 10000.0
llama_new_context_with_model: freq_scale = 1
llama_kv_cache_init: CUDA_Host KV buffer size = 30000.00 MiB
llama_new_context_with_model: KV self size = 30000.00 MiB, K (f16): 15000.00 MiB, V (f16): 15000.00 MiB
llama_new_context_with_model: CUDA_Host input buffer size = 20.06 MiB
llama_new_context_with_model: CUDA0 compute buffer size = 2092.50 MiB
llama_new_context_with_model: CUDA_Host compute buffer size = 2678.00 MiB
llama_new_context_with_model: graph splits (measure): 162
AVX = 1 | AVX_VNNI = 0 | AVX2 = 1 | AVX512 = 0 | AVX512_VBMI = 0 | AVX512_VNNI = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 1 | SSSE3 = 1 | VSX = 0 | MATMUL_INT8 = 0 |
Model metadata: {'general.file_type': '12', 'tokenizer.ggml.bos_token_id': '151643', 'general.architecture': 'qwen2', 'general.name': 'Qwen1.5-72B-Chat-AWQ-fp16', 'qwen2.block_count': '80', 'qwen2.context_length': '32768', 'tokenizer.chat_template': "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}", 'qwen2.attention.head_count_kv': '64', 'tokenizer.ggml.padding_token_id': '151643', 'qwen2.embedding_length': '8192', 'qwen2.attention.layer_norm_rms_epsilon': '0.000001', 'qwen2.attention.head_count': '64', 'tokenizer.ggml.eos_token_id': '151645', 'qwen2.rope.freq_base': '1000000.000000', 'qwen2.use_parallel_residual': 'true', 'general.quantization_version': '2', 'qwen2.feed_forward_length': '24576', 'tokenizer.ggml.model': 'gpt2'}
```

==============================>

```
llama_print_timings: load time = 12511.09 ms
llama_print_timings: sample time = 3.70 ms / 1 runs ( 3.70 ms per token, 270.05 tokens per second)
llama_print_timings: prompt eval time = 146351.02 ms / 2617 tokens ( 55.92 ms per token, 17.88 tokens per second)
llama_print_timings: eval time = 0.00 ms / 1 runs ( 0.00 ms per token, inf tokens per second)
llama_print_timings: total time = 146604.53 ms / 2618 tokens
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.