Open
yingzhao27
opened this issue 10 months ago
•
15 comments
Describe the bug
What the bug is, and how to reproduce, better with screenshots(描述bug以及复现过程,最好有截图)
运行moe模型的grpo训练,报错:
INFO: 127.0.0.1:41874 - "POST /update_named_param/ HTTP/1.1" 200 OK
INFO: 127.0.0.1:41874 - "POST /update_named_param/ HTTP/1.1" 200 OK
INFO: 127.0.0.1:41874 - "POST /update_named_param/ HTTP/1.1" 200 OK
INFO: 127.0.0.1:41874 - "POST /update_named_param/ HTTP/1.1" 200 OK
INFO: 127.0.0.1:41874 - "POST /update_named_param/ HTTP/1.1" 200 OK
INFO: 127.0.0.1:41874 - "POST /update_named_param/ HTTP/1.1" 200 OK
INFO: 127.0.0.1:41874 - "POST /update_named_param/ HTTP/1.1" 200 OK
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] WorkerProc hit an exception.
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] Traceback (most recent call last):
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/vllm/v1/executor/multiproc_executor.py", line 666, in worker_busy_loop
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] output = func(*args, **kwargs)
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] File "/yunpan/zy_exp/other/ms-swift-1219/swift/llm/infer/rollout.py", line 88, in update_named_param
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] self.model_runner.model.load_weights(weights=[(name, weight)])
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/vllm/model_executor/models/qwen3_moe.py", line 689, in load_weights
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] return loader.load_weights(weights)
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/vllm/model_executor/models/utils.py", line 294, in load_weights
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] autoloaded_weights = set(self._load_module("", self.module, weights))
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/vllm/model_executor/models/utils.py", line 252, in _load_module
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] yield from self._load_module(prefix,
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/vllm/model_executor/models/utils.py", line 225, in _load_module
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] loaded_params = module_load_weights(weights)
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/vllm/model_executor/models/qwen3_moe.py", line 526, in load_weights
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] param.weight_loader)
(Worker_TP1 pid=111938) ERROR 01-07 17:21:12 [multiproc_executor.py:671] AttributeError: 'Parameter' object has no attribute 'weight_loader'
Your hardware and system info
Write your system info like CUDA version/system/GPU/torch version here(在这里给出硬件信息和系统信息,如CUDA版本,系统,GPU型号和torch版本等)
Ascend 910B3, torch/torch_npu=2.7.1, vllm/vllm_ascend=0.11.0
Train: 0%| | 0/6 [00:00<?, ?it/s][rank5]: Traceback (most recent call last):
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/cli/rlhf.py", line 7, in
[rank5]: rlhf_main()
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/llm/train/rlhf.py", line 233, in rlhf_main
[rank5]: return SwiftRLHF(args).main()
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/llm/base.py", line 49, in main
[rank5]: result = self.run()
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/ray/base.py", line 170, in wrapper
[rank5]: return func(self, *args, **kwargs)
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/llm/train/sft.py", line 210, in run
[rank5]: return self.train(trainer)
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/llm/train/sft.py", line 258, in train
[rank5]: trainer.train(trainer.args.resume_from_checkpoint)
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/trainers/mixin.py", line 880, in train
[rank5]: res = super().train(*args, **kwargs)
[rank5]: File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/transformers/trainer.py", line 2331, in train
[rank5]: return inner_training_loop(
[rank5]: File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/transformers/trainer.py", line 2680, in _inner_training_loop
[rank5]: tr_loss_step = self.training_step(model, inputs, num_items_in_batch)
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/trainers/rlhf_trainer/grpo_trainer.py", line 1848, in training_step
[rank5]: return super().training_step(model, inputs, num_items_in_batch)
[rank5]: File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/transformers/trainer.py", line 4020, in training_step
[rank5]: inputs = self._prepare_inputs(inputs)
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/trainers/rlhf_trainer/utils.py", line 562, in wrapper
[rank5]: return func(self, *args, **kwargs)
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/trainers/rlhf_trainer/grpo_trainer.py", line 196, in _prepare_inputs
[rank5]: generation_batch = self._generate_and_score_completions(generation_batch)
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/trainers/rlhf_trainer/utils.py", line 562, in wrapper
[rank5]: return func(self, *args, **kwargs)
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/trainers/rlhf_trainer/grpo_trainer.py", line 229, in _generate_and_score_completions
[rank5]: inputs = self._generate_completions(inputs)
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/trainers/rlhf_trainer/grpo_trainer.py", line 210, in _generate_completions
[rank5]: results = self._fast_infer(inputs)
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/trainers/rlhf_trainer/rollout_mixin.py", line 917, in _fast_infer
[rank5]: self._move_model_to_vllm()
[rank5]: self._move_model_to_vllm()
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/trainers/rlhf_trainer/utils.py", line 562, in wrapper
[rank5]: return func(self, *args, **kwargs)
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/trainers/rlhf_trainer/rollout_mixin.py", line 381, in _move_model_to_vllm
[rank5]: self._move_full_model_to_vllm()
[rank5]: File "/yunpan/zy_exp/other/swift-patch/swift/trainers/rlhf_trainer/rollout_mixin.py", line 660, in _move_full_model_to_vllm
[rank5]: with gather_if_zero3(parameters):
[rank5]: File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/deepspeed/runtime/zero/partition_parameters.py", line 2336, in enter
[rank5]: self.params[0].all_gather(param_list=self.params)
[rank5]: File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/deepspeed/runtime/zero/partition_parameters.py", line 1218, in all_gather
[rank5]: return self._all_gather(param_list, async_op=async_op, hierarchy=hierarchy)
[rank5]: File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/deepspeed/utils/nvtx.py", line 20, in wrapped_fn
[rank5]: ret_val = func(*args, **kwargs)
[rank5]: File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/deepspeed/runtime/zero/partition_parameters.py", line 1623, in _all_gather
[rank5]: self._allgather_params_coalesced(all_gather_nonquantize_list, hierarchy, quantize=False)
[rank5]: File "/yunpan/miniconda3/envs/ms_swift/lib/python3.10/site-packages/deepspeed/runtime/zero/partition_parameters.py", line 1912, in _allgather_params_coalesced
[rank5]: flat_tensor = torch.empty(tensor_size, dtype=param_list[0].ds_tensor.dtype,
[rank5]: RuntimeError: NPU out of memory. Tried to allocate 20.00 MiB (NPU 5; 60.96 GiB total capacity; 52.78 GiB already allocated; 52.78 GiB current active; 668.00 KiB free; 60.20 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.