inference icon indicating copy to clipboard operation
inference copied to clipboard

llama 加载gguf模型报错

Open pkusub opened this issue 7 months ago • 3 comments

System Info / 系統信息

docker,两块4090,在14.1版本还能正常启动,更新就出问题了

Running Xinference with Docker? / 是否使用 Docker 运行 Xinfernece?

  • [x] docker / docker
  • [ ] pip install / 通过 pip install 安装
  • [ ] installation from source / 从源码安装

Version info / 版本信息

xprobe/xinference:v1.5.0.post2

The command used to start Xinference / 用以启动 xinference 的命令

docker run
-v /home/pc/docker/ollama-intel-gpu/models:/root/.xinference
-p 9997:9997
--gpus all
xprobe/xinference:latest
xinference-local -H 0.0.0.0

Reproduction / 复现过程

INFO 04-27 02:22:17 [init.py:239] Automatically detected platform cuda. 2025-04-27 02:22:18,621 xinference.core.supervisor 77 INFO Xinference supervisor 0.0.0.0:59830 started 2025-04-27 02:22:18,652 xinference.core.worker 77 INFO Starting metrics export server at 0.0.0.0:None 2025-04-27 02:22:18,653 xinference.core.worker 77 INFO Checking metrics export server... 2025-04-27 02:22:21,194 xinference.core.worker 77 INFO Metrics server is started at: http://0.0.0.0:36689 2025-04-27 02:22:21,195 xinference.core.worker 77 INFO Purge cache directory: /root/.xinference/cache 2025-04-27 02:22:21,196 xinference.core.worker 77 INFO Connected to supervisor as a fresh worker 2025-04-27 02:22:21,204 xinference.core.worker 77 INFO Xinference worker 0.0.0.0:59830 started 2025-04-27 02:22:24,469 xinference.api.restful_api 1 INFO Starting Xinference at endpoint: http://0.0.0.0:9997 2025-04-27 02:22:24,513 uvicorn.error 1 INFO Uvicorn running on http://0.0.0.0:9997 (Press CTRL+C to quit) 2025-04-27 02:22:54,951 xinference.core.worker 77 INFO [request 3358ac50-2349-11f0-bcdb-62819934ba1c] Enter launch_builtin_model, args: <xinference.core.worker.WorkerActor object at 0x71dc5ab359e0>, kwargs: model_uid=QwQ-32B-Q8-0,model_name=QwQ-32B-Q8,model_size_in_billions=32,model_format=ggufv2,quantization=Q8_0,model_engine=llama.cpp,model_type=LLM,n_gpu=2,request_limits=None,peft_model_config=None,gpu_idx=None,download_hub=None,model_path=None,xavier_config=None 2025-04-27 02:22:55,444 xinference.model.llm.llm_family 77 INFO Caching from URI: /root/.xinference/QwQ-32B 2025-04-27 02:22:55,445 xinference.model.llm.llm_family 77 INFO Cache /root/.xinference/QwQ-32B exists INFO 04-27 02:22:57 [init.py:239] Automatically detected platform cuda. 2025-04-27 02:22:58,856 xinference.core.model 96 INFO Start requests handler. build: 1 (526739b) with cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 for x86_64-linux-gnu system info: n_threads = 32, n_threads_batch = 32, total_threads = 32

ggml_cuda_init: GGML_CUDA_FORCE_MMQ: yes ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no ggml_cuda_init: found 2 CUDA devices: Device 0: NVIDIA GeForce RTX 4090, compute capability 8.9, VMM: yes Device 1: NVIDIA GeForce RTX 4090, compute capability 8.9, VMM: yes system_info: n_threads = 32 (n_threads_batch = 32) / 32 | CUDA : ARCHS = 520 | FORCE_MMQ = 1 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | LLAMAFILE = 1 | OPENMP = 1 | AARCH64_REPACK = 1 |

