执行摘要
- 一句话:修复 nemotron_h.py docstring 缩进警告
- 推荐动作:该 PR 为纯文档修复,价值在于确保 CI 文档构建通过。可快速合并,无需深入审查。建议关注作者测试方案中使用的
--strict 构建模式,该模式可推广至其他文档 PR 以提前发现类似问题。
功能与动机
PR #48018 添加的 docstring 在 main 分支上触发 griffe 警告:Confusing indentation for continuation line 11 in docstring, should be 4 * 2 = 8 spaces, not 6,由于 .readthedocs.yaml 设置了 fail_on_warning: true,该警告直接导致 RTD 构建失败(RTD 33746915 on 866fea2b9)。此 PR 旨在消除该构建失败。
实现拆解
将 get_mamba_state_shape_from_config 方法 docstring 中挂起 bullet 的缩进从 6 空格调整为 8 空格,并将多行描述合并为一行。具体变更:
- 原写法:
- (when use_replayssm is enabled) the x_cache/dt_cache/B_cache
ring-buffer shapes
- 新写法:
- x_cache/dt_cache/B_cache ring-buffer shapes (use_replayssm only)
这样 bullet 内容全部位于与 bullet 标记对齐的同一行(即缩进 4 空格),无续行,完全符合 griffe 的缩进要求。
关键文件:
vllm/model_executor/models/nemotron_h.py(模块 文档;类别 source;类型 documentation): 修复 docstring 缩进的唯一变更文件,直接解决了 RTD 构建失败问题。
关键符号:get_mamba_state_shape_from_config
评论区精华
无实质性讨论。review 均为自动批准,仅 mergify[bot] 提示 pre-commit 失败,但作者后续提交已通过。
风险与影响
- 风险:仅 docstring 文本变更,无运行时影响。风险极低。
- 影响:影响范围仅限于
nemotron_h.py 的 docstring 视觉效果和文档构建。修复后 RTD 构建不再因该警告而失败。对用户无直接功能影响。
- 风险标记:暂无
关联脉络
- PR #48018 [Model] Nemotron-H support: 本 PR 修复了 PR#48018 引入的 docstring 缩进问题,属于其后续清理变更。
参与讨论