The model is loaded into the GPU, but inference is still performed through the CPU.
online2311 opened this issue · comments
Simon commented
Summary
[11:12 root@jupyterlab-0 /app]# wasmedge --dir .:. --nn-preload default:GGML:AUTO:Orca-2-13b-Q5_K_M.gguf llama-api-server.wasm --prompt-template chatml --model-name Orca-2-13b --socket-addr 0.0.0.0:7860 --log-prompts --log-stat
[INFO] Socket address: 0.0.0.0:7860
[INFO] Model name: Orca-2-13b
[INFO] Model alias: default
[INFO] Prompt context size: 512
[INFO] Number of tokens to predict: 1024
[INFO] Number of layers to run on the GPU: 100
[INFO] Batch size for prompt processing: 512
[INFO] Temperature for sampling: 0.8
[INFO] Penalize repeat sequence of tokens: 1.1
[INFO] Prompt template: ChatML
[INFO] Log prompts: true
[INFO] Log statistics: true
[INFO] Log all information: false
[INFO] Starting server ...
********************* [LOG: MODEL INFO (Load Model & Init Execution Context)] *********************
[2024-02-02 11:13:24.997] [info] [WASI-NN] GGML backend: LLAMA_COMMIT 6f9939d1
[2024-02-02 11:13:24.997] [info] [WASI-NN] GGML backend: LLAMA_BUILD_NUMBER 1953
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: NVIDIA GeForce RTX 2080 Ti, compute capability 7.5, VMM: yes
Device 1: NVIDIA GeForce RTX 2080 Ti, compute capability 7.5, VMM: yes
llama_model_loader: loaded meta data with 22 key-value pairs and 363 tensors from Orca-2-13b-Q5_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 = llama
llama_model_loader: - kv 1: general.name str = LLaMA v2
llama_model_loader: - kv 2: llama.context_length u32 = 4096
llama_model_loader: - kv 3: llama.embedding_length u32 = 5120
llama_model_loader: - kv 4: llama.block_count u32 = 40
llama_model_loader: - kv 5: llama.feed_forward_length u32 = 13824
llama_model_loader: - kv 6: llama.rope.dimension_count u32 = 128
llama_model_loader: - kv 7: llama.attention.head_count u32 = 40
llama_model_loader: - kv 8: llama.attention.head_count_kv u32 = 40
llama_model_loader: - kv 9: llama.attention.layer_norm_rms_epsilon f32 = 0.000010
llama_model_loader: - kv 10: llama.rope.freq_base f32 = 10000.000000
llama_model_loader: - kv 11: general.file_type u32 = 17
llama_model_loader: - kv 12: tokenizer.ggml.model str = llama
llama_model_loader: - kv 13: tokenizer.ggml.tokens arr[str,32003] = ["<unk>", "<s>", "</s>", "<0x00>", "<...
llama_model_loader: - kv 14: tokenizer.ggml.scores arr[f32,32003] = [0.000000, 0.000000, 0.000000, 0.0000...
llama_model_loader: - kv 15: tokenizer.ggml.token_type arr[i32,32003] = [2, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, ...
llama_model_loader: - kv 16: tokenizer.ggml.bos_token_id u32 = 1
llama_model_loader: - kv 17: tokenizer.ggml.eos_token_id u32 = 2
llama_model_loader: - kv 18: tokenizer.ggml.padding_token_id u32 = 0
llama_model_loader: - kv 19: tokenizer.ggml.add_bos_token bool = true
llama_model_loader: - kv 20: tokenizer.ggml.add_eos_token bool = false
llama_model_loader: - kv 21: general.quantization_version u32 = 2
llama_model_loader: - type f32: 81 tensors
llama_model_loader: - type q5_K: 241 tensors
llama_model_loader: - type q6_K: 41 tensors
llm_load_vocab: special tokens definition check successful ( 262/32003 ).
llm_load_print_meta: format = GGUF V3 (latest)
llm_load_print_meta: arch = llama
llm_load_print_meta: vocab type = SPM
llm_load_print_meta: n_vocab = 32003
llm_load_print_meta: n_merges = 0
llm_load_print_meta: n_ctx_train = 4096
llm_load_print_meta: n_embd = 5120
llm_load_print_meta: n_head = 40
llm_load_print_meta: n_head_kv = 40
llm_load_print_meta: n_layer = 40
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 = 5120
llm_load_print_meta: n_embd_v_gqa = 5120
llm_load_print_meta: f_norm_eps = 0.0e+00
llm_load_print_meta: f_norm_rms_eps = 1.0e-05
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 = 13824
llm_load_print_meta: n_expert = 0
llm_load_print_meta: n_expert_used = 0
llm_load_print_meta: rope scaling = linear
llm_load_print_meta: freq_base_train = 10000.0
llm_load_print_meta: freq_scale_train = 1
llm_load_print_meta: n_yarn_orig_ctx = 4096
llm_load_print_meta: rope_finetuned = unknown
llm_load_print_meta: model type = 13B
llm_load_print_meta: model ftype = Q5_K - Medium
llm_load_print_meta: model params = 13.02 B
llm_load_print_meta: model size = 8.60 GiB (5.67 BPW)
llm_load_print_meta: general.name = LLaMA v2
llm_load_print_meta: BOS token = 1 '<s>'
llm_load_print_meta: EOS token = 2 '</s>'
llm_load_print_meta: UNK token = 0 '<unk>'
llm_load_print_meta: PAD token = 0 '<unk>'
llm_load_print_meta: LF token = 13 '<0x0A>'
llm_load_tensors: ggml ctx size = 0.42 MiB
llm_load_tensors: offloading 40 repeating layers to GPU
llm_load_tensors: offloading non-repeating layers to GPU
llm_load_tensors: offloaded 41/41 layers to GPU
llm_load_tensors: CPU buffer size = 107.43 MiB
llm_load_tensors: CUDA0 buffer size = 4491.02 MiB
llm_load_tensors: CUDA1 buffer size = 4203.21 MiB
...................................................................................................
[2024-02-02 11:13:27.366] [info] [WASI-NN] GGML backend: llama_system_info: 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 |
[INFO] Plugin version: b1953 (commit 6f9939d1)
****************************************************************************************************
[INFO] Listening on http://0.0.0.0:7860
llama_new_context_with_model: n_ctx = 512
llama_new_context_with_model: freq_base = 10000.0
llama_new_context_with_model: freq_scale = 1
llama_kv_cache_init: CUDA0 KV buffer size = 210.00 MiB
llama_kv_cache_init: CUDA1 KV buffer size = 190.00 MiB
llama_new_context_with_model: KV self size = 400.00 MiB, K (f16): 200.00 MiB, V (f16): 200.00 MiB
llama_new_context_with_model: graph splits (measure): 5
llama_new_context_with_model: CUDA0 compute buffer size = 91.00 MiB
llama_new_context_with_model: CUDA1 compute buffer size = 91.00 MiB
llama_new_context_with_model: CUDA_Host compute buffer size = 11.00 MiB
****************************************** [LOG: PROMPT] ******************************************
<|im_start|>system
Answer as concisely as possible.<|im_end|>
<|im_start|>user
你好,你是谁?<|im_end|>
<|im_start|>assistant
Hello, I am a chatbot that can help answer your questions and provide information.<|im_end|>
<|im_start|>user
你能帮助我做什么<|im_end|>
<|im_start|>assistant
I can help you with various tasks such as answering questions, providing information, translating text, and more.<|im_end|>
<|im_start|>user
你可以中文回答的问题吗?<|im_end|>
<|im_start|>assistant
****************************************************************************************************
llama_new_context_with_model: n_ctx = 512
llama_new_context_with_model: freq_base = 10000.0
llama_new_context_with_model: freq_scale = 1
llama_kv_cache_init: CUDA0 KV buffer size = 210.00 MiB
llama_kv_cache_init: CUDA1 KV buffer size = 190.00 MiB
llama_new_context_with_model: KV self size = 400.00 MiB, K (f16): 200.00 MiB, V (f16): 200.00 MiB
llama_new_context_with_model: graph splits (measure): 5
llama_new_context_with_model: CUDA0 compute buffer size = 91.00 MiB
llama_new_context_with_model: CUDA1 compute buffer size = 91.00 MiB
llama_new_context_with_model: CUDA_Host compute buffer size = 11.00 MiB
llama_new_context_with_model: n_ctx = 512
llama_new_context_with_model: freq_base = 10000.0
llama_new_context_with_model: freq_scale = 1
llama_kv_cache_init: CUDA0 KV buffer size = 210.00 MiB
llama_kv_cache_init: CUDA1 KV buffer size = 190.00 MiB
llama_new_context_with_model: KV self size = 400.00 MiB, K (f16): 200.00 MiB, V (f16): 200.00 MiB
llama_new_context_with_model: graph splits (measure): 5
llama_new_context_with_model: CUDA0 compute buffer size = 91.00 MiB
llama_new_context_with_model: CUDA1 compute buffer size = 91.00 MiB
llama_new_context_with_model: CUDA_Host compute buffer size = 11.00 MiB
[2024-02-02 11:13:36.526] [info] [WASI-NN] GGML backend: EOS token found
[2024-02-02 11:13:38.566] [info] [WASI-NN] GGML backend: EOS token found
Appendix
No response