Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhangjianshe 的贡献)Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/cann-recipes-train | ✅ xuyujun, zhanghz1 (2/2) | ✅ xuyujun (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zhangjianshe, thanks for your pull request. All authors of the commits have signed the CLA. 👍


所有 12 个已变更文件均已逐一审查。以下是各文件审查结论汇总:
| 文件 | 审查结论 |
|---|---|
Dockerfile.vllm_ascend.torchtitan.qwen3 |
P2:未设置 USER 以 root 运行;torchtitan-npu 未锁定 commit |
README.md |
无独立问题(文档中引用的脚本问题已在对应文件中报告) |
apply_all_patches.sh |
P1:管道子 shell 中 exit 1 无法终止父脚本;P2:shebang 不在首行 |
build_project.sh |
P2:shebang 位于版权注释之后(与其他脚本共性问题) |
download_frameworks_source_code.sh |
P1:verl 克隆地址非官方源;P2:缺少 shebang |
internal/train_grpo_qwen3_30b_a3b_16die.sh |
P2:缺少 set -e;$@ 未加引号 |
patches/torchair/0001-...patch |
静态 patch 文件,无安全问题 |
patches/torchtitan/0001-...patch |
静态 patch 文件,无安全问题 |
patches/verl/0001-...patch |
静态 patch 文件,无安全问题 |
patches/vllm_ascend/0001-...patch |
静态 patch 文件,无安全问题 |
requirements.txt |
P2:torch-npu==2.12.0rc1 为候选版本;10 个依赖未锁定版本 |
run_container.sh |
P0:--privileged + --net=host 完全特权运行;P2:未校验输入参数 |
共报告 9 个 findings(1 个 P0、2 个 P1、6 个 P2),覆盖安全、健壮性和可复现性三类问题。最高优先级问题是 run_container.sh 中 --privileged 与 --net=host 的组合使用,以及 apply_all_patches.sh 中管道子 shell 导致 patch 失败被静默忽略的缺陷。


代码审查
我已对所有 12 个变更文件完成了逐一审查。以下是汇总报告。
审查总结
发现数量(按优先级)
| 优先级 | 数量 | 说明 |
|---|---|---|
| P1 | 1 | apply_all_patches.sh 中 git -C / apply 几乎必然失败 |
| P2 | 7 | 配置矛盾、版本未 pin、shebang 位置错误、脚本健壮性缺陷 |
| P3 | 3 | 依赖未固定版本、死代码、LD_PRELOAD 展开时机 |
各文件审查结果
| 文件 | 结果 |
|---|---|
Dockerfile.vllm_ascend.torchtitan.qwen3 |
⚠ 2 个问题(P2 unpinned torchtitan-npu, P3 LD_PRELOAD 展开) |
README.md |
✅ 无问题 |
apply_all_patches.sh |
⚠ 3 个问题(P1 git -C / apply, P2 缺 set -e, P2 shebang 不在首行) |
build_project.sh |
⚠ 1 个问题(P2 shebang 不在首行) |
download_frameworks_source_code.sh |
⚠ 1 个问题(P2 缺 shebang) |
internal/train_grpo_qwen3_30b_a3b_16die.sh |
⚠ 2 个问题(P2 use_remove_padding 矛盾, P2 缺 shebang/set -e) |
patches/torchair/0001-...patch |
✅ 无问题(兼容性 shim 实现正确) |
patches/torchtitan/0001-...patch |
✅ 无问题(NPU 适配修复合理) |
patches/verl/0001-verl-...patch |
⚠ 1 个问题(P3 死代码) |
patches/vllm_ascend/0001-...patch |
✅ 无问题(版本对齐修改正确) |
requirements.txt |
⚠ 1 个问题(P3 依赖未固定版本) |
run_container.sh |
⚠ 1 个问题(P2 多项健壮性缺陷) |
整体风险评估
中等风险。最严重的问题是 apply_all_patches.sh 中 git -C / apply 的用法——在非 git 仓库的 / 根目录上执行 git apply 将直接失败,导致 torchair 兼容性补丁无法应用,可能使 TorchAir 在 torch 2.12 环境下不可用。此外,训练脚本中的 use_remove_padding 矛盾配置和 Dockerfile 中 torchtitan-npu 未固定版本会影响可复现性。其余问题主要涉及脚本健壮性(shebang 位置、set -e 缺失),在 README 推荐的使用方式(bash script.sh)下不会触发,但会降低脚本的独立可执行性。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 1 |
| 🟡 建议 | 13 |
⛔ 需要修改


/lgtm


PR说明
新增基于 TorchTitan 的 Qwen3-30B-A3B GRPO 训练样例。
主要变更包括:
测试报告
基于gsm8k数据集进行了90步训练,reward mean从0.55增长至0.82左右