init: loading model srv load_model: loading model '/root/.xinference/QwQ-32B/QwQ-32B-Q8_0.gguf' llama_model_load_from_file_impl: using device CUDA0 (NVIDIA GeForce RTX 4090) - 46898 MiB free llama_model_load_from_file_impl: using device CUDA1 (NVIDIA GeForce RTX 4090) - 48244 MiB free llama_model_loader: loaded meta data with 33 key-value pairs and 771 tensors from /root/.xinference/QwQ-32B/QwQ-32B-Q8_0.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.type str = model llama_model_loader: - kv 2: general.name str = QwQ 32B llama_model_loader: - kv 3: general.basename str = QwQ llama_model_loader: - kv 4: general.size_label str = 32B llama_model_loader: - kv 5: general.license str = apache-2.0 llama_model_loader: - kv 6: general.license.link str = https://huggingface.co/Qwen/QWQ-32B/b... llama_model_loader: - kv 7: general.base_model.count u32 = 1 llama_model_loader: - kv 8: general.base_model.0.name str = Qwen2.5 32B llama_model_loader: - kv 9: general.base_model.0.organization str = Qwen llama_model_loader: - kv 10: general.base_model.0.repo_url str = https://huggingface.co/Qwen/Qwen2.5-32B llama_model_loader: - kv 11: general.tags arr[str,2] = ["chat", "text-generation"] llama_model_loader: - kv 12: general.languages arr[str,1] = ["en"] llama_model_loader: - kv 13: qwen2.block_count u32 = 64 llama_model_loader: - kv 14: qwen2.context_length u32 = 131072 llama_model_loader: - kv 15: qwen2.embedding_length u32 = 5120 llama_model_loader: - kv 16: qwen2.feed_forward_length u32 = 27648 llama_model_loader: - kv 17: qwen2.attention.head_count u32 = 40 llama_model_loader: - kv 18: qwen2.attention.head_count_kv u32 = 8 llama_model_loader: - kv 19: qwen2.rope.freq_base f32 = 1000000.000000 llama_model_loader: - kv 20: qwen2.attention.layer_norm_rms_epsilon f32 = 0.000010 llama_model_loader: - kv 21: general.file_type u32 = 7 llama_model_loader: - kv 22: tokenizer.ggml.model str = gpt2 llama_model_loader: - kv 23: tokenizer.ggml.pre str = qwen2 llama_model_loader: - kv 24: tokenizer.ggml.tokens arr[str,152064] = ["!", """, "#", "$", "%", "&", "'", ... llama_model_loader: - kv 25: tokenizer.ggml.token_type arr[i32,152064] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... llama_model_loader: - kv 26: tokenizer.ggml.merges arr[str,151387] = ["Ġ Ġ", "ĠĠ ĠĠ", "i n", "Ġ t",... llama_model_loader: - kv 27: tokenizer.ggml.eos_token_id u32 = 151645 llama_model_loader: - kv 28: tokenizer.ggml.padding_token_id u32 = 151643 llama_model_loader: - kv 29: tokenizer.ggml.bos_token_id u32 = 151643 llama_model_loader: - kv 30: tokenizer.ggml.add_bos_token bool = false llama_model_loader: - kv 31: tokenizer.chat_template str = {%- if tools %}\n {{- '<|im_start|>... llama_model_loader: - kv 32: general.quantization_version u32 = 2 llama_model_loader: - type f32: 321 tensors llama_model_loader: - type q8_0: 450 tensors print_info: file format = GGUF V3 (latest) print_info: file type = Q8_0 print_info: file size = 32.42 GiB (8.50 BPW) load: special tokens cache size = 26 load: token to piece cache size = 0.9311 MB print_info: arch = qwen2 print_info: vocab_only = 0 print_info: n_ctx_train = 131072 print_info: n_embd = 5120 print_info: n_layer = 64 print_info: n_head = 40 print_info: n_head_kv = 8 print_info: n_rot = 128 print_info: n_swa = 0 print_info: n_swa_pattern = 1 print_info: n_embd_head_k = 128 print_info: n_embd_head_v = 128 print_info: n_gqa = 5 print_info: n_embd_k_gqa = 1024 print_info: n_embd_v_gqa = 1024 print_info: f_norm_eps = 0.0e+00 print_info: f_norm_rms_eps = 1.0e-05 print_info: f_clamp_kqv = 0.0e+00 print_info: f_max_alibi_bias = 0.0e+00 print_info: f_logit_scale = 0.0e+00 print_info: f_attn_scale = 0.0e+00 print_info: n_ff = 27648 print_info: n_expert = 0 print_info: n_expert_used = 0 print_info: causal attn = 1 print_info: pooling type = 0 print_info: rope type = 2 print_info: rope scaling = linear print_info: freq_base_train = 1000000.0 print_info: freq_scale_train = 1 print_info: n_ctx_orig_yarn = 131072 print_info: rope_finetuned = unknown print_info: ssm_d_conv = 0 print_info: ssm_d_inner = 0 print_info: ssm_d_state = 0 print_info: ssm_dt_rank = 0 print_info: ssm_dt_b_c_rms = 0 print_info: model type = 32B print_info: model params = 32.76 B print_info: general.name = QwQ 32B print_info: vocab type = BPE print_info: n_vocab = 152064 print_info: n_merges = 151387 print_info: BOS token = 151643 '<|endoftext|>' print_info: EOS token = 151645 '<|im_end|>' print_info: EOT token = 151645 '<|im_end|>' print_info: PAD token = 151643 '<|endoftext|>' print_info: LF token = 198 'Ċ' print_info: FIM PRE token = 151659 '<|fim_prefix|>' print_info: FIM SUF token = 151661 '<|fim_suffix|>' print_info: FIM MID token = 151660 '<|fim_middle|>' print_info: FIM PAD token = 151662 '<|fim_pad|>' print_info: FIM REP token = 151663 '<|repo_name|>' print_info: FIM SEP token = 151664 '<|file_sep|>' print_info: EOG token = 151643 '<|endoftext|>' print_info: EOG token = 151645 '<|im_end|>' print_info: EOG token = 151662 '<|fim_pad|>' print_info: EOG token = 151663 '<|repo_name|>' print_info: EOG token = 151664 '<|file_sep|>' print_info: max token length = 256 load_tensors: loading model tensors, this can take a while... (mmap = false) warning: failed to mlock 827228160-byte buffer (after previously locking 0 bytes): Cannot allocate memory Try increasing RLIMIT_MEMLOCK ('ulimit -l' as root). load_tensors: offloading 64 repeating layers to GPU load_tensors: offloading output layer to GPU load_tensors: offloaded 65/65 layers to GPU load_tensors: CUDA_Host model buffer size = 788.91 MiB load_tensors: CUDA0 model buffer size = 16306.25 MiB load_tensors: CUDA1 model buffer size = 16106.92 MiB .................................................................................................. llama_context: constructing llama_context llama_context: n_seq_max = 32 llama_context: n_ctx = 64000 llama_context: n_ctx_per_seq = 2000 llama_context: n_batch = 2048 llama_context: n_ubatch = 512 llama_context: causal_attn = 1 llama_context: flash_attn = 0 llama_context: freq_base = 1000000.0 llama_context: freq_scale = 1 llama_context: n_ctx_per_seq (2000) < n_ctx_train (131072) -- the full capacity of the model will not be utilized llama_context: CUDA_Host output buffer size = 18.56 MiB init: kv_size = 64000, offload = 1, type_k = 'f16', type_v = 'f16', n_layer = 64, can_shift = 1 init: CUDA0 KV buffer size = 8250.00 MiB init: CUDA1 KV buffer size = 7750.00 MiB llama_context: KV self size = 16000.00 MiB, K (f16): 8000.00 MiB, V (f16): 8000.00 MiB llama_context: pipeline parallelism enabled (n_copies=4) llama_context: CUDA0 compute buffer size = 5580.01 MiB llama_context: CUDA1 compute buffer size = 5580.02 MiB llama_context: CUDA_Host compute buffer size = 510.02 MiB llama_context: graph nodes = 2374 llama_context: graph splits = 3 common_init_from_params: setting dry_penalty_last_n to ctx_size = 64000 common_init_from_params: warming up the model with an empty run - please wait ... (--no-warmup to disable) /home/runner/work/xllamacpp/xllamacpp/thirdparty/llama.cpp/ggml/src/ggml-cuda/ggml-cuda.cu:75: CUDA error ggml_cuda_compute_forward: RMS_NORM failed CUDA error: the provided PTX was compiled with an unsupported toolchain. current device: 0, in function ggml_cuda_compute_forward at /home/runner/work/xllamacpp/xllamacpp/thirdparty/llama.cpp/ggml/src/ggml-cuda/ggml-cuda.cu:2366 err

Expected behavior / 期待表现

能正常加载

pkusub avatar Apr 27 '25 09:04 pkusub

你的cuda版本是多少?

codingl2k1 avatar Apr 27 '25 10:04 codingl2k1

cuda是12.2

pkusub avatar Apr 27 '25 10:04 pkusub

cuda是12.2

加个 USE_XLLAMACPP=0 的环境变量再启动试试?镜像里用的是 cuda 12.4

codingl2k1 avatar Apr 27 '25 11:04 codingl2k1

This issue is stale because it has been open for 7 days with no activity.

github-actions[bot] avatar May 04 '25 19:05 github-actions[bot]

This issue was closed because it has been inactive for 5 days since being marked as stale.

github-actions[bot] avatar May 10 '25 19:05 github-actions[bot]