Prhub

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

verl-project/verl · 作者 autbuster · 合并时间 2026-03-24 23:06

分析状态 已生成
文件变更 2提交数 2 · 评论 2
代码增减 +3 / -2
misc examples

执行摘要

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

根据 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 链接,后续同步到相关引用后会出现在这里。

完整报告

执行摘要

本次 PR 修复了两个训练脚本(235b 和 sft)中的配置错误,确保脚本能够正常运行,但 sft 脚本中新增的参数可能绕过关键数据验证检查,引入潜在训练风险,需用户谨慎对待。

功能与动机

PR 的动机是纠正与 235b 脚本相关的错误描述并修复 sft 脚本的运行错误。从 PR body 看,未关联具体 Issue,但旨在解决实际执行中的问题,确保训练流程顺畅。

实现拆解

变更涉及两个 shell 脚本文件:

  • 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,并添加编译配置如 cudagraph_capture_sizescudagraph_mode
  • examples/sft/gsm8k/run_qwen3_8b_sft_peft_sp2_npu.sh:添加 data.messages_key=messagesdata.ignore_input_ids_mismatch=True 参数,以解决执行错误。

评论区精华

review 讨论中,gemini-code-assist[bot] 和 wucong25 均对 data.ignore_input_ids_mismatch=True 提出警告:

"Setting data.ignore_input_ids_mismatch=True silences a critical data processing validation check... By ignoring this mismatch, you are likely proceeding with incorrectly tokenized training data."
尽管风险被指出,PR 仍被合并,暗示可能作为权宜之计,但未解决数据 tokenization 不一致的根本问题。

风险与影响

  • 风险:sft 脚本中 ignore_input_ids_mismatch 参数禁用数据验证,可能导致训练数据 tokenization 错误,影响模型性能;235b 脚本的配置调整风险较低,旨在纠正现有错误。
  • 影响:修复后脚本可正常运行,方便用户部署;但 sft 脚本用户需注意数据风险,可能需后续修复或监控训练效果。

关联脉络

从历史 PR 看,PR #5740 同样涉及 NPU 训练脚本的修复和依赖调整,显示仓库在持续优化 NPU 支持。本次 PR 延续了这一趋势,聚焦于具体脚本错误的纠正,但 sft 脚本中的风险参数提示了更深层的数据处理问题,值得后续关注。

参与讨论