Pull Request已成功合入, 合并人@CANN-robot
(感谢 季骏 的贡献)变更摘要
此 PR 修复了部分激活算子和量化算子 aclnn demo 中输出缓冲区类型与实际算子输出类型不匹配的问题。具体而言,GeGluBackward 和 GeGluV3Backward 的 demo 错误地使用 float 类型接收 aclFloat16 输出,而 DynamicQuantV2 的 demo 错误地使用 float 类型接收 int8_t 量化输出,导致内存拷贝和打印结果不正确。修复将变量类型、格式化字符串和内存大小计算统一为与算子实际输出一致的类型。
主要改动
test_aclnn_ge_glu_backward.cpp和test_aclnn_ge_glu_v3_backward.cpp结果缓冲区类型修正: 将std::vector<float> resultData改为std::vector<aclFloat16> resultData,使缓冲区类型与算子输出的半精度浮点类型一致。- 激活算子 demo 打印转换: 在
LOG_PRINT中将直接打印resultData[i]改为aclFloat16ToFloat(resultData[i]),确保半精度数据被正确转换为浮点数后再格式化输出。 test_aclnn_dynamic_quant_v2.cpp结果缓冲区类型修正: 将PrintOutResult函数中的std::vector<float> resultData改为std::vector<int8_t> resultData,匹配量化算子的int8_t输出类型。- 量化算子 demo 格式化字符串修正: 将
LOG_PRINT中的%f改为%d,以正确打印int8_t整型结果。 - 量化算子模板函数内存大小计算修正: 在
CreateAclTensor模板函数中将sizeof(float)改为sizeof(T),使内存分配大小与实际模板类型参数匹配,避免泛型函数中硬编码float大小。


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 |
|---|---|---|
| */*/docs/acl*.md | ✅ 陈娇, 陈琦 (2/2) | ✅ 陈娇 (1/1) |
| activation | ✅ 王星, 苏跃明, 陈琦 (3/2) | ✅ 苏跃明, 王星 (2/1) |
| quant | ✅ 王星, 苏跃明, 陈琦 (3/2) | ✅ 王星, 苏跃明 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)


compile


流水线任务触发成功
任务链接 [ef76629c811f45f395d2ac9715055739][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 | ❌ FAILED | >>>>> | |
| 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 | >>>>> | |
| Compile_Ascend_X86_mobile_station_9030_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |


流水线任务触发成功
任务链接 [2350a41d9f7c4c3280dd246efe7fb95c][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_precommit | ❌ FAILED | >>>>> | >>>>> |
| SCA | ✅ SUCCESS | >>>>> |


compile


流水线任务触发成功
任务链接 [518d4e8838284fc2aca362b97919a98a][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 | >>>>> | |
| Compile_Ascend_X86_mobile_station_9030_ubuntu24 | ✅ 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_harmony-infer-chs-nn | ✅ SUCCESS | ||
| UT_Test_harmony-infer-chs-nn-1 | ✅ SUCCESS | ||
| UT_Test_harmony-infer-cpro-nn | ✅ SUCCESS | ||
| UT_Test_report_lcov | ⚠️ WARNING | >>>>> |
[2026-08-07 16:11:01] CI执行结束


流水线任务触发成功
任务链接 [a1ebd1a4ef1a4a609de3f33343c914d0][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> |
[2026-08-07 15:52:36] CI执行结束


/lgtm
/approve


/lgtm
/approve


描述
部分激活算子和量化算子的aclnn demo中,存在变量申请的类型和使用的类型不匹配的问题
关联的Issue
#4608
测试
已跑最新demo
文档更新
更新了
activation/ge_glu_grad_v2/docs/aclnnGeGluBackward.md
activation/ge_glu_grad_v2/docs/aclnnGeGluV3Backward.md
quant/dynamic_quant_v2/docs/aclnnDynamicQuantV2.md
类型标签
AI/Agent生成声明