Pull Request已成功合入, 合并人@CANN-robot
(感谢 Cruiter 的贡献)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 |
|---|---|---|
| repo-cann/asc-devkit | ✅ ookkkkoo1122, wuyang_hw (2/2) | ✅ ookkkkoo1122 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


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


问题/功能描述
修复LayerNorm算子分片信息计算函数中潜在的整数精度丢失问题。在特定硬件架构下,计算向量寄存器长度以2为底的对数时,直接使用log2函数的结果赋值给uint32_t类型变量,可能导致精度丢失和未定义行为,影响分片计算的正确性。
修改方案描述
通过显式类型转换解决精度问题。在GetLayerNormNDTilingInfo函数中,将log2(rHeadLength)的返回值使用static_cast<uint32_t>进行显式转换后赋值给uint32_t k变量,确保了从浮点数到整数的安全、明确的转换。同时,添加了必要的头文件以保障类型定义。此修改消除了潜在的编译器警告和运行时精度风险,提升了代码的健壮性和可移植性。


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


/compile


流水线任务触发成功 [流水线指导]
任务链接 [7763d5027ba14c8a8e68f83dde5e8a9e]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| API_Check | ⚠️ WARNING | >>>>> | |
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| anti_virus | ❌ FAILED | ||
| Check_Pr | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| UT_Test_3 | ⚪ ABORTED | ||
| UT_Test_2 | ⚪ ABORTED | ||
| UT_Test_1 | ⚪ ABORTED | ||
| UT_Test | ⚪ ABORTED | ||
| UT_Test_reprot | ⚪ ABORTED |
[2026-03-02 19:21:59] CI执行失败


/compile


流水线任务触发成功 [流水线指导]
任务链接 [5793e34813814333a015b971618221c1]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| API_Check | ⚠️ WARNING | >>>>> | |
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| anti_virus | ✅ SUCCESS | >>>>> | |
| Check_Pr | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| UT_Test_3 | ✅ SUCCESS | ||
| UT_Test_2 | ✅ SUCCESS | ||
| UT_Test_1 | ✅ SUCCESS | ||
| UT_Test | ✅ SUCCESS | ||
| UT_Test_reprot | ✅ SUCCESS |
[2026-03-02 19:34:41] CI执行结束


/approve


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


描述
layernorm tiling接口存在静态告警,log2接口的返回值存在隐式类型转换
关联的Issue
issue #195
测试
不涉及
文档更新
不涉及
类型标签