已合并
test(futures): add test case patch for futures #33279
dinglaiping创建于 4月8日
test(futures): add test case patch for futures #33279
已合并
从已删除 :add-testcasepatch-for-futures-2.10.0合入到Ascend/pytorchv2.10.0
Pull Request已成功合入, 合并人@ascend-robot
(感谢 dinglaiping 的贡献)4月8日 创建了 pull request,commit f068e40c
Ddinglaiping
4月8日 关联了issue:[Usage]: torch-npu的test_futures.py patch继承自pytorch社区,其中from torch_npu.contrib import transfer_to_npu并不会把CPU张量运行到NPU上,因此NPU适配不完整;其他版本则没有提供patch
4月8日 关联了issue:[Usage]: torch-npu的test_futures.py patch继承自pytorch社区,其中from torch_npu.contrib import transfer_to_npu并不会把CPU张量运行到NPU上,因此NPU适配不完整;其他版本则没有提供patch
ascend-robot
4月8日 评论:
4月8日 评论:
ascend-robot
4月8日 评论:
4月8日 评论:
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 | ✅ 李伟, renyujin (2/2) | ✅ 李伟 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
dinglaiping, thanks for your pull request. All authors of the commits have signed the CLA. 👍


4月8日 添加了label:ascend-cla/yes
dinglaiping
4月8日 评论:
4月8日 评论:
compile


4月8日 添加了label:ci-pipeline-running
4月8日 删除了label:ci-pipeline-running
4月8日 添加了label:ci-pipeline-passed
ascend-robot
4月8日 评论:
4月8日 评论:
流水线 PR-pipeline_pytorch#14594 已完成
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | ✅ | >>> |
| Build_ARM | ✅ | >>> | |
| Build_LibTorch_x86 | ✅ | >>> | |
| Build_X86_torchair | 🛑 | >>> | |
| Build_ARM_torchair | 🛑 | >>> | |
| Build_ARM_inductor | 🛑 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ✅ | >>> |
| check_error | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_X86_Part_01 | 🛑 | >>> |
| UT_X86_Part_02 | 🛑 | >>> | |
| UT_ARM_A3_Part_01 | 🛑 | >>> | |
| UT_ARM_A3_Part_02 | 🛑 | >>> | |
| UT_DIST_X86_Part_01 | 🛑 | >>> | |
| UT_DIST_X86_Part_02 | 🛑 | >>> | |
| UT_DIST_X86_Part_03 | 🛑 | >>> | |
| UT_DIST_X86_Part_04 | 🛑 | >>> | |
| UT_inductor_Part_01 | 🛑 | >>> | |
| UT_inductor_Part_02 | 🛑 | >>> | |
| UT_inductor_Part_03 | 🛑 | >>> | |
| UT_inductor_Part_04 | 🛑 | >>> | |
| UT_ARM_A2_Part_01 | ✅ | >>> | |
| UT_ARM_A2_Part_02 | ✅ | >>> | |
| 流水线 | PR-pipeline_pytorch | ✅ | >>> |


4月8日 添加了label:approved
4月9日 添加了label:lgtm
ascend-robot
4月9日 评论:
4月9日 评论:
4月9日 合入了pull request
【合入来源】
[ ] 问题单
【修改方案】
一、API功能
二、测试用例完备性说明
三、npu适配
3.1 api适配
torch.futures 模块 API 底层无硬件相关逻辑,所有异步结果管理、回调触发、异常传播等核心功能均为框架层通用实现,torch_npu 已完成 NPU 设备的底层适配,无需修改 API 源码,仅通过测试用例的设备相关调整即可实现 NPU 兼容。
3.2 测试用例适配
• 基础环境适配:新增 import torch_npu,让 PyTorch 框架识别 NPU 设备,支持 NPU 张量的创建与操作;
• 张量设备调整:将原测试用例中默认的 CPU 张量(torch.ones(2,2))修改为 NPU 张量(torch.ones(2,2).npu()),确保异步计算的结果载体(张量)运行在 NPU 上,贴合 NPU 场景使用需求。
【资料变更】
【接口变更】
【功能验证】
2.6版本
结果说明
执行test_futures.py测试用例后,终端输出包含若干[E226]级别的错误日志,但最终显示Ran 22 tests in 6.038s且OK,表明所有测试用例执行通过,日志中出现的报错属于测试用例设计的预期行为,非代码 Bug 或 NPU 适配问题。
【CheckList】