已合并
fix: 为 apply_adam/adam_d tiling 类成员添加显式初始化值 #6197
cheng-ziyang2创建于 6月17日
fix: 为 apply_adam/adam_d tiling 类成员添加显式初始化值 #6197
已合并
cheng-ziyang2创建于 6月17日
cheng-ziyang2成员
6月17日

描述

修复 apply_adam 与 apply_adam_d 算子 codecheck 静态告警:为 tiling 类中未显式初始化的成员变量添加默认值。

改动原因

ApplyAdamTiling 与 ApplyAdamDTiling 类中私有成员 varDtype_、useLocking_、useNesterov_ 在类定义中未显式初始化。若后续代码在使用这些成员前未正确赋值,将导致未定义行为,codecheck 静态检查对此发出告警。

改动方法

为三个成员变量添加类内默认初始化值:

  • varDtype_ → ge::DT_FLOAT16
  • useLocking_ → false
  • useNesterov_ → false

涉及文件:

  • optim/apply_adam/op_host/arch35/apply_adam_tiling.cpp
  • optim/apply_adam_d/op_host/arch35/apply_adam_d_tiling.cpp

关联的Issue

测试

  • 编译通过,无新增告警
  • codecheck 静态检查通过

文档更新

无

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 cheng-ziyang2 的贡献)
Ccheng-ziyang2成员
6月17日 创建了 pull request,commit 8df59b91
CANN-robotCANN-robot成员
6月17日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
6月17日 评论:

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
optim ✅ 陈风, 王星 (2/2) ✅ 陈风, 王星 (2/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

cheng-ziyang2, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
chenfengchenfeng成员
6月17日 修改标题为 “fix: 为 apply_adam/adam_d tiling 类成员添加显式初始化值”,原标题为“fix codecheck”
chenfengchenfeng成员
6月17日 修改了pull request 的描述
Ccheng-ziyang2成员
6月17日 修改了pull request 的描述
cheng-ziyang2成员
6月17日 评论:

compile

likedislike
Ccheng-ziyang2成员
6月17日 预合并成功(commit_id: 6c2cb584f7c11863ae41a39d1537ad92e40d799d)
CANN-robotCANN-robot成员
6月17日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
6月17日 评论:

流水线任务触发成功
任务链接 [d12e0b5bbfa44e00a62fb0bfc4140abd][流水线指导]

任务名称状态日志下载链接
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 >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_950_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_950_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_classify ✅ SUCCESS >>>>>
UT_Test_ophost ✅ SUCCESS
UT_Test_opapi ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
UT_Test_opgraph ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>
UT_Test_report_lcov ✅ SUCCESS >>>>>

[2026-06-17 16:22:04]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
6月17日 评论:

流水线任务触发成功
任务链接 [a00027a226ea4f26afe1135d4b29fd18][流水线指导]

任务名称状态日志下载链接
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-17 16:12:41]    CI执行结束

likedislike
CANN-robotCANN-robot成员
6月17日 添加了label:api-check-pass
CANN-robotCANN-robot成员
6月17日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
6月17日 添加了label:ci-pipeline-passed
cheng-ziyang2成员
6月17日 评论:
likedislike
chenfeng
chenfeng成员
6月18日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
6月18日 添加了label:approved
wang-xing001成员
6月18日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
6月18日 添加了label:lgtm
CANN-robotCANN-robot成员
6月18日 关闭了关联的issue
CANN-robotCANN-robot成员
6月18日 合入了pull request