已合并
fix: repair kv_rms_norm_rope_cache op_host UT build #5696
zhang-song-rui创建于 5月21日
fix: repair kv_rms_norm_rope_cache op_host UT build #5696
已合并
zhang-song-rui创建于 5月21日
已删除 :master合入到cann/ops-transformermaster
zhang-song-rui
zhang-song-rui成员
5月21日

描述

修复 kv_rms_norm_rope_cache 算子的 opapi UT 未正确纳入构建的问题。
kv_rms_norm_rope_cache 在执行:
bash build.sh -u --opapi --ops=kv_rms_norm_rope_cache 时,opapi UT 需要生成并构建 transformer_op_api_ut。此前该算子目标_cases_obj未指定源文件,导致构建文件无法生成。

关联的Issue

https://gitcode.com/cann/ops-transformer/issues/2560

测试

文档更新

类型标签

  • 🐛 Bug 修复
  • ✨ 新特性
  • ⚡ 性能优化
  • ♻️ 重构
  • 🧪 测试
  • 📦 构建/CI
  • 🔧 配置变更
  • 📝 文档更新
  • ⬆️ 依赖升级
  • 🔒 安全修复
  • 🧹 代码清理
  • ❓ 其他,请描述:
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhang-song-rui 的贡献)
zhang-song-ruizhang-song-rui成员
5月21日 创建了 pull request,commit 6185c292
zhang-song-ruizhang-song-rui成员
5月21日 关联了issue:[bug-report|缺陷反馈]: [AI识别] 测试框架代码存在编译错误,执行`bash build.sh -u --opapi`时出现变量未声明错误(tilingK...
CANN-robot
CANN-robot成员
5月21日 评论:

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
posembedding cc-z, 宋凯 (2/2) 宋凯, cc-z (2/1)

💡 Tip:

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

CLA Signature Pass

zhang-song-rui, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robot成员
5月21日 添加了label:cann-cla/no
此处折叠了7条事件消息 查看更多
CANN-robotCANN-robot成员
5月21日 添加了label:cann-cla/yes
zhang-song-rui
zhang-song-rui成员
5月21日 评论:

/compile

likedislike
zhang-song-ruizhang-song-rui成员
5月21日 update merge request[project id: 7673863, iid: 5696, commit_id: db413b760665707f91450227a3fc4e2952fb9db0] virtual merging success
CANN-robotCANN-robot成员
5月21日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
5月21日 评论:

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

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950_ubuntu24 ✅ SUCCESS >>>>>

[2026-05-21 16:13:31]    CI执行结束

likedislike
zhang-song-ruizhang-song-rui成员
5月21日 修改了pull request 的描述
CANN-robot
CANN-robot成员
5月21日 评论:

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

任务名称状态日志下载链接
codecheck ❌ FAILED codecheck sync failed
SCA ✅ SUCCESS >>>>>
antipoison ❌ FAILED
codecheck_style ✅ SUCCESS codecheck sync failed
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>>
likedislike
zhang-song-rui
zhang-song-rui成员
5月21日 评论:

/compile

likedislike
zhang-song-ruizhang-song-rui成员
5月21日 update merge request[project id: 7673863, iid: 5696, commit_id: 917c604a4b182ad54ba35ff799559f79c801bdf5] virtual merging success
CANN-robotCANN-robot成员
5月21日 删除了label:ci-pipeline-running
atomgit-bot
atomgit-bot
5月21日 评论:

代码审查

新增 kv_rms_norm_rope_cache opapi UT 文件,结构对齐 qkv_rms_norm_rope_cache 参考。发现 3 个低/中风险问题:字符串字面量赋值给非 const char* 指针(C++11+ 不合规)、gmock 头文件未使用、所有测试用例未断言返回值。

类型 数量
🔴 阻塞 0 处
🟡 建议 1 处

✅ 批准

likedislike
atomgit-bot
atomgit-bot5月21日进行代码检视1
posembedding/kv_rms_norm_rope_cache/tests/ut/op_host/op_api/test_aclnn_kv_rms_norm_rope_cache.cpp
@@ -0,0 +42,4 @@
42+ TensorDesc ckv_desc = TensorDesc({181, 1, 1, 512}, ACL_FLOAT16, ACL_FORMAT_ND);
43+ 
44+ double epsilon = 1e-5;
45+ char* cache_mode = "Norm";
atomgit-bot
atomgit-bot5月21日评论:

🟡 Medium Priority

第 45/66/91/118/142/163/186/209 行均将字符串字面量(如 "Norm")赋值给 char* 变量,这在 C++11 及以后标准中不合法(从 const char[] 到 char* 的隐式转换已被移除)。examples 文件使用 char cacheMode[] = "Norm" 是正确做法。严格编译器(如 -Werror=write-strings)会导致编译失败;若函数内部尝试修改该字符串则属于未定义行为。

改动建议
45
- char* cache_mode = "Norm";
45
+ char cache_mode[] = "Norm";
应用建议
likedislike
CANN-robotCANN-robot成员
5月21日 添加了label:ci-pipeline-failed
CANN-robotCANN-robot成员
5月21日 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
5月21日 删除了label:ci-pipeline-failed
CANN-robot
CANN-robot成员
5月21日 评论:

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

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_experimental_950_ubuntu24 ✅ SUCCESS >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-05-21 17:43:54]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
5月21日 评论:

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

任务名称状态日志下载链接
codecheck ❌ FAILED Backend timeout
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>>
likedislike
CANN-robotCANN-robot成员
5月21日 添加了label:api-check-pass
CANN-robotCANN-robot成员
5月21日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
5月21日 添加了label:ci-pipeline-failed
zhang-song-rui
zhang-song-rui成员
5月21日 评论:

/compile

likedislike
zhang-song-ruizhang-song-rui成员
5月21日 update merge request[project id: 7673863, iid: 5696, commit_id: 0a8cda171ee8aa306997813a871ff24f4f22cb32] virtual merging success
CANN-robotCANN-robot成员
5月21日 删除了label:ci-pipeline-failedapi-check-pass
CANN-robotCANN-robot成员
5月21日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
5月21日 评论:

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

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM_experimental_950_ubuntu24 ✅ SUCCESS >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-05-21 18:48:31]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
5月21日 评论:

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

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>>

[2026-05-21 17:50:24]    CI执行结束

likedislike
CANN-robotCANN-robot成员
5月21日 添加了label:api-check-pass
CANN-robotCANN-robot成员
5月21日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
5月21日 添加了label:ci-pipeline-passed
songkai111成员
5月21日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
5月21日 添加了label:approved
赵臣臣成员
5月21日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
5月21日 添加了label:lgtm
CANN-robot
CANN-robot成员
5月21日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: 宋凯, cc-z.
Reviewers who wrote a comment of /lgtm are: 宋凯, cc-z.

likedislike
CANN-robot
CANN-robot成员
5月21日 评论:

The MR can not be merged, because of CodeReview discussion not resolved

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike
zhang-song-ruizhang-song-rui成员
5月21日 解决了最后一个问题
CANN-robot
CANN-robot成员
5月21日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: cc-z, 宋凯.
Reviewers who wrote a comment of /lgtm are: 宋凯, cc-z.

likedislike
CANN-robotCANN-robot成员
5月21日 合入了pull request