执行摘要
- 一句话:更新Ascend性能分析文档,配置示例由YAML改为Bash命令格式
- 推荐动作:纯文档更新,无需深度精读。开发者可关注本PR中配置示例格式的演变,了解verl项目对Ascend平台配置方式的偏好变化。
功能与动机
PR body中说明为'modify the profiling documentation of ascend',旨在更新Ascend平台性能分析的使用文档,使配置示例更贴近实际命令行操作方式,提升用户参考体验。
实现拆解
- 修改英文文档 (
ascend_profiling_en.rst):将全部配置示例从YAML转换为Bash键=值格式,调整参数描述(如analysis参数从'Enables automatic data parsing'改为'Whether to enable automatic data parsing'),并增加行内注释。
- 修改中文文档 (
ascend_profiling_zh.rst):同步英文修改,并调整章节标题“离散模式采集”为“训练和推理阶段分离”。
- 统一格式:两文档均删除了YAML示例,统一为Bash格式,对
['npu','cpu']等数组值已使用双引号包裹,防止Shell解析错误。
关键文件:
docs/ascend_tutorial/dev_guide/performance/ascend_profiling_en.rst(模块 文档;类别 docs;类型 documentation): 核心文件,更新了英文版profiling配置示例与参数描述,并调整章节结构。
docs/ascend_tutorial/dev_guide/performance/ascend_profiling_zh.rst(模块 文档;类别 docs;类型 documentation): 同步英文文档修改,更新中文版配置示例,并调整章节标题为更清晰的表述。
关键符号:未识别
关键源码片段
docs/ascend_tutorial/dev_guide/performance/ascend_profiling_en.rst
核心文件,更新了英文版profiling配置示例与参数描述,并调整章节结构。
# End-to-End collection example
global_profiler.tool=npu
global_profiler.steps="[1, 2, 5]" # Number of steps to be collected
global_profiler.save_path=./outputs/profile
actor_rollout_ref.actor.profiler.enable=True
actor_rollout_ref.actor.profiler.all_ranks=False
actor_rollout_ref.actor.profiler.ranks="[0]" # Only collect rank 0 data
actor_rollout_ref.actor.profiler.tool_config.npu.discrete=True # Recommended discrete mode
actor_rollout_ref.actor.profiler.tool_config.npu.contents="['npu','cpu']" # Control collection list
actor_rollout_ref.actor.profiler.tool_config.npu.level=level1
actor_rollout_ref.actor.profiler.tool_config.npu.analysis=False # Disable automatic data parsing
docs/ascend_tutorial/dev_guide/performance/ascend_profiling_zh.rst
同步英文文档修改,更新中文版配置示例,并调整章节标题为更清晰的表述。
# 端到端采集示例
global_profiler.tool=npu
global_profiler.steps="[1, 2, 5]" # 采集步数
global_profiler.save_path=./outputs/profile
actor_rollout_ref.actor.profiler.enable=True
actor_rollout_ref.actor.profiler.all_ranks=False
actor_rollout_ref.actor.profiler.ranks="[0]" # 只采集 rank 0 数据
actor_rollout_ref.actor.profiler.tool_config.npu.discrete=True # 推荐使用离散模式
actor_rollout_ref.actor.profiler.tool_config.npu.contents="['npu','cpu']" # 控制采集列表
actor_rollout_ref.actor.profiler.tool_config.npu.level=level1
actor_rollout_ref.actor.profiler.tool_config.npu.analysis=False # 禁用自动数据解析
评论区精华
Review中存在两类核心讨论:
风险与影响
- 风险:配置示例从YAML改为Bash后,若用户直接复制,需注意Bash中数组字符串(如['npu','cpu'])需用双引号包裹防止Shell解析错误。当前文档已使用双引号,风险较低。此外,文档删除了YAML示例,对习惯YAML配置的用户可能造成不便,但整体影响可控。未涉及任何代码逻辑变更,无回归风险。
- 影响:影响范围仅限于Ascend平台的文档用户,不涉及任何代码逻辑变更。用户可通过更新后的文档更便捷地使用命令行配置profiler,降低学习成本。但需注意示例仅覆盖部分配置,未涵盖所有场景。
- 风险标记:配置示例Bash语法准确性, 缺少YAML示例兼容性
关联脉络
参与讨论