当前Pull Request已关闭, 关闭人@Nythas N
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
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| */*/op_host/*_def.cpp | ❌ (0/2)(You can also ask: 张磊, 汤磊, 徐鲁威, andong_hw, 宋恺) | ❌ (0/1)(You can also ask: 王永光, 汤磊) |
| math/hans_decode | ❌ (0/2)(You can also ask: 冯彤, zhangyuxiang0119, 顾宝成, andong_hw, zhanw_coding) | ❌ (0/1)(You can also ask: zhangzijie, zhanw_coding, 顾宝成, 徐鲁威, 周奇龙) |
| math/hans_encode | ❌ (0/2)(You can also ask: 徐鲁威, jia0liang, zhangzijie, 冯彤, 宋恺) | ❌ (0/1)(You can also ask: zhanw_coding, 王林木, andong_hw, 顾宝成, 冯彤) |
| repo-cann/ops-math | ❌ (0/2)(You can also ask: andong_hw, 周奇龙, 顾宝成, 徐鲁威, 王林木) | ❌ (0/1)(You can also ask: zhangzijie, andong_hw, 徐鲁威, 王林木, zhanw_coding) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
NingGuangyou, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


流水线任务触发成功
任务链接 [2c1d8807f3844e9eb6aa6638661a5228][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_harmony-infer | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ❌ FAILED | >>>>> | |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ 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 | >>>>> |


流水线任务触发成功
任务链接 [c20f49c71d314d2499dd95e371b96a9f][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ✅ SUCCESS | >>>>> |
[2026-07-03 10:44:06] CI执行结束


变更摘要
本次PR为 HansEncode 和 HansDecode 两个算子新增 ascend950 平台的编译支持,使其能够在 950 芯片上进行独立二进制编译。改动涉及算子定义注册、二进制编译配置、simplified_key 模式配置以及 ascendc 全局配置四个层面。
主要改动
- 算子定义注册 ascend950 平台:在
hans_encode_def.cpp和hans_decode_def.cpp中各新增一行this->AICore().AddConfig("ascend950");,将 ascend950 加入算子的 AI Core 支持平台列表。 - 新增 ascend950 二进制编译配置文件:为
HansEncode和HansDecode分别新增ascend950/hans_encode_binary.json和ascend950/hans_decode_binary.json,定义了 Float32、BFloat16、Float16 三种数据类型下的输入输出张量规格(含 dtype、format、shape)及属性(statistic、reshuff)。 - 新增 simplified_key_mode 配置:为两个算子分别新增
ascend950/hans_encode_simplified_key.ini和ascend950/hans_decode_simplified_key.ini,均配置default=0,控制 opc 工具编译时的--simplified_key_mode选项行为。 - ascendc_config.json 扩展 compute_units:在
scripts/kernel/binary_config/ascendc_config.json的两处配置中,将HansEncode和HansDecode的compute_units从["ascend910b", "ascend910_93"]扩展为["ascend910b", "ascend910_93", "ascend950"],使 ascendc 编译框架识别新平台。


compile


流水线任务触发成功
任务链接 [fd6ff1df5c944ce4b0865acc31152575][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_harmony-infer | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ 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 | >>>>> | |
| API_Check | ⚠️ WARNING | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-07-03 11:06:52] CI执行结束


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


compile


代码审查
基于对所有 8 个变更文件的全面审查,以下是审查结论。
审查结论
经过对本次 diff 的逐文件审查,未发现需要报告的实际问题。变更内容干净、一致,各项配置与现有模式对齐。
各文件审查结果
| 文件 | 结果 |
|---|---|
math/hans_decode/CMakeLists.txt |
无问题 — 将旧的 file(GLOB) + foreach 模式迁移至项目标准的 add_all_modules_sources,并添加了必要的 include_directories 以修复 Issue #1979 中的跨算子头文件找不到的问题 |
math/hans_decode/op_host/config/ascend950/hans_decode_binary.json |
无问题 — 新增文件,JSON key 拼写正确,结构与 ascend910b 对应配置完全一致 |
math/hans_decode/op_host/config/ascend950/hans_decode_simplified_key.ini |
无问题 — 新增文件,section 名称和配置值正确 |
math/hans_decode/op_host/hans_decode_def.cpp |
无问题 — 仅新增一行 AddConfig("ascend950"),与已有平台注册方式一致 |
math/hans_encode/op_host/config/ascend950/hans_encode_binary.json |
无问题 — 新增文件,JSON key 拼写正确,结构与 ascend910b 对应配置完全一致 |
math/hans_encode/op_host/config/ascend950/hans_encode_simplified_key.ini |
无问题 — 新增文件,section 名称和配置值正确 |
math/hans_encode/op_host/hans_encode_def.cpp |
无问题 — 仅新增一行 AddConfig("ascend950"),与已有平台注册方式一致 |
scripts/kernel/binary_config/ascendc_config.json |
无问题 — 两处 HansEncode/HansDecode 的 compute_units 均一致地添加了 "ascend950",与文件中其他算子的模式保持对齐 |
总体风险评估
- P0: 0
- P1: 0
- P2: 0
- P3: 0
整体风险判断:低风险。 本次变更为 hans_encode/hans_decode 算子新增 ascend950 平台支持,改动范围明确、模式一致,不涉及逻辑变更或向后不兼容的接口修改。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 1 |
💬 仅评论


流水线任务触发成功
任务链接 [9876b15c23a1408991d4a85707b24bc5][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_harmony-infer | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ 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 | >>>>> | |
| API_Check | ⚠️ WARNING | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-07-03 11:25:48] CI执行结束


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


compile


流水线任务触发成功
任务链接 [975241b492fe49ae8040e96296e39604][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_harmony-infer | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ 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 | >>>>> | |
| API_Check | ⚠️ WARNING | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-07-03 11:49:16] CI执行结束


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


描述
hans_encode/hans_decode算子950编译及独立编译
关联的Issue
https://gitcode.com/cann/ops-math/issues/1979