Pull Request has been successfully merged by CANN-robot.
(Thank you for 1Fire4's contribution.)变更摘要
本 PR 为 requirements.txt 补齐当前 TorchTitan 基线所声明的运行时依赖,属于构建/依赖配置层面的补充,不涉及业务逻辑改动。新增内容包括 renderers、spmd_types 两个带固定版本号的依赖,以及一个固定提交的 torch_remat 依赖,使依赖清单与 TorchTitan 基线保持一致。
主要改动
- 新增
renderers依赖: 在requirements.txt中加入renderers==0.1.11,为运行时提供渲染相关能力并锁定版本。 - 新增
spmd_types依赖: 在requirements.txt中加入spmd_types==0.2.5,补齐 SPMD 类型定义相关的运行时依赖。 - 新增固定提交的
torch_remat依赖: 以固定 commit 形式引入torch_remat,保证重计算相关依赖的可复现性。


代码审查
审查结论
按优先级统计:P0=0,P1=0,P2=1,P3=0,共 1 个问题。
逐文件确认
requirements.txt:已审阅(新增 3 行:renderers==0.1.11、spmd_types==0.2.5、torch_remat @ git+https://github.com/...)。其中renderers/spmd_types均为精确版本钉死,未见与其“TorchTitan 基线依赖”定位相冲突的写法,也未发现本地路径、*通配或被篡改的非官方源地址;仅第 17 行的torch_remat存在 1 个问题(P2),其余 2 行未发现需上报问题。
整体风险判断:低-中等。三个依赖都固定在确定版本/commit(spmd_types、renderers 有版本号,torch_remat 有完整 40 位 commit SHA),没有引入通配版本或可疑本地路径,供应链可复现性尚可;主要风险在于新增 VCS 依赖直连 github.com,与本文件已有的国内镜像获取渠道分叉,在受限网络构建环境下可能导致整份 requirements 安装失败。建议合入前确认目标环境的 GitHub 可达性,或改用镜像/PyPI 版本。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 1 |
💬 仅评论


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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/torchtitan-npu | ✅ lrwei0709, zhaowei1936 (2/2) | ✅ lrwei0709 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
hitwdy, thanks for your pull request. All authors of the commits have signed the CLA. 👍


🟡 Medium Priority
变更行:requirements.txt:17 新增 torch_remat @ git+https://github.com/meta-pytorch/remat.git@d302699b1c58f83fa2c7b03bc2593967e9530335。
影响面/约定:本文件其余所有需要联网的来源都走国内镜像——第 10 行唯一的另一个 VCS 依赖 torchtitan 特意从 gitcode.com(GitHub 镜像)拉取,第 8 行用华为云 OBS 的 torch-npu 索引,第 5/11 行用 pytorch cpu 源与 triton-ascend.osinfra.cn。新增行是该文件中唯一一个直连 github.com 的地址,与既有获取渠道约定产生分叉。
失败模式:在目标构建环境(镜像/受限网络,从上面三处国内镜像可推断)中,pip install -r requirements.txt 对该 VCS 依赖需要执行 git clone https://github.com/meta-pytorch/remat.git;一旦 GitHub 不可达或超时,整条 requirements 安装失败(VCS 依赖无轮子可回退,也无法通过 --extra-index-url 命中缓存),CI 镜像构建/环境初始化会直接中断。相比之下 torchtitan 走 gitcode 镜像可以正常拉取,说明这是新引入的不一致而非既有约束。
建议:将 torch_remat 改为与第 10 行 torchtitan 一致的国内镜像(gitcode)地址并保留同一 commit SHA,或改用 PyPI/现有索引上的固定版本号;改完确认在受限网络下 pip install -r requirements.txt 可完整安装。


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/lgtm
/approve


/lgtm


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


描述
补齐
requirements.txt中未显式声明的 TorchTitan 运行时依赖,并统一torch_remat的版本声明:renderers==0.1.11、spmd_types==0.2.5和torch_remat==0.2.2。pyproject.toml中的torch_remat从 Git 提交依赖改为==0.2.2。类型
Checklist:
如何测试
按照要求安装后可正常跑通dsv4和dsv4.1
精度和性能验证结果
不涉及
其他信息
无