执行摘要
- 一句话:删除失效的 Dr.GRPO 自定义 reducer 示例引用
- 推荐动作:无需精读。对于使用自定义 PG loss reducer 的用户,后续可关注 PR #2090 提供的内置
--loss-aggregation constant 选项。
功能与动机
Issue 指出 --custom-pg-loss-reducer-function-path 的帮助文本和英文/中文文档均引用了一个名为 examples/Dr.GRPO/custom_reducer.py(或 examples/DrGRPO/custom_reducer.py)的示例文件,但该文件在仓库中并不存在。删除这些失效引用,避免用户困惑。
实现拆解
- 在
slime/utils/arguments.py 中移除 --custom-pg-loss-reducer-function-path 的 help 结尾处的示例路径 (e.g., examples/Dr.GRPO/custom_reducer.py:get_pg_loss_reducer)。
- 在
docs/en/get_started/customization.md 的第 11 节中删除指向该示例的行。
- 在
docs/zh/get_started/customization.md 中同步删除对应示例。
关键文件:
slime/utils/arguments.py(模块 参数配置;类别 source;类型 core-logic): 修改了 --custom-pg-loss-reducer-function-path 参数的帮助文本,移除了指向不存在示例文件的提示。
docs/en/get_started/customization.md(模块 文档-英文;类别 docs;类型 documentation): 删除了英文文档第 11 节末尾的示例路径引用。
docs/zh/get_started/customization.md(模块 文档-中文;类别 docs;类型 documentation): 同步删除了中文文档第 11 节末尾的示例路径引用。
关键符号:未识别
关键源码片段
slime/utils/arguments.py
修改了 --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)",已删除
),
)
评论区精华
无 review 评论。PR body 中维护者提供了替代方案(添加示例文件而非删除引用),并注明后续 PR #2090 的 --loss-aggregation constant 可能使该示例冗余。
风险与影响
- 风险:极低风险。仅删除无效引用,不影响任何功能逻辑。文档中关于自定义 reducer 的接口说明和签名描述仍完整保留。
- 影响:影响范围小。仅影响查阅文档的用户——不再看到不存在的示例路径。对系统运行无影响。
- 风险标记:暂无
关联脉络
- PR #2090 Add --loss-aggregation constant for Dr.GRPO: PR body 提及 #2090 提供了内置的
--loss-aggregation constant,可能使自定义 reducer 示例冗余。
参与讨论