[Bug] 使用moe的config微调报错
@sunpengsdu is already working on this.
Since Mar 28, 2024.
Assessment
This issue has not been assessed yet.
Description
描述该错误
非常感谢您的工作!
我在使用代码进行sft时遇到了一个问题。在不使用moe的config时能够很好的运行,在使用moe的config文件后报错。
运行代码:
torchrun --nnodes=1 --nproc_per_node=8 train.py --config ./configs/7B_MoE4_sft.py --launcher "torch"
报错信息:
Traceback (most recent call last):
File "train.py", line 324, in <module>
main(args)
File "train.py", line 105, in main
model = initialize_model()
File "/root/wbq/internlm_moe/InternEvo/internlm/utils/timeout.py", line 102, in wrapper
result = func(*args, **kwargs)
File "/root/wbq/internlm_moe/InternEvo/internlm/train/pipeline.py", line 167, in initialize_model
model = MODEL_INITIALIZER.get_module(module_name=gpc.config.model_type)(**(gpc.config.model))
File "/root/wbq/internlm_moe/InternEvo/internlm/model/modeling_moe.py", line 584, in build_model_with_moe_cfg
return _build_generic_model_1d(num_layers=num_layers, num_chunks=num_chunks, **cfg)
File "/root/wbq/internlm_moe/InternEvo/internlm/model/modeling_moe.py", line 482, in _build_generic_model_1d
chunk = PackedFlashInternLm1D(**filter_kwargs(PackedFlashInternLm1D.__init__, kwargs)).to(device)
File "/root/wbq/internlm_moe/InternEvo/internlm/model/modeling_moe.py", line 356, in __init__
[
File "/root/wbq/internlm_moe/InternEvo/internlm/model/modeling_moe.py", line 357, in <listcomp>
PackedFlashBaseLayer1D(
File "/root/wbq/internlm_moe/InternEvo/internlm/model/modeling_moe.py", line 94, in __init__
self.mixer = MHA(
File "/root/wbq/internlm_moe/InternEvo/internlm/model/modules/multi_head_attention.py", line 364, in __init__
self.rotary_emb = RotaryEmbedding(
File "/root/wbq/internlm_moe/InternEvo/internlm/model/modules/embedding.py", line 287, in __init__
self.inv_freq = 1.0 / (base ** (torch.arange(0, dim, 2, device=device, dtype=torch.float32) / dim))
TypeError: arange() received an invalid combination of arguments - got (int, int, int, dtype=torch.dtype, device=device), but expected one of:
* (Number end, *, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
* (Number start, Number end, *, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
* (Number start, Number end, Number step, *, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
环境信息
torch==2.1.0+cu118
transformers<4.30.0
sentencepiece
numpy
tqdm
psutil
packaging
pre-commit
ninja
gputil
pytest
packaging
boto3
botocore
torch-scatter
pyecharts
py-libnuma
pynvml
tensorboard
其他信息
1、我只修改了./configs/7B_MoE4_sft.py中训练集和测试集的地址
- Dominant language
- Python
- Stars
- 420
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from InternLM/InternEvo
-
[Feature] 该怎么在VLM训练里也用这个框架?有示例吗May be free again @yhcc claimed this 584 days ago, and no pull request is open. Openenhancement
-
[Bug] Some spelling errors in repoMay be free again @sunpengsdu claimed this 652 days ago, and no pull request is open. Openbug
-
[Bug] CPU Mem utilization grows with training, when Dataloader num_workers>0May be free again @yhcc claimed this 654 days ago, and no pull request is open. Openbug
-
[Bug] TypeError: Qwen2.__init__() got an unexpected keyword argument 'enable_qkv_fusion'May be free again @ZwwWayne claimed this 672 days ago, and no pull request is open. Openbug
-
[Feature] Add Lingen - MATE architecture (SSM Mamba2 based) as a model optionMay be free again @yhcc claimed this 690 days ago, and no pull request is open. Openenhancement
All issues in InternLM/InternEvo
Similar issues
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
future-agi/future-agi#5908 ·
Maintainers usually reply within 1 day
-
Placeholder export disables HTML image input for picture descriptionPossibly taken @cloudiful claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
docling-project/docling-serve#817 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Techiebutler/freeframe#687 ·
Maintainers usually reply within 1 day
-
Parse truncated verbose GC logs up to the first XML errorPossibly taken A pull request linked to this issue is open or already merged. Openbug verbose GC
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
IBM/javacore-analyser#677 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 2 days