Pull Request已成功合入, 合并人@CANN-robot
(感谢 renshuojian 的贡献)变更摘要
该 PR 主要修正了 StatelessDropOutGenMask 算子中 offsetElemCount 的默认值逻辑,同时应用了 clang-format 代码格式化。核心改动是:当可选的 offset 输入不存在时,将 offsetElemCount 从原来错误的 2 改为正确的 0,并在内核侧增加相应的判空保护,避免对不存在的 offset 张量进行 GM 读取。
主要改动
offsetElemCount默认值修正:在stateless_drop_out_gen_mask_tiling_arch35.cpp的getKeyAndCounterlambda 中,将offsetElemCount的默认值从uint32_t offsetElemCount = 2;改为uint32_t offsetElemCount = 0;,使无可选 offset 输入时元数据传递正确。- 内核侧 offset 读取增加判空保护:在
stateless_drop_out_gen_mask_pt.h的Init方法中,对counterGm_的SetGlobalBuffer和后续读取操作增加了if (offsetElemCount > 0)条件判断,当 offset 不可用时跳过 GM 访问,同时counterVal0/counterVal1保持初始值0。 - 代码格式化(clang-format):对两个文件进行了统一的代码风格调整,包括
=号两侧空格补充(如CORE_ALIGN_SIZE =256→CORE_ALIGN_SIZE = 256)、#include多余空格去除、大括号换行对齐、lambda 参数列表换行、注释对齐、行尾多余空格清理以及文件末尾换行符修复。


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 |
|---|---|---|
| ** | ✅ gcw_kUomxQ2l, 徐鲁威, 宋恺 (3/2) | ✅ gcw_kUomxQ2l (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
rsj007, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


流水线任务触发成功
任务链接 [7f1c45dce43e45a7a9d3fd5553f6229c][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_harmony-infer | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_harmony-infer-chs-math | ✅ SUCCESS | >>>>> | |
| Compile_kirin-harmony-infer-chs-math-1 | ✅ SUCCESS | >>>>> | |
| UT_Test | ✅ SUCCESS | ||
| UT_Test_experimental | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-07-09 11:44:03] CI执行结束


流水线任务触发成功
任务链接 [cd7d5dcf55a340a6b73bb59d2486b34a][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_Pr | ✅ SUCCESS | ||
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_codestyle | ⚠️ WARNING | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
[2026-07-09 11:40:33] CI执行结束


/lgtm


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
wangrui_


/lgtm
/approve


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
wangrui_


/approve


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
wangrui_


/approve


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
wangrui_


描述
修改offsetElemCount 的默认值为0,因为offset是可选输入,在未提供offset的场景避免访问越界。
关联的Issue
https://gitcode.com/cann/ops-math/issues/2186
测试
david冒烟、obp冒烟
文档更新
无
类型标签