已合并
Fix test_torch index dfx checks #4885
jiangna1111创建于 4月30日
Fix test_torch index dfx checks #4885
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 jiangna1111 的贡献)4月30日 创建了 pull request,commit 4b6184a0
ascend-robot
4月30日 评论:
4月30日 评论:
ascend-robot
4月30日 评论:
4月30日 评论:
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/op-plugin | ✅ culechan, zichun_ye (2/2) | ✅ zichun_ye (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
jiangna1111, thanks for your pull request. All authors of the commits have signed the CLA. 👍


4月30日 添加了label:ascend-cla/no
ascend-robot
4月30日 评论:
4月30日 评论:
Ascend docs pipeline is running...


此处折叠了80条消息 查看更多
5月14日 添加了label:docs-ci-pipeline-success
culechan
5月25日 评论:
5月25日 评论:
/lgtm


5月25日 添加了label:lgtm
ascend-robot
5月25日 评论:
5月25日 评论:
5月25日 合入了pull request
【合入来源】
Fixes [Bug]: PyTorch test_torch 部分用例在NPU后端 DFX 行为未对齐
本 PR 目的为修复 PyTorch 官方
test/test_torch.py社区用例在 NPU 后端上的 DFX 对齐问题。相关用例包括:【修改方案】
op_plugin/ops/opapi/IndexAddKernelNpuOpApi.cppindex_add_out和index_add两个入口中,除了操作维度dim外,其他剩余维度 shape 也要验证一致。不一致抛出错误。index_func_meta_impl对index_add会检查self_sizes == source_sizes,其中self_sizes/source_sizes已经排除了指定维度。op_plugin/ops/opapi/IndexPutKernelNpuOpApi.cppop_plugin/ops/aclops/IndexPutKernelNpu.cppself和value,indices,检查self和每个有效 index tensor 之间不能存在内存重叠。torchnpugen/struct/struct_codegen.py增加
${memory_overlap_checks}占位,仅当生成函数名为index_copy_时,注入以下检查:at_npu::native::assert_no_internal_overlap(self); at_npu::native::assert_no_overlap(self, index); at_npu::native::assert_no_overlap(self, source);为生成的 C++ 文件增加
NPUMemoryOverlap.h头文件,否则assert_no_overlap等函数声明不可见,编译会失败。index_fill_npu_*用例说明。op-plugin master已包含 complex scalar 到非 complex tensor 的提前拦截逻辑,本 PR 主要补齐index_add、index_put_、index_copy_相关 DFX 检查。【资料变更】
不涉及。
【接口变更】
不涉及。
【功能验证】
验证环境:
cann8.32.7.1master验证测试用例:
test_index_add_cornercasetest_index_copy_mem_overlap_nputest_index_put_mem_overlap_nputest_index_fill_npu_bfloat16test_index_fill_npu_booltest_index_fill_npu_float16test_index_fill_npu_float32test_index_fill_npu_int32test_index_fill_npu_int64验证结果:
Result
【CheckList】