已合并
matmul类算子kernel入口添加InitSocState初始化寄存器状态 #6445
AlbertYoung192创建于 6月24日
matmul类算子kernel入口添加InitSocState初始化寄存器状态 #6445
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 AlbertYoung192 的贡献)6月24日 创建了 pull request,commit 3690f57e
AAlbertYoung192
6月24日 关联了issue:[Bug-Report|缺陷反馈]: 当前存在部分算子计算过程中,kernel内修改硬件寄存器状态且使用后未还原,引发后续算子计算过程中未知错误的问题。
6月24日 关联了issue:[Bug-Report|缺陷反馈]: 当前存在部分算子计算过程中,kernel内修改硬件寄存器状态且使用后未还原,引发后续算子计算过程中未知错误的问题。
6月24日 添加了label:cann-cla/yes
CANN-robot
6月24日 评论:
6月24日 评论:
CANN-robot
6月24日 评论:
6月24日 评论:
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 |
|---|---|---|
| matmul | ✅ 商晓波, 王子韬 (2/2) | ✅ 商晓波 (1/1) |
| quant | ✅ 商晓波, 王子韬 (2/2) | ✅ 商晓波 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


AlbertYoung192
6月24日 评论:
6月24日 评论:
compile


AAlbertYoung192
6月24日 update merge request[project id: 7665709, iid: 6445, commit_id: 3b83c39727acc7b1514250dca4733cce9ee51e00] virtual merging success
6月24日 update merge request[project id: 7665709, iid: 6445, commit_id: 3b83c39727acc7b1514250dca4733cce9ee51e00] virtual merging success
6月24日 添加了label:ci-pipeline-running
CANN-robot
6月24日 评论:
6月24日 评论:
流水线任务触发成功
任务链接 [7d58dfd7b2d44df6ab6a797534f2b74c][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 | >>>>> | >>>>> |
| Compile_Pre | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| UT_Test_opgraph | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-06-24 10:35:36] CI执行结束


CANN-robot
6月24日 评论:
6月24日 评论:
流水线任务触发成功
任务链接 [3818ed577cc7414ca721cdb6b6f0f36d][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
| SCA | ✅ SUCCESS | >>>>> |
[2026-06-24 10:27:27] CI执行结束


atomgit-bot
6月24日 评论:
6月24日 评论:
变更摘要
此 PR 针对 matmul 类算子的 kernel 入口统一添加 AscendC::InitSocState() 调用,用于在每次 kernel 执行前重置硬件寄存器状态。背景是部分算子在计算过程中会修改硬件寄存器且使用后未还原,导致后续算子计算出现未知错误。通过在 kernel 入口处调用初始化函数,规避了寄存器状态遗留问题。
主要改动
- 6 个 kernel 入口函数添加
AscendC::InitSocState():在batch_mat_mul_v3、fused_mat_mul、mat_mul_v3、rotate_quant、transpose_batch_mat_mul、flat_quant共 6 个__global__ __aicore__kernel 函数体中,于首行业务逻辑前增加AscendC::InitSocState();调用,确保每次 kernel 启动时硬件寄存器状态被重置为默认值。 - 变更范围集中在 matmul 和 quant 算子目录:涉及
matmul/batch_mat_mul_v3、matmul/fused_mat_mul、matmul/mat_mul_v3、matmul/rotate_quant、matmul/transpose_batch_mat_mul、quant/flat_quant六个算子模块,每个文件仅新增一行代码,不涉及业务逻辑修改。


atomgit-bot
6月24日 评论:
6月24日 评论:
6月24日 删除了label:ci-pipeline-running
6月24日 添加了label:ci-pipeline-passed
sxb154714
6月24日 评论:
6月24日 评论:
/lgtm
/approve


6月24日 添加了label:approved
wangzitao
6月24日 评论:
6月24日 评论:
/lgtm


6月24日 添加了label:lgtm
6月24日 合入了pull request
描述
当前存在部分算子计算过程中,kernel内修改硬件寄存器状态且使用后未还原,引发后续算子计算过程中未知错误的问题。在算子kernel入口添加InitSocState,重置硬件寄存器状态,规避上述问题。
关联的Issue
https://gitcode.com/cann/ops-nn/issues/3488
测试
本地自验证、二级冒烟
文档更新
不涉及
类型标签