系统环境

硬件环境(Ascend/GPU/CPU): Ascend

MindSpore版本: 2.2.0

执行模式(PyNative/ Graph): 不限

报错信息

2.1 问题描述

MindSpore大模型并行需要在对应的yaml里面做哪些配置

解决方案

  1. auto_trans_ckpt: True;
  2. load_checkpoint: "" 路径到文件夹,模型并行需要把模型放在rank_0下面;
  3. 需要把mindformer/core/parallel_config.py下面的vocab_emb_dp那一行注释掉;
  4. 使用pipeline并行的时候,要求micro_batch_num>=pipeline_stage;
  5. 模型并行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
Logo

昇腾计算产业是基于昇腾系列(HUAWEI Ascend)处理器和基础软件构建的全栈 AI计算基础设施、行业应用及服务,https://devpress.csdn.net/organization/setting/general/146749包括昇腾系列处理器、系列硬件、CANN、AI计算框架、应用使能、开发工具链、管理运维工具、行业应用及服务等全产业链

更多推荐