已合并
[fix] support memory reuse in launch_host_func_pending #35787
kita-ikuyo创建于 5月15日
[fix] support memory reuse in launch_host_func_pending #35787
已合并
kita-ikuyo创建于 5月15日
kita-ikuyo
kita-ikuyo
5月15日

【合入来源】

如有社区issue,请关联issue链接
请勿携带内部流程信息(需求链接、问题单、内部issue等)

https://gitcode.com/Ascend/pytorch/issues/2009

【修改方案】

请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列
如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容)

launch_host_func_pending由直接传递Tensor改为传递tensor地址,由callback thread根据地址做h2h拷贝,拷贝结束后原始tensor的pinned memory可以被释放并复用。回调线程/python线程使用被拷贝的tensor值做后续print/save,并在print/save结束后释放内存,以节省运行时host内存使用。

【资料变更】

请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及”

不涉及

【接口变更】

请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及”

不涉及

【功能验证】

说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤
新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图

验证ok,修改前整网出现host oom,修改后解决。
2.jpg

【CheckList】

PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x]

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 kita-ikuyo 的贡献)
kita-ikuyokita-ikuyo
5月15日 创建了 pull request,commit 7053fa5f
ascend-robot
ascend-robot成员
5月15日 评论:

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-Ascend/pytorch luochao60, XDaoHong (2/2) XDaoHong (1/1)
test XDaoHong, luochao60 (2/2) XDaoHong (1/1)
torch_npu/npu XDaoHong, luochao60 (2/2) XDaoHong (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

kita-ikuyo, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
ascend-robotascend-robot成员
5月15日 添加了label:ascend-cla/yes
ascend-robot
ascend-robot成员
5月15日 评论:

当前仓库存在以下 保护分支

Protected Branch Version Release
master
v2.7.1
v2.11.0
v2.9.0
v2.10.0
v2.12.0

评论 /sync <branch1> <branch2> ... 可将当前 PR 修改同步到其它分支(创建同步 PR):
a) 如果当前 PR 是 Open 状态,同步操作将延迟到 PR 被合并时执行
b) 如果当前 PR 已经 Merged,将立即执行同步操作

注意:

  1. /sync 命令可以指定同步到多个分支,仅最后一个 /sync 命令生效
  2. 如果创建的同步 PR 不正确,可通过向同步 PR 的源分支提交轻量级 PR 完善,或使用 /close 命令关闭
likedislike
ascend-robot
ascend-robot成员
5月15日 评论:

Ascend docs pipeline is running...

likedislike
此处折叠了110条消息 查看更多
luochao60成员
5月20日 评论:

/lgtm

likedislike
XDaoHong
XDaoHong成员
5月20日 评论:

/approve

likedislike
ascend-robotascend-robot成员
5月20日 添加了label:approvedlgtm
ascend-robot
ascend-robot成员
5月20日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: XDaoHong.
Reviewers who wrote a comment of /lgtm are: XDaoHong, luochao60.

likedislike
ascend-robotascend-robot成员
5月20日 合入了pull request