更新时间:2025-07-29 GMT+08:00
分享

准备代码

本教程中用到的模型软件包如下表所示,请提前准备好。

获取模型软件包

本方案支持的模型对应的软件和依赖包获取地址如表1所示。
表1 模型对应的软件包和依赖包获取地址

代码包名称

代码说明

下载地址

AscendCloud-6.5.901-xxx.zip

说明:

软件包名称中的xxx表示时间戳。

包含了本教程中使用到的模型训练代码。代码包具体说明请参见模型软件包结构说明

获取路径:Support-E,在此路径中查找下载ModelArts 6.5.901 版本。

说明:

如果上述软件获取路径打开后未显示相应的软件信息,说明您没有下载权限,请联系您所在企业的华为方技术支持下载获取。

模型软件包结构说明

AscendCloud-6.5.901代码包中AscendCloud-LLM代码包结构介绍如下,训练脚本以分类的方式集中在scripts_modellink文件夹中:
|——AscendCloud-LLM
  |──llm_train                    # 模型训练代码包
    |──AscendFactory   
      |──examples/                # config配置文件目录
      |──data.tgz                 # 样例数据压缩包
      |──third-party/             # patch包
      |──src/acs_train_solution/  # 训练运行包
      |──intall.sh                # 需要的依赖包
      |──scripts_llamafactory/    # llamafactory兼容旧版本启动方式目录
      |──scripts_modellink/       # modelLink兼容旧版本启动方式目录
      |──Dockerfile 

代码上传至SFS Turbo

将AscendFactory代码包AscendCloud-LLM-xxx.zip直接上传至ECS服务器中的SFS Turbo中,例如存放在/mnt/sfs_turbo/AscendCloud-LLM-xxx.zip目录下并解压缩。

unzip AscendCloud-*.zip
unzip AscendCloud-LLM-*.zip

Yi-34B、Qwen1.5系列、GLM4-9B模型执行lora微调策略任务如产生mc2融合算子错误,可参考mc2融合算子报错

结合准备数据准备权重准备代码,将数据集、原始权重、代码文件都上传至SFS Turbo后,目录结构如下。

/mnt/sfs_turbo/
|──llm_train                                  # 模型训练代码包
    |──AscendFactory
       |──config/                             # 配置文件
          |──deepspeed/                       # deepspeed配置json文件
          |──modellink_performance_cfgs.yaml  # ModelLink训练配置json文件
          |──.......
       |──data.tgz                  #样例数据压缩包
       |──intall.sh                 # 需要的依赖包
       |──scripts_modellink/        # modelLink兼容旧版本启动方式目录
          |──llama3                 # llama3系列模型执行脚本的文件夹
          |──qwen2.5                # Qwen2.5系列模型执行脚本的文件夹
          |── ...
          |── dev_pipeline.sh       # 系列模型共同调用的多功能的脚本
       |──third-party/              # patch包
       |──src/acs_train_solution/   # 训练运行包
          |──ascendcloud_patch/     # patch补丁包
          |──benchmark/             #工具包,存放数据集及基线数据
             |──trainer.py          # 训练启动脚本
             |──performance.py      # benchmark训练性能比较启动脚本
             |──accuracy.py         # benchmark训练精度启动脚本
     |──model/Qwen2-7B/             # 权重词表文件目录,如Qwen2-7B 
     |──training_data               # 原始数据目录
        |──alpaca_gpt4_data.json    # 微调数据
        |──train-00000-of-00001-a09b74b3ef9c3b56.parquet #预训练数据 
     |──{output_dir} #{OUTPUT_SAVE_DIR}或yaml文件{output_dir}参数设置值
         # 自动生成数据目录结构
        |── preprocessed_data
        |──converted_hf2mg_weight_TP${TP}PP${PP}
        |──checkpoint    # 训练完成生成目录Qwen2-7B,自动生成

相关文档