已合并
fix: unskip test_reductions test case in test_multiprocessing_api.py #37039
fix: unskip test_reductions test case in test_multiprocessing_api.py #37039
已合并
wuyouqi1创建于 5月28日
wuyouqi1
wuyouqi1成员
5月28日

【合入来源】

【修改方案】

  1. test/test_multiprocessing_api.py 中 test_reductions 用例在验证 NPU tensor 时,调用了 reduce_tensor + rebuild_npu_tensor 进行同进程内重建比较。
  2. rebuild_npu_tensor 内部通过 aclIpcOpenMemHandle/aclIpcOpenEventHandle 导入 IPC handle,该机制设计用于跨进程共享 NPU 内存,同进程内 import 会触发驱动错误(drvRetCode=17),导致用例失败。
  3. 将 NPU tensor 重建验证改为跨进程方式:主进程 reduce_tensor 导出 handle,通过 Queue 传给子进程,子进程 rebuild_npu_tensor 重建后返回数据,主进程比较。子进程返回 .tolist() 避免 resource_sharer 连接断开问题。
  4. 删除原有 @unittest.skip 装饰器,改为 @unittest.skipUnless(get_cann_version(module="DRIVER") >= "25.3.rc1", ...) 条件跳过。NPU IPC reduce/rebuild 依赖 driver >= 25.3.rc1,低版本 driver 自动跳过该用例。

【资料变更】

不涉及

【接口变更】

不涉及

【功能验证】

  • 测试场景:test_multiprocessing_api.py 中 test_reductions 用例
  • 测试方法:pytest 单元测试
  • 验证结果:PASS

【CheckList】

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 wuyouqi1 的贡献)
wuyouqi1wuyouqi1成员
5月28日 创建了 pull request,commit 359eb454
ascend-robot
ascend-robot成员
5月28日 评论:

The repo or branch is not access to PR-cooperate, please check the current repo https://gitcode.com/Ascend/pytorch.git, branch=v2.7.1

likedislike
ascend-robotascend-robot成员
5月28日 添加了label:stat/needs-squash
ascend-robotascend-robot成员
5月28日 添加了label:ascend-cla/yes
此处折叠了80条消息 查看更多
wuyouqi1wuyouqi1成员
6月5日 修改了pull request 的描述
sunyu-xuan成员
6月5日 评论:

/lgtm

likedislike
ascend-robotascend-robot成员
6月5日 添加了label:lgtm
ascend-robotascend-robot成员
6月5日 合入了pull request
ascend-robot
ascend-robot成员
6月5日 评论:
流水线 pytorch_gitcode_PR_multiVersion#10045 [ commitID:e9c983c8 ] 已完成
likedislike