已合并
fix d2h pinned memeory bug #31778
zzhongmin创建于 3月13日
fix d2h pinned memeory bug #31778
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 zzhongmin 的贡献)AtlasAccount
3月13日 评论:
3月13日 评论:
ascend-robot
3月13日 评论:
3月13日 评论:
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 |
|---|---|---|
| test | ✅ liujunzhu, suhaibo, liangsongwei (3/2) | ✅ liujunzhu (1/1) |
| torch_npu/utils | ✅ liangsongwei, liujunzhu, suhaibo (3/2) | ✅ liujunzhu (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zzhongmin, thanks for your pull request. All authors of the commits have signed the CLA. 👍


3月13日 添加了label:ascend-cla/yes
zzhongmin
3月13日 评论:
3月13日 评论:
compile


此处折叠了132条消息 查看更多
3月25日 添加了label:lgtm
liujunzhu
3月25日 评论:
3月25日 评论:
/approve


3月25日 添加了label:approved
ascend-robot
3月25日 评论:
3月25日 评论:
Review Guide
This pull-request passes review.
Committers who wrote a comment of /approve are: liujunzhu.
Reviewers who wrote a comment of /lgtm are: liujunzhu, suhaibo, liangsongwei.


3月25日 合入了pull request
【合入来源】
【修改方案】
--问题背景:在 NPU 序列化场景下,test_use_pinned_memory_for_d2h 期望 write_record 收到的是 pinned host storage
现有流程里,_reduce_ex_阶段在进入 _npu_save 前已把 storage 变成 CPU,导致原来的仅非 CPU storage 才走 pinned D2H 逻辑覆盖不到。
--解决方案:仅调整 NPU 保存路径,在 _npu_save 中保留原有 storage.device != cpu 的 pinned D2H 分支,新增 CPU fallback 当 use_pinned_memory_for_d2h=True 且当前 accelerator 为 npu 时,如果 storage 已是 CPU,也在写盘前转换为 pinned CPU storage,再 write_record。
【资料变更】
不涉及
【接口变更】
不涉及
【功能验证】
test_serialization.py -v -k test_use_pinned_memory_for_d2h用例通过
【CheckList】