Pull Request已成功合入, 合并人@CANN-robot
(感谢 huang-wei-chen 的贡献)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 |
|---|---|---|
| index | ✅ chenqi317, FelixTang7 (2/2) | ✅ chenqi317 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
huang-wei-chen, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


问题/功能描述
本次PR为GatherElementsV2算子内核添加了MTE3到V引擎的硬件同步机制。主要解决了在数据转置和聚集操作过程中,由于MTE3(内存传输引擎)与V(向量计算单元)之间的执行顺序依赖可能导致的数据不一致问题。通过引入同步,确保V引擎在读取工作空间数据前,MTE3已完成数据写入,从而保证计算结果的正确性。
修改方案描述
修改方案分为两部分:首先,在公共基类中新增了一个通用的内联同步函数 MTE3ToVSync,该函数通过调用现有的硬件事件API(SetFlag 和 WaitFlag)来实现MTE3到V引擎的同步等待。其次,在具体的转置实现中,于聚集操作完成之后、将结果写入工作空间之前,插入对此同步函数的调用,从而确保后续从工作空间读取的数据是最新且完整的,消除了潜在的读写冲突风险。


🔵 source code change are detected, tasks labels is removed in this pull request!


流水线任务触发成功
任务链接 [df093c1725d648efb1d1daffee98888a][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 解析CI分支 | ✅ SUCCESS | ||
| codecheck | ✅ SUCCESS | >>>>> | |
| anti_virus | ✅ SUCCESS | >>>>> | |
| Check_Pr | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ❌ FAILED | >>>>> | |
| Compile_Ascend_X86_mobile_station | ❌ FAILED | >>>>> | |
| Compile_Ascend_ARM | ❌ FAILED | >>>>> | |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950 | ✅ SUCCESS | >>>>> | >>>>> |
| API_Check | ❌ FAILED | >>>>> | |
| Pre_Compile | ✅ SUCCESS | ||
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ❌ FAILED | >>>>> | |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ❌ FAILED | >>>>> | |
| Compile_Ascend_X86_950_ubuntu24 | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| Compile_Ascend_ARM_ubuntu24 | ❌ FAILED | >>>>> | |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_950_ubuntu24 | ✅ SUCCESS | >>>>> | |
| UT_Test_ophost | ⚪ ABORTED | ||
| UT_Test_opapi | ⚪ ABORTED | ||
| UT_Test_kernel | ⚪ ABORTED | ||
| UT_Test_opgraph | ⚪ ABORTED | ||
| Smoke_A900_npupool | ⚪ ABORTED |
[2026-03-17 19:16:54] CI执行失败


compile


流水线任务触发成功
任务链接 [a6bc3a20e5364ac693bad5182b86d468][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 解析CI分支 | ✅ SUCCESS | ||
| codecheck | ✅ SUCCESS | >>>>> | |
| anti_virus | ✅ SUCCESS | >>>>> | |
| Check_Pr | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ❌ FAILED | >>>>> | |
| Compile_Ascend_X86_mobile_station | ❌ FAILED | >>>>> | |
| Compile_Ascend_ARM | ❌ FAILED | >>>>> | |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950 | ✅ SUCCESS | >>>>> | >>>>> |
| API_Check | ❌ FAILED | >>>>> | |
| Pre_Compile | ✅ SUCCESS | ||
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ❌ FAILED | >>>>> | |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ❌ FAILED | >>>>> | |
| Compile_Ascend_X86_950_ubuntu24 | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| Compile_Ascend_ARM_ubuntu24 | ❌ FAILED | >>>>> | |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_950_ubuntu24 | ✅ SUCCESS | >>>>> | |
| UT_Test_ophost | ⚪ ABORTED | ||
| UT_Test_opapi | ⚪ ABORTED | ||
| UT_Test_kernel | ⚪ ABORTED | ||
| UT_Test_opgraph | ⚪ ABORTED | ||
| Smoke_A900_npupool | ⚪ ABORTED |
[2026-03-17 19:33:36] CI执行失败


compile


流水线任务触发成功
任务链接 [50a24f0f619543d8ace94b3238ae0b71][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 解析CI分支 | ✅ SUCCESS | ||
| codecheck | ✅ SUCCESS | >>>>> | |
| anti_virus | ✅ SUCCESS | >>>>> | |
| Check_Pr | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950 | ✅ SUCCESS | >>>>> | >>>>> |
| API_Check | ✅ SUCCESS | >>>>> | |
| Pre_Compile | ✅ SUCCESS | ||
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_950_ubuntu24 | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_950_ubuntu24 | ✅ SUCCESS | >>>>> | |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| UT_Test_opgraph | ✅ SUCCESS | ||
| Smoke_A900_npupool | ✅ SUCCESS | >>>>> |
[2026-03-18 09:55:43] CI执行结束


/lgtm


Review Guide
This pull-request passes review.
Committers who wrote a comment of /approve are: chenqi317.
Reviewers who wrote a comment of /lgtm are: FelixTang7, chenqi317.


描述
在GatherProcess增加MTE3到Vector的同步,确保多轮计算数据正确
关联的Issue
关联Issue #1542
测试
算子泛化1890个用例通过
典型case复现脚本,修改后输出为True
import torch, torch_npu x = torch.randn(8192, 128, dtype=torch.float32) index = torch.randint(0, 8192, size=(8192, 8,)).to(torch.int32) out_npu = torch.gather(x.npu(), 0, index.npu()) out_cpu = torch.gather(x, 0, index.to(torch.int64)) print(f"结果是否一致:{torch.equal(out_cpu, out_npu.cpu())}")文档更新
NA
类型标签