已合并
[feat] add nestedtensor backend #30979
culechan创建于 2月25日
[feat] add nestedtensor backend #30979
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 culechan 的贡献)AtlasAccount
2月25日 评论:
2月25日 评论:
ascend-robot
2月25日 评论:
2月25日 评论:
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 | ✅ zqwenn, shaoyf (2/2) | ✅ zqwenn, shaoyf (2/1) |
| test | ✅ shaoyf, zqwenn (2/2) | ✅ shaoyf, zqwenn (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


2月25日 添加了label:ascend-cla/yes
ascend-robot
2月25日 评论:
2月25日 评论:
AtlasAccount
2月25日 评论:
2月25日 评论:
问题/功能描述
本次PR包含两项主要工作:一是对NestedTensor的单元测试进行适配性修改,以支持在NPU硬件设备上正确运行,修复因设备不匹配导致的断言失败问题;二是对代码生成工具进行功能增强和内部重构,增加了对NestedTensor操作注册的支持,并重构了特殊操作(如量化)的注册逻辑,解决了原有代码中逻辑重复、难以扩展的问题。
修改方案描述
针对测试适配,主要修改了test/test_nestedtensor.py文件,通过在创建普通Tensor时显式调用.npu()方法或在创建NestedTensor时指定device="npu:0",确保所有张量运算在NPU设备上进行,并合并了部分测试用例以提高代码复用性。针对代码生成工具,主要扩展了YAML解析以支持nestedtensor配置项,引入了SpecialRegisterConfig数据类来统一管理特殊操作的注册配置,重构了通用的模板化生成流程,并新增了gen_nestedtensor_register函数以生成NestedTensor操作的注册代码。


culechan
2月25日 评论:
2月25日 评论:
compile


2月25日 添加了label:ci-pipeline-running
2月25日 删除了label:ci-pipeline-running
2月25日 添加了label:ci-pipeline-passed
ascend-robot
2月25日 评论:
2月25日 评论:
流水线 PR-pipeline_pytorch#8092 已完成
| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | ✅ | >>> |
| Build_LibTorch | ✅ | >>> | |
| Build_ARM | ✅ | >>> | |
| Build_ARM_inductor | 🛑 | >>> | |
| Build_X86_py311 | 🛑 | >>> | |
| Build_ARM_py311 | 🛑 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | CodeCheck | ✅ | >>> |
| check_error | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_X86_Part_01 | 🛑 | >>> |
| UT_X86_Part_02 | 🛑 | >>> | |
| UT_ARM_A2_Part_01 | ✅ | >>> | |
| UT_ARM_A2_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 | 🛑 | >>> | |
| 流水线 | PR-pipeline_pytorch | ✅ | >>> |


2月26日 修改了pull request 的描述
zhangqiongwen
3月2日 评论:
3月2日 评论:
/approve


3月2日 添加了label:approved
3月7日 添加了label:lgtm
ascend-robot
3月7日 评论:
3月7日 评论:
3月7日 合入了pull request
【合入来源】
【修改方案】
【资料变更】
【接口变更】
【功能验证】
【CheckList】