已关闭
deepseekv3权重合并报错 #105
Sunshine_Youngster创建于  2025年2月14日关闭于  2025年4月3日
Sunshine_Youngster
Sunshine_Youngster成员
2025年2月14日 创建

1.Describe the current behavior / 问题描述 (Mandatory / 必填)

V3 230B 万卡权重合并,报错 ValueError: cannot reshape array of size 194641920 into shape (1,9504,5120)
194641920 = 9504 * 5120 * 4

2.Environment / 环境信息 (Mandatory / 必填)

  • Hardware Environment / 硬件环境(Mandatory / 必填):
    Hardware (e.g.Ascend910B1/Mac CPU)

    样例:

后端类型 硬件具体类别
Ascend 910B1
CPU Mac CPU/Win CPU
  • Software Environment / 软件环境 (Mandatory / 必填):
    迭代版本新增问题样例:(根据实际修改和增删)
Software Version(根据实际修改,必填)
MindSpore MindSpore 2.4.0.B011
MindFormers dev_12be3272
MindIE 1.0.RC2.B101
CANN MILAN&Florence-ASL/ABL V100R001C18SPC001B254
Python Python 3.9.3
OS platform Ubuntu 20.04
GCC/Compiler version 7.3

bugfix版本问题引入样例:(根据实际修改和增删)

Software Version(根据实际修改,必填)
MindSpore MindSpore 2.4.0.B011 (失败)master_20240713153844_a4230c71d(成功)
CANN Milan_C18/20240705(成功) Milan_C18/20240710(失败)
MindIE 1.0.RC2.B101(成功) 1.0.RC2.B101(失败)
Python Python 3.9.3
OS platform Ubuntu 20.04
GCC/Compiler version 7.3

3.Related testcase / 关联用例 (Mandatory / 必填)

  • Testcase Name/ 用例名 (Mandatory / 必填):
    -- Testcase Name(e.g.test_mf_llama_7b_wiki4096_train_cell_dp1mp4pp4mb4_910_16p_0005): *
  • Excute Mode / 执行模式 (Mandatory / 必填):
    -- Excute Mode(e.g., Graph\PyNative): *
    -- Excute Mode(e.g., O0\O1\O2):O*

4.Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

(1)get code from mindformers
(2)使用unified_safetensors.py脚本合并DpskV3权重,报错

5.Describe the expected behavior / 预期结果 (Mandatory / 必填)

【预期结果】:权重合并成功,不报错

6.Related log / screenshot / 日志 / 截图 (Mandatory / 必填)

报错关键日志截图:

输入图片说明

7.Special notes for this issue/备注 (Optional / 选填)

**【定位人】**吴某某(根据实际修改)

likedislike
Sunshine_YoungsterSunshine_Youngster成员
2025年2月14日 添加了问题后端类型的 Ascend 选项
此处折叠了16条事件消息 查看更多
Zziling_huang
2025年2月22日 关联了MindSpore/mindformers Pull Request !5474
ziling_huang
2025年2月24日 评论:

Appearance & Root Cause
问题:移动现场deepseekv3权重合并出现报错
根因:
1.当前使用pipeline并行+优化器并行训练后保存ckpt时,若为共享权重的场景,会在last stage多保存一份额外的共享参数,该份权重的策略文件与首stage共享权重的策略文件不一致,从而导致ckpt在合并时会出现策略文件冲突的情况
2.mindformer在save_checkpoint_network方法中将parameter cast成了Tensor然后送入mindspore save_checkpoint的接口,这会导致原本各个parameter丢失param_info的信息,从而save的过程无法感知的被共享的权重

Fix Solution
1.将最后一个stage接收到的share weight打上标签,在save ckpt时根据该标签将last stage的共享权重进行过滤,不进行保存

Fix Description & Test Suggestion
修复pr:
https://gitee.com/mindspore/mindspore/pulls/81488
https://gitee.com/mindspore/mindspore/pulls/81626
https://gitee.com/mindspore/mindformers/pulls/5473
https://gitee.com/mindspore/mindformers/pulls/5474

Self-test Report & DT Review
移动现场可复现该问题

是否需要补充 ST/UT:否
原因:该修复pr为bugfix且非最终解决方案,当前只针对移动现场场景单点修复,暂不补充用例

likedislike
Zziling_huang
2025年2月24日 添加了   rct/bugfix 标签
Zziling_huang
2025年2月24日 添加了   ctl/codereview 标签
Zziling_huang
2025年2月24日 添加了   rca/codespec 标签
ziling_huang
2025年2月24日 评论:

移动现场验证已通过(黄子灵、赛尧)

likedislike
Zziling_huang
2025年2月24日 添加协作者huangziling
此处折叠了10条事件消息 查看更多
司小南(机器人)司小南(机器人)成员
2025年3月6日 将里程碑从 B-ComponentTest 修改为B-SIG-Parallel
司小南(机器人)
司小南(机器人)成员
2025年3月6日 评论:

