Merged
[fix] add TorchTitan runtime dependencies #1215
[fix] add TorchTitan runtime dependencies #1215
Merged
1Fire4Add on 26 days ago
1Fire4
1Fire4Collaborators
26 days ago

描述

补齐 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

精度和性能验证结果

不涉及

其他信息

无

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for 1Fire4's contribution.)
1Fire41Fire4Collaborators
26 days ago Created pull request, commit eaa1c3a0
atomgit-bot
atomgit-botCollaborators
26 days ago Comments:

变更摘要

本 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,保证重计算相关依赖的可复现性。
likedislike
Incorrect?
atomgit-bot
atomgit-botCollaborators
26 days ago Comments:

代码审查

审查结论

按优先级统计: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

💬 仅评论

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
26 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
26 days ago Comments:

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 /approve or /lgtm
  • Commenting /approve implies 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. 👍

likedislike
CANN-robotCANN-robotCollaborators
26 days ago Set hwcaifubi,lrwei0709,zhaowei1936,zhong_lin,zhanghz1,depeng1994,shengnan666,XDaoHong,xuyujun,zhuofanshen,wanghui0,panchao-gitcode,zzyyjj012 as approver
CANN-robotCANN-robotCollaborators
26 days ago Set hwcaifubi,lrwei0709,zhaowei1936,zhong_lin,zhanghz1,depeng1994,shengnan666,XDaoHong,xuyujun,zhuofanshen,wanghui0,panchao-gitcode,zzyyjj012 as approver
atomgit-bot
atomgit-botCollaborators26 days agoStart code review2
requirements.txt
Outdated
@@ -14,1 +14,4 @@
1414grain==0.2.18
15+renderers==0.1.11
16+spmd_types==0.2.5
17+torch_remat @ git+https://github.com/meta-pytorch/remat.git@d302699b1c58f83fa2c7b03bc2593967e9530335
atomgit-bot
atomgit-bot26 days agoComments:

🟡 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 可完整安装。

likedislike
Incorrect?
System
System MessageSystem
26 days ago Comments:

changed this line on 45da5027 view diff detail

likedislike
1Fire41Fire4Collaborators
26 days ago Pre merge succeeded (commit_id: f563a0fc8bda2048e917498ee279fc02a73085fc)
5 event messages are collapsed here。 See more
1Fire41Fire4Collaborators
26 days ago Modify description of pull request
1Fire4
1Fire4Collaborators
26 days ago Comments:

compile

likedislike
1Fire41Fire4Collaborators
26 days ago Pre merge succeeded (commit_id: b37c9d286e99534a3080c063c24deea9c8484898)
CANN-robot
CANN-robotCollaborators
26 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
26 days ago Added label: ci-pipeline-running
5 event messages are collapsed here。 See more
1Fire41Fire4Collaborators
26 days ago Resolved final issue
weijinyi
weijinyiCollaborators
26 days ago Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
26 days ago Added label: approved
zhaowei1936
zhaowei1936Collaborators
26 days ago Comments:

/lgtm

likedislike
CANN-robotCANN-robotCollaborators
26 days ago Added label: lgtm
CANN-robotCANN-robotCollaborators
26 days ago Merged pull request
CANN-robot
CANN-robotCollaborators
26 days ago Comments:

Pull Request 已合并或已关闭。

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike
1Fire41Fire4Collaborators
23 days ago Associated issue: [RFC] TorchTitan v0.4.0 分阶段升级规划与进度跟踪
CANN-robot
CANN-robotCollaborators
23 days ago Comments:

Pull Request 已合并或已关闭。

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike