1. 系统环境
硬件环境(Ascend/GPU/CPU): Ascend
MindSpore版本: 2.2.0
执行模式(PyNative/ Graph): 不限
2. 报错信息
2.1 问题描述
MindSpore大模型并行需要在对应的yaml里面做哪些配置
3. 解决方案
- auto_trans_ckpt: True;
- load_checkpoint: “” 路径到文件夹,模型并行需要把模型放在rank_0下面;
- 需要把mindformer/core/parallel_config.py下面的vocab_emb_dp那一行注释掉;
- 使用pipeline并行的时候,要求micro_batch_num>=pipeline_stage;
- 模型并行mp一般设置小一点,建议为2,如果设置过大可能存在通信问题。
#load_checkpoint: "/home/wizardcoder/1_wizardcoder-mindformers/outpu t/checkpoint/" # 权重需要放在这个文件的rank_0下面: :
auto_trans_ckpt: True # If true, auto transform load_checkpoint to load in distributed model
parallel_config:
data_parallel: 1 # 4
model_parallel: 1 # 8
pipeline_stage: 8
optimizer_shard: True
micro_batch_num: 8
vocab_emb_dp: True
gradient_aggregation_group: 4