【问题单处理不规范】:您问题单根因分析不规范,问题单自动打回:

  1. 未包含 引入原因分析 (Introduction Analysis)

具体规则请查看: https://e.gitee.com/mind_spore/docs/2489468/file/5767947?sub_id=11382313&scope=undefined
@zsj_mind

likedislike
司小南(机器人)
司小南(机器人)成员
2025年3月6日 评论:

请参考以下典型优秀案例进行问题单根因分析,如未按此模板进行根因分析,转回归会被打回,更多问题单规范请参看https://e.gitee.com/mind_spore/docs/2489468/file/5767947?sub_id=11382313&scope=undefined

Appearance & Root Cause
问题:pangu_sigma2.3编译耗时优化未达预期
根因:
1、 2.3上某些pass相比于2.2版本的实现,存在性能劣化
2、 2.3版本把trace功能下掉了,导致前端编译劣化

Fix Solution
1、修复性能劣化的前端图优化pass
2、通过支持boost infer功能把trace功能下掉导致的性能劣化拿回来

Fix Description & Test Suggestion
https://gitee.com/mindspore/mindspore/pulls/70920 PR合入后daily包回归
测试建议:该问题可以通过特性用例防护,增加****场景。

Self-test Report & DT Review
目前前后端耗时在12分钟以内。
是否需要补充 ST/UT:否 如果选择否,请补充理由
原因:非基本功能问题

Introduction Analysis
引入类型:特性合入引入
引入PR:https://e.gitee.com/mind_spore/repos/mindspore/mindspore/pulls/xxx
PR合入时间:年/月/日
问题是否偶现:是/否

likedislike
司小南(机器人)
司小南(机器人)成员
2025年3月6日 评论:

请参考以下典型优秀案例进行问题单根因分析,如未按此模板进行根因分析,转回归会被打回,更多问题单规范请参看https://e.gitee.com/mind_spore/docs/2489468/file/5767947?sub_id=11382313&scope=undefined

Appearance & Root Cause
问题:pangu_sigma2.3编译耗时优化未达预期
根因:
1、 2.3上某些pass相比于2.2版本的实现,存在性能劣化
2、 2.3版本把trace功能下掉了,导致前端编译劣化

Fix Solution
1、修复性能劣化的前端图优化pass
2、通过支持boost infer功能把trace功能下掉导致的性能劣化拿回来

Fix Description & Test Suggestion
https://gitee.com/mindspore/mindspore/pulls/70920 PR合入后daily包回归
测试建议:该问题可以通过特性用例防护,增加****场景。

Self-test Report & DT Review
目前前后端耗时在12分钟以内。
是否需要补充 ST/UT:否 如果选择否,请补充理由
原因:非基本功能问题

Introduction Analysis
引入类型:特性合入引入
引入PR:https://e.gitee.com/mind_spore/repos/mindspore/mindspore/pulls/xxx
PR合入时间:年/月/日
问题是否偶现:是/否

likedislike
ziling_huang
2025年3月11日 评论:

Appearance & Root Cause
问题:移动现场deepseekv3权重合并出现报错
根因:
1、当前使用pipeline并行+优化器并行训练后保存ckpt时,若为共享权重的场景,会在last stage多保存一份额外的共享参数,该份权重的策略文件与首stage共享权重的策略文件不一致,从而导致ckpt在合并时会出现策略文件冲突的情况
2、mindformer在save_checkpoint_network方法中将parameter cast成了Tensor然后送入mindspore save_checkpoint的接口,这会导致原本各个parameter丢失param_info的信息,从而save的过程无法感知的被共享的权重

Fix Solution
1、将最后一个stage接收到的share weight打上标签,在save ckpt时根据该标签将last stage的共享权重进行过滤,不进行保存

Fix Description & Test Suggestion
修复pr:
https://gitee.com/mindspore/mindspore/pulls/81488
https://gitee.com/mindspore/mindspore/pulls/81626
https://gitee.com/mindspore/mindformers/pulls/5473
https://gitee.com/mindspore/mindformers/pulls/5474
测试建议:该问题可以通过特性用例防护,增加共享权重场景。

Self-test Report & DT Review
是否需要补充 ST/UT:否
原因:该修复pr为bugfix且非最终解决方案,当前只针对移动现场场景单点修复,暂不补充用例

Introduction Analysis
引入类型:特性合入引入
引入commit点:be1f5a43d797438fd996ce4a3ff6adf59d3f04fe
PR合入时间:2021年6月16日
问题是否偶现:否

likedislike
Zziling_huang
2025年3月11日 将里程碑从 B-SIG-Parallel 修改为B-ComponentTest
此处折叠了7条事件消息 查看更多
AAtomGit-Bot
2025年12月14日 关联了看板:MindSpore Bug Tracking System