Pull Request已成功合入, 合并人@CANN-robot
(感谢 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
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| */*/op_host/*_def.cpp | ✅ wangrui_, 王永光, 宋恺, 王林木 (4/2) | ✅ 王永光 (1/1) |
| math/hans_decode | ✅ wangrui_, 王林木, 宋恺 (3/2) | ✅ 宋恺, wangrui_ (2/1) |
| math/hans_encode | ✅ wangrui_, 王林木, 宋恺 (3/2) | ✅ 宋恺, wangrui_ (2/1) |
| repo-cann/ops-math | ✅ 宋恺, wangrui_, 王林木 (3/2) | ✅ wangrui_, 宋恺 (2/1) |
💡 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


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


流水线任务触发成功
任务链接 [bcffc6740c2249b6978627464907ff9d][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 12:19:13] CI执行结束


变更摘要
此 PR 主要将 HansEncode 和 HansDecode 两个算子从仅支持 ascend910b/ascend910_93 扩展为同时支持 ascend950 平台,实现独立编译及 950 芯片适配。具体包括新增 ascend950 平台的二进制编译配置文件与 simplified_key 配置文件,并在算子定义和全局 AscendC 配置中注册 ascend950 芯片。
主要改动
- 新增
HansDecode和HansEncode的 ascend950 二进制配置文件:新增math/hans_decode/op_host/config/ascend950/hans_decode_binary.json和math/hans_encode/op_host/config/ascend950/hans_encode_binary.json,分别定义了Float32、BFloat16、Float16三种数据类型的输入/输出张量及属性(reshuff、statistic),为 ascend950 平台提供算子编译描述。 - 新增
HansDecode和HansEncode的 simplified_key 配置文件:新增hans_decode_simplified_key.ini和hans_encode_simplified_key.ini,将default的simplified_key_mode配置为0,用于 opc 工具在 ascend950 上编译二进制 kernel 时的 key 简化策略。 - 算子定义中注册 ascend950 芯片:在
hans_decode_def.cpp和hans_encode_def.cpp中分别添加this->AICore().AddConfig("ascend950"),使两个算子的 OP 定义在运行时能够加载 ascend950 对应的配置。 - AscendC 全局配置中扩展开算子的计算单元:在
scripts/kernel/binary_config/ascendc_config.json中,将HansEncode和HansDecode的compute_units从["ascend910b", "ascend910_93"]扩展为["ascend910b", "ascend910_93", "ascend950"](文件中两处均修改),使 ascend950 成为正式支持的计算平台。


compile


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


流水线任务触发成功
任务链接 [a9245835f1b64428a07d43161115cc38][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 14:27:11] CI执行结束


/lgtm
/approve


/approve


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