Prhub

#2096 docs: drop dangling Dr.GRPO custom-reducer example reference

原始 PR 作者 EazyReal 合并时间 2026-06-18 18:54 文件变更 3 提交数 1 评论 0 代码增减 +1 / -5

执行摘要

删除失效的 Dr.GRPO 自定义 reducer 示例引用

Issue 指出 --custom-pg-loss-reducer-function-path 的帮助文本和英文/中文文档均引用了一个名为 examples/Dr.GRPO/custom_reducer.py(或 examples/DrGRPO/custom_reducer.py)的示例文件,但该文件在仓库中并不存在。删除这些失效引用,避免用户困惑。

无需精读。对于使用自定义 PG loss reducer 的用户,后续可关注 PR #2090 提供的内置 --loss-aggregation constant 选项。

讨论亮点

无 review 评论。PR body 中维护者提供了替代方案(添加示例文件而非删除引用),并注明后续 PR #2090 的 --loss-aggregation constant 可能使该示例冗余。

实现拆解

  1. slime/utils/arguments.py 中移除 --custom-pg-loss-reducer-function-path 的 help 结尾处的示例路径 (e.g., examples/Dr.GRPO/custom_reducer.py:get_pg_loss_reducer)
  2. docs/en/get_started/customization.md 的第 11 节中删除指向该示例的行。
  3. docs/zh/get_started/customization.md 中同步删除对应示例。
文件 模块 状态 重要度
slime/utils/arguments.py 参数配置 modified 4.82
docs/en/get_started/customization.md 文档 - 英文 modified 1.54
docs/zh/get_started/customization.md 文档 - 中文 modified 1.54

关键源码片段

slime/utils/arguments.py core-logic

修改了 `--custom-pg-loss-reducer-function-path` 参数的帮助文本,移除了指向不存在示例文件的提示。

# slime/utils/arguments.py 第 1050-1054 行:
parser.add_argument(
    "--custom-pg-loss-reducer-function-path",
    type=str,
    default=None,
    help=(
        "Path to a custom reducer function for pg_loss only. "
        "When set, pg_loss will use this custom reducer while other metrics "
        "(pg_clipfrac, ppo_kl, entropy_loss, etc.) still use the default "
        "sum_of_sample_mean." # 原 help 末尾有 "(e.g., examples/Dr.GRPO/custom_reducer.py:get_pg_loss_reducer)",已删除
    ),
)

评论区精华

没有提炼出高价值讨论线程

当前评论区没有形成足够清晰的争议点或结论,后续有更多讨论时会体现在这里。

风险与影响

极低风险。仅删除无效引用,不影响任何功能逻辑。文档中关于自定义 reducer 的接口说明和签名描述仍完整保留。

影响范围小。仅影响查阅文档的用户——不再看到不存在的示例路径。对系统运行无影响。

关联 Issue

未识别关联 Issue

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

完整报告

参与讨论