Prhub

#5732 [model] chore: Corrected the description of errors related to the 235b script and fixed the error in running the sft script.

原始 PR 作者 autbuster 合并时间 2026-03-24 23:06 文件变更 2 提交数 2 评论 2 代码增减 +3 / -2

执行摘要

修复两个训练脚本的配置错误,包括可能绕过数据验证的风险参数。

根据 PR body,动机是 'Corrected the description of errors related to the 235b script and fixed the error in running the sft script.',即修复与 235b 脚本相关的错误描述并修复 sft 脚本的运行错误,未关联具体 Issue。

建议关注 sft 脚本中 data.ignore_input_ids_mismatch=True 的风险;该 PR 代码变更简单,但讨论揭示了重要数据验证问题,值得开发者了解相关权衡。

讨论亮点

review 讨论中,gemini-code-assist[bot] 和 wucong25 均指出 data.ignore_input_ids_mismatch=True 参数的风险,它绕过 MultiTurnSFTDataset 中的 sanity_check,可能导致训练数据 tokenization 不一致。尽管存在此风险,PR 最终被合并,暗示可能作为临时修复被接受,但未明确解决根本问题。

实现拆解

实现方案涉及两个 shell 脚本文件的修改:

  1. examples/grpo_trainer/run_qwen3_235b_megatron_npu.sh:移除了 actor_rollout_ref.rollout.enable_expert_parallel=True,将 actor_rollout_ref.rollout.enforce_eager=True 改为 False,并添加了编译相关配置行。
  2. examples/sft/gsm8k/run_qwen3_8b_sft_peft_sp2_npu.sh:添加了 data.messages_key=messagesdata.ignore_input_ids_mismatch=True 两个参数,以修复执行错误。
文件 模块 状态 重要度
examples/grpo_trainer/run_qwen3_235b_megatron_npu.sh examples modified 4.0
examples/sft/gsm8k/run_qwen3_8b_sft_peft_sp2_npu.sh examples modified 5.0

分析完成后,这里会展示 LLM 生成的相对完整源码片段和详细注释。

评论区精华

data.ignore_input_ids_mismatch 参数的风险 正确性

gemini-code-assist[bot] 和 wucong25 指出该参数绕过 MultiTurnSFTDataset 的 sanity_check,可能导致训练数据 tokenization 不一致,影响模型正确性。

结论:PR 被合并,风险未被明确解决,可能作为临时修复接受,但建议后续处理根本原因。 · acknowledged

风险与影响

主要风险集中在 sft 脚本中:

  • data.ignore_input_ids_mismatch=True 会禁用关键数据验证检查,可能导致训练数据 tokenization 错误,进而引发模型性能下降或学习失败。
  • 对于 235b 脚本,移除 enable_expert_parallel=True 和修改 enforce_eager 可能影响训练执行模式,但基于 patch 内容,这些调整旨在纠正配置错误,风险较低。

影响范围限于使用这些示例脚本的用户:

  • 修复后,脚本应能正常运行,解决之前存在的执行错误。
  • 对于 sft 脚本,用户需意识到 ignore_input_ids_mismatch 参数可能引入训练数据不一致的风险,需谨慎使用或后续修复根本原因。
  • 整体影响程度中等,主要涉及特定模型(Qwen3)的训练配置。
绕过数据验证 潜在训练数据不一致

关联 Issue

未识别关联 Issue

当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。

完整报告

参与讨论