Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行moe模型时,forward报错 #31

Open
hellopahe opened this issue Jan 4, 2025 · 0 comments
Open

运行moe模型时,forward报错 #31

hellopahe opened this issue Jan 4, 2025 · 0 comments

Comments

@hellopahe
Copy link

作者您好,当运行下面的命令启动基于qwen1.5-1.8b的moe模型时,forward过程的一个assert报错导致进程退出。

python ming/serve/cli.py \
    --model_base /root/autodl-tmp/qwen/qwen1.5-1.8b-chat \
    --model_path /root/autodl-tmp/qwen/ming-moe \
    --conv_template qwen \
    --max_new_token 128 \
    --beam_size 3 \
    --temperature 1.2
  File "/root/autodl-tmp/lora-moe/original-ming-git/MING/ming/model/utils.py", line 231, in forward
    moe_result = self.molora_helper2(x) if self.training else self.molora_helper(x)
  File "/root/autodl-tmp/lora-moe/original-ming-git/MING/ming/model/utils.py", line 386, in molora_helper
    assert selected_experts.shape[0] == 1

请问assert selected_experts.shape[0] == 1是否必要?看了下,else分支中的内容似乎了为了简化计算。注释掉之后,可以正常运行。

另外,请问requirements中的peft的版本是不是有问题,训练时报错,提示找不到use_rslora的参数

[2025-01-04 11:25:27,119] [INFO] [partition_parameters.py:343:__exit__] finished initializing model - num_params = 941, num_elems = 5.39B
/root/autodl-tmp/lora-moe/original-ming-git/MING/ming/train/train.py:522: UserWarning: You set use_rslora as True when using an unsupported peft version; try `pip install peft --upgrade` to fix it.
  warnings.warn("You set use_rslora as True when using an unsupported peft version; try `pip install peft --upgrade` to fix it.")
Adding LoRA adapters...
Traceback (most recent call last):
  File "/root/autodl-tmp/lora-moe/original-ming-git/MING/ming/train/train_mem.py", line 13, in <module>
    train()
  File "/root/autodl-tmp/lora-moe/original-ming-git/MING/ming/train/train.py", line 544, in train
    model = get_mixoflora_model(model, model_args.num_experts, model_args.num_experts_per_token, model_args.expert_selection, use_logit_sum=model_args.output_logit_bias, lora_config=lora_config)
  File "/root/autodl-tmp/lora-moe/original-ming-git/MING/ming/model/utils.py", line 81, in get_mixoflora_model
    new_module = create_mixoflora_module(lora_config, target, num_experts, num_experts_per_token, True if expert_selection == "sampling" else False, use_logit_sum=use_logit_sum, add_bias=add_bias)
  File "/root/autodl-tmp/lora-moe/original-ming-git/MING/ming/model/utils.py", line 50, in create_mixoflora_module
    use_rslora=lora_config.use_rslora,
AttributeError: 'LoraConfig' object has no attribute 'use_rslora'

谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant