Qwen3.5多节点SFT训练主Loss异常上下震荡问题
Checklist / 检查清单
- [x] I have searched existing issues, and this is a new bug report. / 我已经搜索过现有的 issues,确认这是一个新的 bug report。
Bug Description / Bug 描述
多机loss抖动示例:
8 x 8 H20-141G训练的主loss曲线:
8x2节点,8x4节点都有这个问题,但是8x1节点的Loss是正常平滑下降的。
目前团队里面多人都已复现出了上述训练结果,怀疑Swift在处理多机梯度更新时是否存在梯度异常等问题?单机看起来是正常的;训练的基座模型为Qwen3.5-35B-A3B模型;
另外,对齐训练超参数和训练数据,对比单独的megartron训练的Qwen3.5-35B-A3B,在多机训练下就没有上述问题,已经排除了"tool_call" role、训推模版等问题,怀疑属于多节点梯度收集异常
How to Reproduce / 如何复现
版本:https://github.com/modelscope/ms-swift/commit/27ae5991b601174cd9124447cbf50b6d0e269d0e,main分支; 运行环境:linux 复现步骤:相同数据、相同megatron并行设置配置、单机和多机即可看到差异(因此怀疑Data Parallel有点问题?)
Additional Information / 补充信息
No response
group_by_length导致的,或者你使用packing就没有这个问题了
group_by_length导致的,或者你使用packing就没有这个问题了
谢谢我们试试,另外这个属于符合预期,不算一个bug么
我们尝试了这个设置,loss震荡的情况有所缓解,但是训练的效果不如用deepspeed的后端效果好,请问有什么建议吗
This issue has been inactive for over 3 months and will be automatically closed in 7 days. If this issue is still relevant, please reply to this message.
This issue has been automatically closed due to inactivity. If needed, it can be reopened.