(changwenben) ubuntu@ubuntu-Lenovo-Product:~/llama.cpp$ python convert_hf_to_gguf.py /home/ubuntu/QwenLong-L1-32B --outfile QwenLong-L1-32B.gguf Traceback (most recent call last): File "/home/ubuntu/llama.cpp/convert_hf_to_gguf.py", line 19, in <module> from transformers import AutoConfig File "/home/ubuntu/changwenben/lib/python3.12/site-packages/transformers/utils/import_utils.py", line 2045, in __getattr__ module = self._get_module(self._class_to_module[name]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/changwenben/lib/python3.12/site-packages/transformers/utils/import_utils.py", line 2075, in _get_module raise e File "/home/ubuntu/changwenben/lib/python3.12/site-packages/transformers/utils/import_utils.py", line 2073, in _get_module return importlib.import_module("." + module_name, self.__name__) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/changwenben/lib/python3.12/site-packages/transformers/models/auto/configuration_auto.py", line 24, in <module> from ...configuration_utils import PretrainedConfig File "/home/ubuntu/changwenben/lib/python3.12/site-packages/transformers/configuration_utils.py", line 27, in <module> from .modeling_gguf_pytorch_utils import load_gguf_checkpoint File "/home/ubuntu/changwenben/lib/python3.12/site-packages/transformers/modeling_gguf_pytorch_utils.py", line 22, in <module> from .integrations import ( ImportError: cannot import name 'GGUF_CONFIG_MAPPING' from 'transformers.integrations' (/home/ubuntu/changwenben/lib/python3.12/site-packages/transformers/integrations/__init__.py). Did you mean: 'GGUF_TOKENIZER_MAPPING'?

时间: 2025-06-30 17:15:24 浏览: 21
<think>我们遇到了一个错误:`ImportError:cannotimportname'GGUF_CONFIG_MAPPING'from'transformers.integrations'`。这个错误通常发生在尝试运行`convert_hf_to_gguf.py`脚本时,因为`transformers`库的版本问题或者该脚本依赖的特定功能在当前环境中不可用。###问题原因分析1.**`transformers`版本不兼容**:`GGUF_CONFIG_MAPPING`是`transformers`库中一个较新的特性,可能只在特定版本以上才存在。如果你的`transformers`版本过低,可能没有这个模块。2.**脚本依赖更新**:`convert_hf_to_gguf.py`脚本可能使用了新版本的`transformers`功能,而你的环境中的`transformers`版本过旧。###解决方案####方法1:升级`transformers`库尝试升级`transformers`到最新版本,因为`GGUF_CONFIG_MAPPING`是在较新的版本中引入的。```bashpipinstall--upgradetransformers```####方法2:检查`transformers`版本确保你的`transformers`版本至少为`4.38.0`(这个版本引入了`GGUF_CONFIG_MAPPING`[^1])。你可以通过以下命令查看版本:```bashpipshowtransformers```如果版本低于`4.38.0`,请升级:```bashpipinstalltransformers==4.38.0```####方法3:检查脚本来源确保你使用的`convert_hf_to_gguf.py`脚本是最新的,因为旧版本的脚本可能不包含对`GGUF_CONFIG_MAPPING`的引用。建议从最新的`llama.cpp`仓库中获取该脚本:1.访问[llama.cppGitHub仓库](https://github.com/ggerganov/llama.cpp)并下载最新代码。2.使用新下载的`convert_hf_to_gguf.py`脚本替换你当前使用的脚本。####方法4:临时修改脚本(如果升级不可行)如果由于某些原因无法升级`transformers`,可以尝试修改脚本,避免导入`GGUF_CONFIG_MAPPING`。不过这种方法可能不推荐,因为它可能导致功能缺失。具体修改如下:在`convert_hf_to_gguf.py`中找到以下代码行:```pythonfromtransformers.integrationsimportGGUF_CONFIG_MAPPING```将其替换为(如果`GGUF_CONFIG_MAPPING`确实不存在):```python#如果导入失败,我们定义一个空字典GGUF_CONFIG_MAPPING={}```**注意**:这种方法只是临时绕过错误,可能影响转换的准确性,因为缺少必要的配置映射。建议优先升级库。###验证完成上述步骤后,重新运行转换命令:```bashpythonconvert_hf_to_gguf.py<模型路径>```###附加建议-确保你的环境中安装了所有必要的依赖,包括`torch`、`safetensors`等。可以使用以下命令安装:```bashpipinstalltorchsafetensors```-如果问题仍然存在,考虑在`llama.cpp`的GitHub仓库中搜索相关issue或提交新的issue。§§相关问题§§1.如何解决`transformers`库升级后其他依赖冲突的问题?2.除了`convert_hf_to_gguf.py`,还有哪些工具可以将HuggingFace模型转换为GGUF格式?3.如何检查GGUF模型是否正确转换?</think>### 解决 `cannot import name 'GGUF_CONFIG_MAPPING'` 错误 这个错误通常是由于 `transformers` 库版本不兼容或脚本依赖问题导致的。以下是完整解决方案: #### 1. **升级 `transformers` 库到最新版本** `GGUF_CONFIG_MAPPING` 是较新版本引入的功能,最低需要 `transformers>=4.38.0`: ```bash pip install --upgrade transformers # 或指定最低版本 pip install transformers>=4.38.0 ``` #### 2. **安装正确的依赖库组合** 确保安装以下兼容版本组合: ```bash pip install \ transformers>=4.38.0 \ safetensors>=0.4.2 \ torch>=2.1.0 \ sentencepiece>=0.2.0 ``` #### 3. **检查 llama.cpp 脚本版本** 如果问题仍存在,可能是 `convert_hf_to_gguf.py` 脚本版本过旧: 1. 从官方仓库更新脚本: ```bash wget https://github.com/ggerganov/llama.cpp/raw/master/convert-hf-to-gguf.py ``` 2. 使用更新后的脚本运行: ```bash python convert-hf-to-gguf.py [参数] ``` #### 4. **替代方案:使用 `llama.cpp` 官方转换器** 如果脚本仍报错,可使用官方转换工具: ```bash # 克隆仓库 git clone https://github.com/ggerganov/llama.cpp cd llama.cpp # 安装Python依赖 pip install -r requirements.txt # 使用内置转换器 python convert.py [HF模型路径] --outtype [f16|q8_0] ``` #### 5. **验证解决方案** 成功转换的示例输出: ```text Loading model: ./qwen2_0.5b_instruct Detected model type: QwenForCausalLM Converting to GGUF: qwen2_0.5b_instruct_f16.gguf [✔] Success! Model saved to qwen2_0.5b_instruct_f16.gguf ``` ### 关键原理说明 1. **版本兼容性**:`GGUF_CONFIG_MAPPING` 是 Hugging Face 在 2024 年新增的 API,用于处理 GGUF 格式的配置文件映射[^1] 2. **依赖链**:脚本依赖 `transformers.integrations` 模块,该模块在 4.38.0 版本重构了第三方集成功能 3. **备用方案**:当 API 变动时,`llama.cpp` 的 `convert.py` 是更稳定的替代方案
阅读全文

相关推荐

WARNING:hf-to-gguf: WARNING:hf-to-gguf:************************************************************************************** WARNING:hf-to-gguf:** WARNING: The BPE pre-tokenizer was not recognized! WARNING:hf-to-gguf:** There are 2 possible reasons for this: WARNING:hf-to-gguf:** - the model has not been added to convert_hf_to_gguf_update.py yet WARNING:hf-to-gguf:** - the pre-tokenization config has changed upstream WARNING:hf-to-gguf:** Check your model files and convert_hf_to_gguf_update.py and update them accordingly. WARNING:hf-to-gguf:** ref: https://github.com/ggml-org/llama.cpp/pull/6920 WARNING:hf-to-gguf:** WARNING:hf-to-gguf:** chkhsh: b0f33aec525001c9de427a8f9958d1c8a3956f476bec64403680521281c032e2 WARNING:hf-to-gguf:************************************************************************************** WARNING:hf-to-gguf: Traceback (most recent call last): File "/root/yeesuanAiModel/llama.cpp/convert_hf_to_gguf.py", line 2700, in set_vocab self._set_vocab_sentencepiece() File "/root/yeesuanAiModel/llama.cpp/convert_hf_to_gguf.py", line 905, in _set_vocab_sentencepiece tokens, scores, toktypes = self._create_vocab_sentencepiece() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/yeesuanAiModel/llama.cpp/convert_hf_to_gguf.py", line 922, in _create_vocab_sentencepiece raise FileNotFoundError(f"File not found: {tokenizer_path}") FileNotFoundError: File not found: /root/yeesuanAiModel/DeepSeek-R1-0528-Qwen3-8B/tokenizer.model During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/root/yeesuanAiModel/llama.cpp/convert_hf_to_gguf.py", line 6508, in <module> main() File "/root/yeesuanAiModel/llama.cpp/convert_hf_to_gguf.py", line 6502, in main model_instance.write() File "/root/yeesuanAiModel/llama.cpp/convert_hf_to_gguf.py", line 404, in write self.prepare_metadata(vocab_only=False) File "/root/yeesuanAiModel/llama.cpp/convert_hf_to_gguf.py", line 517, in prepare_metadata self.set_vocab() File "/root/yeesuanAiModel/llama.cpp/convert_hf_to_gguf.py", line 2702, in set_vocab self._set_vocab_gpt2() File "/root/yeesuanAiModel/llama.cpp/convert_hf_to_gguf.py", line 841, in _set_vocab_gpt2 tokens, toktypes, tokpre = self.get_vocab_base() ^^^^^^^^^^^^^^^^^^^^^ File "/root/yeesuanAiModel/llama.cpp/convert_hf_to_gguf.py", line 610, in get_vocab_base tokpre = self.get_vocab_base_pre(tokenizer) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/yeesuanAiModel/llama.cpp/convert_hf_to_gguf.py", line 829, in get_vocab_base_pre raise NotImplementedError("BPE pre-tokenizer was not recognized - update get_vocab_base_pre()") NotImplementedError: BPE pre-tokenizer was not recognized - update get_vocab_base_pre() 显示这个

INFO 07-06 22:09:23 __init__.py:207] Automatically detected platform cuda. (VllmWorkerProcess pid=10542) INFO 07-06 22:09:23 multiproc_worker_utils.py:229] Worker ready; awaiting tasks (VllmWorkerProcess pid=10542) INFO 07-06 22:09:24 cuda.py:178] Cannot use FlashAttention-2 backend for Volta and Turing GPUs. (VllmWorkerProcess pid=10542) INFO 07-06 22:09:24 cuda.py:226] Using XFormers backend. (VllmWorkerProcess pid=10542) INFO 07-06 22:09:25 utils.py:916] Found nccl from library libnccl.so.2 (VllmWorkerProcess pid=10542) INFO 07-06 22:09:25 pynccl.py:69] vLLM is using nccl==2.21.5 INFO 07-06 22:09:25 utils.py:916] Found nccl from library libnccl.so.2 INFO 07-06 22:09:25 pynccl.py:69] vLLM is using nccl==2.21.5 INFO 07-06 22:09:25 custom_all_reduce_utils.py:206] generating GPU P2P access cache in /root/.cache/vllm/gpu_p2p_access_cache_for_0,1.json INFO 07-06 22:09:39 custom_all_reduce_utils.py:244] reading GPU P2P access cache from /root/.cache/vllm/gpu_p2p_access_cache_for_0,1.json (VllmWorkerProcess pid=10542) INFO 07-06 22:09:39 custom_all_reduce_utils.py:244] reading GPU P2P access cache from /root/.cache/vllm/gpu_p2p_access_cache_for_0,1.json WARNING 07-06 22:09:39 custom_all_reduce.py:145] Custom allreduce is disabled because your platform lacks GPU P2P capability or P2P test failed. To silence this warning, specify disable_custom_all_reduce=True explicitly. (VllmWorkerProcess pid=10542) WARNING 07-06 22:09:39 custom_all_reduce.py:145] Custom allreduce is disabled because your platform lacks GPU P2P capability or P2P test failed. To silence this warning, specify disable_custom_all_reduce=True explicitly. INFO 07-06 22:09:39 shm_broadcast.py:258] vLLM message queue communication handle: Handle(connect_ip='127.0.0.1', local_reader_ranks=[1], buffer_handle=(1, 4194304, 6, 'psm_b99a0acb'), local_subscribe_port=57279, remote_subscribe_port=None) INFO 07-06 22:09:39 model_runner.py:1110] Starting to load model /home/user/Desktop/DeepSeek-R1-Distill-Qwen-32B... (VllmWorkerProcess pid=10542) INFO 07-06 22:09:39 model_runner.py:1110] Starting to load model /home/user/Desktop/DeepSeek-R1-Distill-Qwen-32B... ERROR 07-06 22:09:39 engine.py:400] CUDA out of memory. Tried to allocate 136.00 MiB. GPU 0 has a total capacity of 21.49 GiB of which 43.50 MiB is free. Including non-PyTorch memory, this process has 21.44 GiB memory in use. Of the allocated memory 21.19 GiB is allocated by PyTorch, and 20.25 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables) ERROR 07-06 22:09:39 engine.py:400] Traceback (most recent call last): ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 391, in run_mp_engine ERROR 07-06 22:09:39 engine.py:400] engine = MQLLMEngine.from_engine_args(engine_args=engine_args, ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 124, in from_engine_args ERROR 07-06 22:09:39 engine.py:400] return cls(ipc_path=ipc_path, ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 76, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.engine = LLMEngine(*args, **kwargs) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/llm_engine.py", line 273, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.model_executor = executor_class(vllm_config=vllm_config, ) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/executor_base.py", line 271, in __init__ ERROR 07-06 22:09:39 engine.py:400] super().__init__(*args, **kwargs) ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/executor_base.py", line 52, in __init__ ERROR 07-06 22:09:39 engine.py:400] self._init_executor() ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/mp_distributed_executor.py", line 125, in _init_executor ERROR 07-06 22:09:39 engine.py:400] self._run_workers("load_model", ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/mp_distributed_executor.py", line 185, in _run_workers ERROR 07-06 22:09:39 engine.py:400] driver_worker_output = run_method(self.driver_worker, sent_method, ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/utils.py", line 2196, in run_method ERROR 07-06 22:09:39 engine.py:400] return func(*args, **kwargs) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/worker/worker.py", line 183, in load_model ERROR 07-06 22:09:39 engine.py:400] self.model_runner.load_model() ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/worker/model_runner.py", line 1112, in load_model ERROR 07-06 22:09:39 engine.py:400] self.model = get_model(vllm_config=self.vllm_config) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/model_loader/__init__.py", line 14, in get_model ERROR 07-06 22:09:39 engine.py:400] return loader.load_model(vllm_config=vllm_config) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/model_loader/loader.py", line 406, in load_model ERROR 07-06 22:09:39 engine.py:400] model = _initialize_model(vllm_config=vllm_config) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/model_loader/loader.py", line 125, in _initialize_model ERROR 07-06 22:09:39 engine.py:400] return model_class(vllm_config=vllm_config, prefix=prefix) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 453, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.model = Qwen2Model(vllm_config=vllm_config, ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/compilation/decorators.py", line 151, in __init__ ERROR 07-06 22:09:39 engine.py:400] old_init(self, vllm_config=vllm_config, prefix=prefix, **kwargs) ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 307, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.start_layer, self.end_layer, self.layers = make_layers( ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/utils.py", line 557, in make_layers ERROR 07-06 22:09:39 engine.py:400] [PPMissingLayer() for _ in range(start_layer)] + [ ERROR 07-06 22:09:39 engine.py:400] ^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/utils.py", line 558, in ERROR 07-06 22:09:39 engine.py:400] maybe_offload_to_cpu(layer_fn(prefix=f"{prefix}.{idx}")) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 309, in <lambda> ERROR 07-06 22:09:39 engine.py:400] lambda prefix: Qwen2DecoderLayer(config=config, ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 220, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.mlp = Qwen2MLP( ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 82, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.down_proj = RowParallelLinear( ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/layers/linear.py", line 1062, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.quant_method.create_weights( ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/layers/linear.py", line 129, in create_weights ERROR 07-06 22:09:39 engine.py:400] weight = Parameter(torch.empty(sum(output_partition_sizes), ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/torch/utils/_device.py", line 106, in __torch_function__ ERROR 07-06 22:09:39 engine.py:400] return func(*args, **kwargs) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 136.00 MiB. GPU 0 has a total capacity of 21.49 GiB of which 43.50 MiB is free. Including non-PyTorch memory, this process has 21.44 GiB memory in use. Of the allocated memory 21.19 GiB is allocated by PyTorch, and 20.25 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables) Process SpawnProcess-1: INFO 07-06 22:09:39 multiproc_worker_utils.py:128] Killing local vLLM worker processes Traceback (most recent call last): File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 402, in run_mp_engine raise e File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 391, in run_mp_engine engine = MQLLMEngine.from_engine_args(engine_args=engine_args, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 124, in from_engine_args return cls(ipc_path=ipc_path, ^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 76, in __init__ self.engine = LLMEngine(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/llm_engine.py", line 273, in __init__ self.model_executor = executor_class(vllm_config=vllm_config, ) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/executor_base.py", line 271, in __init__ super().__init__(*args, **kwargs) File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/executor_base.py", line 52, in __init__ self._init_executor() File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/mp_distributed_executor.py", line 125, in _init_executor self._run_workers("load_model", File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/mp_distributed_executor.py", line 185, in _run_workers driver_worker_output = run_method(self.driver_worker, sent_method, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/utils.py", line 2196, in run_method return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/worker/worker.py", line 183, in load_model self.model_runner.load_model() File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/worker/model_runner.py", line 1112, in load_model self.model = get_model(vllm_config=self.vllm_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/model_loader/__init__.py", line 14, in get_model return loader.load_model(vllm_config=vllm_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/model_loader/loader.py", line 406, in load_model model = _initialize_model(vllm_config=vllm_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/model_loader/loader.py", line 125, in _initialize_model return model_class(vllm_config=vllm_config, prefix=prefix) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 453, in __init__ self.model = Qwen2Model(vllm_config=vllm_config, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/compilation/decorators.py", line 151, in __init__ old_init(self, vllm_config=vllm_config, prefix=prefix, **kwargs) File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 307, in __init__ self.start_layer, self.end_layer, self.layers = make_layers( ^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/utils.py", line 557, in make_layers [PPMissingLayer() for _ in range(start_layer)] + [ ^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/utils.py", line 558, in maybe_offload_to_cpu(layer_fn(prefix=f"{prefix}.{idx}")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 309, in <lambda> lambda prefix: Qwen2DecoderLayer(config=config, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 220, in __init__ self.mlp = Qwen2MLP( ^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 82, in __init__ self.down_proj = RowParallelLinear( ^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/layers/linear.py", line 1062, in __init__ self.quant_method.create_weights( File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/layers/linear.py", line 129, in create_weights weight = Parameter(torch.empty(sum(output_partition_sizes), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/torch/utils/_device.py", line 106, in __torch_function__ return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 136.00 MiB. GPU 0 has a total capacity of 21.49 GiB of which 43.50 MiB is free. Including non-PyTorch memory, this process has 21.44 GiB memory in use. Of the allocated memory 21.19 GiB is allocated by PyTorch, and 20.25 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables) [rank0]:[W706 22:09:40.345098611 ProcessGroupNCCL.cpp:1250] Warning: WARNING: process group has NOT been destroyed before we destruct ProcessGroupNCCL. On normal program exit, the application should call destroy_process_group to ensure that any pending NCCL operations have finished in this process. In rare cases this process can exit before this point and block the progress of another member of the process group. This constraint has always been present, but this warning has only been added since PyTorch 2.4 (function operator()) Traceback (most recent call last): File "/root/miniconda3/envs/deepseek_vllm/bin/vllm", line 8, in <module> sys.exit(main()) ^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/entrypoints/cli/main.py", line 73, in main args.dispatch_function(args) File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/entrypoints/cli/serve.py", line 34, in cmd uvloop.run(run_server(args)) File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/uvloop/__init__.py", line 105, in run return runner.run(wrapper()) ^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/uvloop/__init__.py", line 61, in wrapper return await main ^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/entrypoints/openai/api_server.py", line 947, in run_server async with build_async_engine_client(args) as engine_client: File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/entrypoints/openai/api_server.py", line 139, in build_async_engine_client async with build_async_engine_client_from_engine_args( File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/entrypoints/openai/api_server.py", line 233, in build_async_engine_client_from_engine_args raise RuntimeError( RuntimeError: Engine process failed to start. See stack trace for the root cause. (deepseek_vllm) root@user-X99:/home/user/Desktop# /root/miniconda3/envs/deepseek_vllm/lib/python3.11/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' (deepseek_vllm) root@user-X99:/home/user/Desktop#

/home/wiseatc/.local/lib/python3.11/site-packages/jieba/_compat.py:18: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. import pkg_resources W0703 16:30:36.069853 3914856 torch/distributed/run.py:766] W0703 16:30:36.069853 3914856 torch/distributed/run.py:766] ***************************************** W0703 16:30:36.069853 3914856 torch/distributed/run.py:766] Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed. W0703 16:30:36.069853 3914856 torch/distributed/run.py:766] ***************************************** /home/wiseatc/.local/lib/python3.11/site-packages/jieba/_compat.py:18: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. import pkg_resources [INFO|tokenization_utils_base.py:2048] 2025-07-03 16:30:43,321 >> loading file tokenizer.model [INFO|tokenization_utils_base.py:2048] 2025-07-03 16:30:43,322 >> loading file tokenizer.json [INFO|tokenization_utils_base.py:2048] 2025-07-03 16:30:43,322 >> loading file added_tokens.json [INFO|tokenization_utils_base.py:2048] 2025-07-03 16:30:43,322 >> loading file special_tokens_map.json [INFO|tokenization_utils_base.py:2048] 2025-07-03 16:30:43,322 >> loading file tokenizer_config.json [INFO|tokenization_utils_base.py:2048] 2025-07-03 16:30:43,322 >> loading file chat_template.jinja /home/wiseatc/.local/lib/python3.11/site-packages/jieba/_compat.py:18: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. import pkg_resources /home/wiseatc/.local/lib/python3.11/site-packages/jieba/_compat.py:18: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. import pkg_resources /home/wiseatc/.local/lib/python3.11/site-packages/jieba/_compat.py:18: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. import pkg_resources [INFO|tokenization_utils_base.py:2313] 2025-07-03 16:30:43,904 >> Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained. [INFO|configuration_utils.py:697] 2025-07-03 16:30:43,913 >> loading configuration file /mnt/data1/models/1.5B/config.json [INFO|configuration_utils.py:771] 2025-07-03 16:30:43,919 >> Model config Qwen2Config { "_name_or_path": "/mnt/data1/models/1.5B", "architectures": [ "Qwen2ForCausalLM" ], "attention_dropout": 0.0, "bos_token_id": 151643, "eos_token_id": 151643, "hidden_act": "silu", "hidden_size": 1536, "initializer_range": 0.02, "intermediate_size": 8960, "max_position_embeddings": 131072, "max_window_layers": 21, "model_type": "qwen2", "num_attention_heads": 12, "num_hidden_layers": 28, "num_key_value_heads": 2, "rms_norm_eps": 1e-06, "rope_scaling": null, "rope_theta": 10000, "sliding_window": 4096, "tie_word_embeddings": false, "torch_dtype": "bfloat16", "transformers_version": "4.49.0", "use_cache": true, "use_mrope": false, "use_sliding_window": false, "vocab_size": 151936 } [INFO|tokenization_utils_base.py:2048] 2025-07-03 16:30:43,920 >> loading file tokenizer.model [INFO|tokenization_utils_base.py:2048] 2025-07-03 16:30:43,920 >> loading file tokenizer.json [INFO|tokenization_utils_base.py:2048] 2025-07-03 16:30:43,920 >> loading file added_tokens.json [INFO|tokenization_utils_base.py:2048] 2025-07-03 16:30:43,920 >> loading file special_tokens_map.json [INFO|tokenization_utils_base.py:2048] 2025-07-03 16:30:43,920 >> loading file tokenizer_config.json [INFO|tokenization_utils_base.py:2048] 2025-07-03 16:30:43,920 >> loading file chat_template.jinja [INFO|tokenization_utils_base.py:2313] 2025-07-03 16:30:44,493 >> Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained. /usr/local/lib/python3.11/dist-packages/torch/distributed/distributed_c10d.py:4631: UserWarning: No device id is provided via init_process_group or barrier . Using the current device set by the user. warnings.warn( # warn only once [rank1]:[W703 16:30:45.102845887 ProcessGroupNCCL.cpp:4718] [PG ID 0 PG GUID 0 Rank 1] using GPU 1 as device used by this process is currently unknown. This can potentially cause a hang if this rank to GPU mapping is incorrect. You can pecify device_id in init_process_group() to force use of a particular device. /usr/local/lib/python3.11/dist-packages/torch/distributed/distributed_c10d.py:4631: UserWarning: No device id is provided via init_process_group or barrier . Using the current device set by the user. warnings.warn( # warn only once [rank2]:[W703 16:30:45.126706430 ProcessGroupNCCL.cpp:4718] [PG ID 0 PG GUID 0 Rank 2] using GPU 2 as device used by this process is currently unknown. This can potentially cause a hang if this rank to GPU mapping is incorrect. You can pecify device_id in init_process_group() to force use of a particular device. /usr/local/lib/python3.11/dist-packages/torch/distributed/distributed_c10d.py:4631: UserWarning: No device id is provided via init_process_group or barrier . Using the current device set by the user. warnings.warn( # warn only once [rank3]:[W703 16:30:45.136836682 ProcessGroupNCCL.cpp:4718] [PG ID 0 PG GUID 0 Rank 3] using GPU 3 as device used by this process is currently unknown. This can potentially cause a hang if this rank to GPU mapping is incorrect. You can pecify device_id in init_process_group() to force use of a particular device. Setting num_proc from 16 back to 1 for the train split to disable multiprocessing as it only contains one shard. Generating train split: 0 examples [00:00, ? examples/s] Generating train split: 120 examples [00:00, 6525.39 examples/s] Converting format of dataset (num_proc=16): 0%| | 0/120 [00:00<?, ? examples/s] Converting format of dataset (num_proc=16): 0%| | 0/120 [00:00<?, ? examples/s] Converting format of dataset (num_proc=16): 0%| | 0/120 [00:00<?, ? examples/s] /usr/local/lib/python3.11/dist-packages/torch/distributed/distributed_c10d.py:4631: UserWarning: No device id is provided via init_process_group or barrier . Using the current device set by the user. warnings.warn( # warn only once [rank0]:[W703 16:31:05.679961201 ProcessGroupNCCL.cpp:4718] [PG ID 0 PG GUID 0 Rank 0] using GPU 0 as device used by this process is currently unknown. This can potentially cause a hang if this rank to GPU mapping is incorrect. You can pecify device_id in init_process_group() to force use of a particular device. [rank0]: multiprocess.pool.RemoteTraceback: [rank0]: """ [rank0]: Traceback (most recent call last): [rank0]: File "/home/wiseatc/.local/lib/python3.11/site-packages/multiprocess/pool.py", line 125, in worker [rank0]: result = (True, func(*args, **kwds)) [rank0]: ^^^^^^^^^^^^^^^^^^^ [rank0]: File "/home/wiseatc/.local/lib/python3.11/site-packages/datasets/utils/py_utils.py", line 688, in _write_generator_to_queue [rank0]: for i, result in enumerate(func(**kwargs)): [rank0]: File "/home/wiseatc/.local/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 3501, in _map_single [rank0]: for i, example in iter_outputs(shard_iterable): [rank0]: File "/home/wiseatc/.local/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 3475, in iter_outputs [rank0]: yield i, apply_function(example, i, offset=offset) [rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank0]: File "/home/wiseatc/.local/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 3398, in apply_function [rank0]: processed_inputs = function(*fn_args, *additional_args, **fn_kwargs) [rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank0]: File "/home/wiseatc/LLaMA-Factory/src/llamafactory/data/converter.py", line 94, in __call__ [rank0]: if self.dataset_attr.prompt and example[self.dataset_attr.prompt]: [rank0]: ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank0]: File "/home/wiseatc/.local/lib/python3.11/site-packages/datasets/formatting/formatting.py", line 278, in __getitem__ [rank0]: value = self.data[key] [rank0]: ~~~~~~~~~^^^^^ [rank0]: KeyError: 'instruction' [rank0]: """ [rank0]: The above exception was the direct cause of the following exception: [rank0]: Traceback (most recent call last): [rank0]: File "/home/wiseatc/LLaMA-Factory/src/llamafactory/launcher.py", line 23, in <module> [rank0]: launch() [rank0]: File "/home/wiseatc/LLaMA-Factory/src/llamafactory/launcher.py", line 19, in launch [rank0]: run_exp() [rank0]: File "/home/wiseatc/LLaMA-Factory/src/llamafactory/train/tuner.py", line 110, in run_exp [rank0]: _training_function(config={"args": args, "callbacks": callbacks}) [rank0]: File "/home/wiseatc/LLaMA-Factory/src/llamafactory/train/tuner.py", line 72, in _training_function [rank0]: run_sft(model_args, data_args, training_args, finetuning_args, generating_args, callbacks) [rank0]: File "/home/wiseatc/LLaMA-Factory/src/llamafactory/train/sft/workflow.py", line 51, in run_sft [rank0]: dataset_module = get_dataset(template, model_args, data_args, training_args, stage="sft", **tokenizer_module) [rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank0]: File "/home/wiseatc/LLaMA-Factory/src/llamafactory/data/loader.py", line 304, in get_dataset [rank0]: dataset = _get_merged_dataset(data_args.dataset, model_args, data_args, training_args, stage) [rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank0]: File "/home/wiseatc/LLaMA-Factory/src/llamafactory/data/loader.py", line 182, in _get_merged_dataset [rank0]: datasets[dataset_name] = _load_single_dataset(dataset_attr, model_args, data_args, training_args) [rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank0]: File "/home/wiseatc/LLaMA-Factory/src/llamafactory/data/loader.py", line 162, in _load_single_dataset [rank0]: return align_dataset(dataset, dataset_attr, data_args, training_args) [rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank0]: File "/home/wiseatc/LLaMA-Factory/src/llamafactory/data/converter.py", line 279, in align_dataset [rank0]: return dataset.map( [rank0]: ^^^^^^^^^^^^ [rank0]: File "/home/wiseatc/.local/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 557, in wrapper [rank0]: out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) [rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank0]: File "/home/wiseatc/.local/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 3171, in map [rank0]: for rank, done, content in iflatmap_unordered( [rank0]: File "/home/wiseatc/.local/lib/python3.11/site-packages/datasets/utils/py_utils.py", line 728, in iflatmap_unordered [rank0]: [async_result.get(timeout=0.05) for async_result in async_results] [rank0]: File "/home/wiseatc/.local/lib/python3.11/site-packages/datasets/utils/py_utils.py", line 728, in [rank0]: [async_result.get(timeout=0.05) for async_result in async_results] [rank0]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank0]: File "/home/wiseatc/.local/lib/python3.11/site-packages/multiprocess/pool.py", line 774, in get [rank0]: raise self._value [rank0]: KeyError: 'instruction' [rank0]:[W703 16:31:06.912491219 ProcessGroupNCCL.cpp:1479] Warning: WARNING: destroy_process_group() was not called before program exit, which can leak resources. For more info, please see https://pytorch.org/docs/stable/distributed.html#shutdown (function operator()) W0703 16:31:07.960560 3914856 torch/distributed/elastic/multiprocessing/api.py:900] Sending process 3914916 closing signal SIGTERM W0703 16:31:07.961188 3914856 torch/distributed/elastic/multiprocessing/api.py:900] Sending process 3914917 closing signal SIGTERM W0703 16:31:07.961536 3914856 torch/distributed/elastic/multiprocessing/api.py:900] Sending process 3914918 closing signal SIGTERM E0703 16:31:08.371267 3914856 torch/distributed/elastic/multiprocessing/api.py:874] failed (exitcode: 1) local_rank: 0 (pid: 3914915) of binary: /usr/bin/python3.11 Traceback (most recent call last): File "/usr/local/bin/torchrun", line 8, in <module> sys.exit(main()) ^^^^^^ File "/usr/local/lib/python3.11/dist-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 355, in wrapper return f(*args, **kwargs) ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/torch/distributed/run.py", line 892, in main run(args) File "/usr/local/lib/python3.11/dist-packages/torch/distributed/run.py", line 883, in run elastic_launch( File "/usr/local/lib/python3.11/dist-packages/torch/distributed/launcher/api.py", line 139, in __call__ return launch_agent(self._config, self._entrypoint, list(args)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/torch/distributed/launcher/api.py", line 270, in launch_agent raise ChildFailedError( torch.distributed.elastic.multiprocessing.errors.ChildFailedError: ============================================================ /home/wiseatc/LLaMA-Factory/src/llamafactory/launcher.py FAILED ------------------------------------------------------------ Failures: <NO_OTHER_FAILURES> ------------------------------------------------------------ Root Cause (first observed failure): [0]: time : 2025-07-03_16:31:07 host : wiseatc-Super-Server rank : 0 (local_rank: 0) exitcode : 1 (pid: 3914915) error_file: <N/A> traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html ============================================================ Traceback (most recent call last): File "/home/wiseatc/.local/bin/llamafactory-cli", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/wiseatc/LLaMA-Factory/src/llamafactory/cli.py", line 130, in main process = subprocess.run( ^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/subprocess.py", line 569, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['torchrun', '--nnodes', '1', '--node_rank', '0', '--nproc_per_node', '4', '--master_addr', '127.0.0.1', '--master_port', '41919', '/home/wiseatc/LLaMA-Factory/src/llamafactory/launcher.py', 'saves/DeepSeek-R1-1.5B-Distill/lora/train_2025-07-03-16-29-46/training_args.yaml']' returned non-zero exit status 1.

root@wlcb-dyg:/home/wlcb-dyg# ollama serve Couldn't find '/root/.ollama/id_ed25519'. Generating new private key. Your new public key is: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID4ovJFMvZAtq71NIhecQfJmdE0w16e3jZMylgVJ2lq/ 2025/03/13 09:15:50 routes.go:1225: INFO server config env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_CONTEXT_LENGTH:2048 OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/root/.ollama/models OLLAMA_MULTIUSER_CACHE:false OLLAMA_NEW_ENGINE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* vscode-file://*] OLLAMA_SCHED_SPREAD:false ROCR_VISIBLE_DEVICES: http_proxy: https_proxy: no_proxy:]" time=2025-03-13T09:15:50.606+08:00 level=INFO source=images.go:432 msg="total blobs: 0" time=2025-03-13T09:15:50.606+08:00 level=INFO source=images.go:439 msg="total unused blobs removed: 0" time=2025-03-13T09:15:50.606+08:00 level=INFO source=routes.go:1292 msg="Listening on 127.0.0.1:11434 (version 0.6.0)" time=2025-03-13T09:15:50.606+08:00 level=INFO source=gpu.go:217 msg="looking for compatible GPUs" time=2025-03-13T09:15:51.523+08:00 level=INFO source=types.go:130 msg="inference compute" id=GPU-91af1d5b-5fed-e3b0-93e9-2112bebf3262 library=cuda variant=v12 compute=7.5 driver=12.2 name="Tesla T4" total="14.6 GiB" available="14.5 GiB" time=2025-03-13T09:15:51.523+08:00 level=INFO source=types.go:130 msg="inference compute" id=GPU-6cc43ad6-f63f-84ca-666d-

最新推荐

recommend-type

计算机就业指导.docx

计算机就业指导.docx
recommend-type

C语言指针习题及答案.doc

C语言指针习题及答案.doc
recommend-type

第7章-PLC控制系统设计.ppt

第7章-PLC控制系统设计.ppt
recommend-type

iBatisNet基础教程:入门级示例程序解析

iBatisNet是一个流行的.NET持久层框架,它提供了数据持久化层的解决方案。这个框架允许开发者通过配置文件或XML映射文件来操作数据库,从而将数据操作与业务逻辑分离,提高了代码的可维护性和扩展性。由于它具备与Java领域广泛使用的MyBatis类似的特性,对于Java开发者来说,iBatisNet易于上手。 ### iBatisNet入门关键知识点 1. **框架概述**: iBatisNet作为一个持久层框架,其核心功能是减少数据库操作代码。它通过映射文件实现对象与数据库表之间的映射,使得开发者在处理数据库操作时更加直观。其提供了一种简单的方式,让开发者能够通过配置文件来管理SQL语句和对象之间的映射关系,从而实现对数据库的CRUD操作(创建、读取、更新和删除)。 2. **配置与初始化**: - **配置文件**:iBatisNet使用配置文件(通常为`SqlMapConfig.xml`)来配置数据库连接和SQL映射文件。 - **环境设置**:包括数据库驱动、连接池配置、事务管理等。 - **映射文件**:定义SQL语句和结果集映射到对象的规则。 3. **核心组件**: - **SqlSessionFactory**:用于创建SqlSession对象,它类似于一个数据库连接池。 - **SqlSession**:代表一个与数据库之间的会话,可以执行SQL命令,获取映射对象等。 - **Mapper接口**:定义与数据库操作相关的接口,通过注解或XML文件实现具体方法与SQL语句的映射。 4. **基本操作**: - **查询(SELECT)**:使用`SqlSession`的`SelectList`或`SelectOne`方法从数据库查询数据。 - **插入(INSERT)**:使用`Insert`方法向数据库添加数据。 - **更新(UPDATE)**:使用`Update`方法更新数据库中的数据。 - **删除(DELETE)**:使用`Delete`方法从数据库中删除数据。 5. **数据映射**: - **一对一**:单个记录与另一个表中的单个记录之间的关系。 - **一对多**:单个记录与另一个表中多条记录之间的关系。 - **多对多**:多个记录与另一个表中多个记录之间的关系。 6. **事务处理**: iBatisNet不会自动处理事务,需要开发者手动开始事务、提交事务或回滚事务。开发者可以通过`SqlSession`的`BeginTransaction`、`Commit`和`Rollback`方法来控制事务。 ### 具体示例分析 从文件名称列表可以看出,示例程序中包含了完整的解决方案文件`IBatisNetDemo.sln`,这表明它可能是一个可视化的Visual Studio解决方案,其中可能包含多个项目文件和资源文件。示例项目可能包括了数据库访问层、业务逻辑层和表示层等。而`51aspx源码必读.txt`文件可能包含关键的源码解释和配置说明,帮助开发者理解示例程序的代码结构和操作数据库的方式。`DB_51aspx`可能指的是数据库脚本或者数据库备份文件,用于初始化或者恢复数据库环境。 通过这些文件,我们可以学习到如何配置iBatisNet的环境、如何定义SQL映射文件、如何创建和使用Mapper接口、如何实现基本的CRUD操作,以及如何正确地处理事务。 ### 学习步骤 为了有效地学习iBatisNet,推荐按照以下步骤进行: 1. 了解iBatisNet的基本概念和框架结构。 2. 安装.NET开发环境(如Visual Studio)和数据库(如SQL Server)。 3. 熟悉示例项目结构,了解`SqlMapConfig.xml`和其他配置文件的作用。 4. 学习如何定义和使用映射文件,如何通过`SqlSessionFactory`和`SqlSession`进行数据库操作。 5. 逐步实现增删改查操作,理解数据对象到数据库表的映射原理。 6. 理解并实践事务处理机制,确保数据库操作的正确性和数据的一致性。 7. 通过`51aspx源码必读.txt`学习示例项目的代码逻辑,加深理解。 8. 在数据库中尝试运行示例程序的SQL脚本,观察操作结果。 9. 最后,尝试根据实际需求调整和扩展示例程序,加深对iBatisNet的掌握。 ### 总结 iBatisNet是一个为.NET环境量身定制的持久层框架,它使数据库操作变得更加高效和安全。通过学习iBatisNet的入门示例程序,可以掌握.NET中数据持久化的高级技巧,为后续的复杂数据处理和企业级应用开发打下坚实的基础。
recommend-type

【Dify工作流应用搭建指南】:一站式掌握文档图片上传系统的构建与优化

# 1. Dify工作流应用概述 在现代IT行业中,工作流自动化逐渐成为推动效率和减少人为错误的关键因素。本章将介绍Dify工作流应用的基本概念、核心优势以及应用场景,以助于理解其在企业流程中的重要性。 ## 工作流的定义与重要性 工作流是一系列按照既定顺序完成任务的过程,它旨在实现任务分配、管理和监控的自动化。在企业环境中,工作流应用可以提高任务执行效率、降低
recommend-type

Tree-RAG

<think>我们正在讨论Tree-RAG技术,需要结合用户提供的引用和之前对话中的技术背景。用户之前的问题是关于电力行业设备分析报告中Fine-tuned LLM与RAG的结合,现在转向Tree-RAG技术原理、应用场景及与传统RAG的对比。 根据引用[1]和[4]: - 引用[1]提到GraphRAG与传统RAG的7大区别,指出GraphRAG有更好的数据扩展性,但索引创建和查询处理更复杂。 - 引用[4]提到RAPTOR(Recursive Abstractive Processing for Tree-Organized Retrieval),这是一种Tree-RAG的实现,通过层次
recommend-type

VC数据库实现员工培训与仓库管理系统分析

### VC数据库实例:员工培训系统、仓库管理系统知识点详解 #### 员工培训系统 员工培训系统是企业用来管理员工教育和培训活动的平台,它使得企业能够有效地规划和执行员工的培训计划,跟踪培训进程,评估培训效果,并且提升员工的技能水平。以下是员工培训系统的关键知识点: 1. **需求分析**:首先需要了解企业的培训需求,包括员工当前技能水平、岗位要求、职业发展路径等。 2. **课程管理**:系统需要具备创建和管理课程的能力,包括课程内容、培训方式、讲师信息、时间安排等。 3. **用户管理**:包括员工信息管理、培训师信息管理以及管理员账户管理,实现对参与培训活动的不同角色进行有效管理。 4. **培训进度跟踪**:系统能够记录员工的培训情况,包括参加的课程、完成的课时、获得的证书等信息。 5. **评估系统**:提供考核工具,如考试、测验、作业提交等方式,来评估员工的学习效果和知识掌握情况。 6. **报表统计**:能够生成各种统计报表,如培训课程参与度报表、员工培训效果评估报表等,以供管理层决策。 7. **系统集成**:与企业其它信息系统,如人力资源管理系统(HRMS)、企业资源规划(ERP)系统等,进行集成,实现数据共享。 8. **安全性设计**:确保培训资料和员工信息的安全,需要有相应的权限控制和数据加密措施。 #### 仓库管理系统 仓库管理系统用于控制和管理仓库内部的物资流转,确保物资的有效存储和及时供应,以及成本控制。以下是仓库管理系统的关键知识点: 1. **库存管理**:核心功能之一,能够实时监控库存水平、跟踪库存流动,预测库存需求。 2. **入库操作**:系统要支持对物品的接收入库操作,包括物品验收、编码、上架等。 3. **出库操作**:管理物品的出库流程,包括订单处理、拣货、打包、发货等环节。 4. **物料管理**:对物料的分类管理、有效期管理、质量状态管理等。 5. **仓库布局优化**:系统应具备优化仓库布局功能,以提高存储效率和拣选效率。 6. **设备管理**:管理仓库内使用的各种设备,如叉车、货架、输送带等的维护和调度。 7. **数据报表**:生成各类数据报表,如库存报表、周转报表、成本报表等,提供管理决策支持。 8. **条码与RFID技术**:通过条码扫描或RFID技术,实现仓库作业的自动化和快速识别。 9. **系统集成**:与供应链管理系统(SCM)、制造执行系统(MES)、订单管理系统等进行集成,提升整个供应链的效率。 #### 文件名称列表解读 1. **第04章仓库管理系统**:这部分内容很可能是整个培训或教学材料中关于仓库管理系统的核心章节。它可能详细介绍了仓库管理系统的功能模块、操作流程、数据结构、安全性和维护等内容。 2. **第03章员工培训系统**:这一章节专注于讲解员工培训系统的设计和实施。可能包含培训系统的架构设计、用户交互设计、数据库设计、安全性考虑、系统测试及案例分析等。 通过对以上系统的学习和应用,可以理解IT系统在企业管理中所扮演的角色,提升企业管理效率和员工技能水平。同时,掌握这些系统的设计与实现,对于IT专业人员来说具有重要的实践价值。
recommend-type

【IFIX 4.5 MB1 驱动更新深度解析】:专家分享关键步骤,避免更新陷阱

# 摘要 本文全面介绍了IFIX 4.5 MB1驱动更新的各个方面,包括技术基础、更新的必要性、实践步骤、避免更新陷阱的策略和案例分析。首先概述了IFIX 4.5 MB1的驱动更新概览和技术架构,强调了更新对于提升系统性能和安全性的重要性。然后,具体阐述了更新前的准备、具体操作步骤以及更新后的验证和问题处理。为规避风险,文章接着提出风险评估、预防措施以及更新后的监控和维护方法。最后,通过成功和失败的案例分析,提供了实用的专
recommend-type

display: grid;瀑布流

<think>我们正在解决使用CSS Grid实现瀑布流布局时的重排问题。瀑布流布局中,项目通常具有不同的高度,并按列排列,每列项目依次填充,形成类似瀑布的效果。使用Grid布局时,如果不采取特殊措施,项目会严格遵循网格轨道,导致出现空白间隙或破坏视觉顺序的重排问题。 引用[1]提到Grid布局提供了强大的布局能力,但需要平衡功能性和性能。引用[2]和引用[3]都提到了瀑布流布局的动态内容排版问题,以及使用容器查询和JavaScript计算的方法。 解决方案思路: 1. 使用Grid布局创建列结构,但允许项目跨越多个行,从而避免严格网格带来的空白。 2. 结合JavaScript动
recommend-type

C++实现高效文件传输源码解析

根据给定的信息,可以看出我们主要讨论的是“C++文件传输源码”。以下是关于C++文件传输源码的详细知识点: 1. C++基础知识点: - C++是一种静态类型的、编译式的、通用的编程语言。 - 它支持面向对象编程(OOP)的多个概念,比如封装、继承和多态。 - 文件传输功能通常涉及到输入输出流(iostream)和文件系统库(file system)。 - C++标准库提供了用于文件操作的类,如`<fstream>`中的`ifstream`(文件输入流)和`ofstream`(文件输出流)。 2. 文件传输概念: - 文件传输通常指的是在不同系统、网络或存储设备间传递文件的过程。 - 文件传输可以是本地文件系统的操作,也可以是通过网络协议(如TCP/IP)进行的远程传输。 - 在C++中进行文件传输,我们可以编写程序来读取、写入、复制和移动文件。 3. C++文件操作: - 使用`<fstream>`库中的`ifstream`和`ofstream`类可以进行简单的文件读写操作。 - 对于文件的读取,可以创建一个`ifstream`对象,并使用其`open`方法打开文件,然后使用`>>`运算符或`getline`函数读取文件内容。 - 对于文件的写入,可以创建一个`ofstream`对象,并同样使用`open`方法打开文件,然后使用`<<`运算符或`write`方法写入内容。 - 使用`<filesystem>`库可以进行更复杂的文件系统操作,如创建、删除、重命名和移动目录或文件。 4. 网络文件传输: - 在网络中进行文件传输,会涉及到套接字编程(socket programming)。 - C++提供了`<sys/socket.h>`(在Unix-like系统中)和`<winsock2.h>`(在Windows系统中)用于网络编程。 - 基本的网络文件传输流程包括:创建服务器和客户端套接字,绑定和监听端口,连接建立,数据传输,最后关闭连接。 - 在C++中进行网络编程还需要正确处理异常和错误,以及实现协议如TCP/IP或UDP/IP来确保数据传输的可靠性。 5. 实现文件传输的源码解读: - C++文件传输源码可能会包含多个函数或类,用于处理不同的文件传输任务。 - 一个典型的源码文件可能会包含网络监听、数据包处理、文件读写等功能模块。 - 代码中可能会涉及多线程或异步IO,以提高文件传输的效率和响应速度。 - 安全性也是重要的考虑因素,源码中可能会实现加密解密机制以保护传输数据。 6. 实践中的应用: - 在实际应用中,C++文件传输源码可能被用于文件共享服务、分布式系统、网络备份工具等。 - 了解和掌握文件传输的源码,可以为开发者提供定制和优化文件传输服务的机会。 - 考虑到性能和资源限制,进行文件传输的源码优化也是必要的,比如在大数据量传输时实现缓冲机制、流控制、重传机制等。 7. 常见问题与调试技巧: - 编写文件传输代码时,常见的问题包括路径错误、权限问题、网络中断和数据不完整等。 - 调试时可以使用C++的断点调试、日志记录和单元测试来检查和确认代码的正确性。 - 处理网络文件传输时,还可能需要借助网络分析工具来诊断网络问题。 以上知识点涵盖了C++文件传输源码的多个方面,包括基础编程、文件操作、网络编程、安全性以及实践应用等。对于想要深入理解和实现C++文件传输功能的开发者来说,这些知识是必备的。掌握这些知识可以大大提高在C++环境下开发文件传输功能的效率和质量。