已关闭
feat: hans_encode/hans_decode算子950编译及独立编译 #3763
Nythas N创建于 7月3日关闭于 14 天前
feat: hans_encode/hans_decode算子950编译及独立编译 #3763
已关闭
Nythas N创建于 7月3日关闭于 14 天前
Nythas N
Nythas N
7月3日

描述

hans_encode/hans_decode算子950编译及独立编译

关联的Issue

https://gitcode.com/cann/ops-math/issues/1979

likedislike
当前Pull Request已关闭, 关闭人@Nythas N
Nythas NNythas N
7月3日 创建了 pull request,commit 294fcaa6
Nythas NNythas N
7月3日 关联了issue:[Bug-Report|缺陷反馈]: hans_encode kernel编译报错
CANN-robotCANN-robot成员
7月3日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
7月3日 评论:

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 /approve or /lgtm
  • Commenting /approve implies 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. 👍

likedislike
Nythas N
Nythas N
7月3日 评论:

compile

likedislike
Nythas NNythas N
7月3日 update merge request[project id: 7649531, iid: 3763, commit_id: 4c37492af1627c3b7f1612dbcb2cdd6d4cf168dd] virtual merging success
CANN-robotCANN-robot成员
7月3日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
7月3日 评论:

流水线任务触发成功
任务链接 [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 >>>>>
likedislike
CANN-robot
CANN-robot成员
7月3日 评论:

流水线任务触发成功
任务链接 [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执行结束

likedislike
CANN-robotCANN-robot成员
7月3日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
7月3日 添加了label:ci-pipeline-failed
atomgit-bot
atomgit-bot
7月3日 评论:

变更摘要

本次PR为 HansEncodeHansDecode 两个算子新增 ascend950 平台的编译支持,使其能够在 950 芯片上进行独立二进制编译。改动涉及算子定义注册、二进制编译配置、simplified_key 模式配置以及 ascendc 全局配置四个层面。

主要改动

  • 算子定义注册 ascend950 平台:在 hans_encode_def.cpphans_decode_def.cpp 中各新增一行 this->AICore().AddConfig("ascend950");,将 ascend950 加入算子的 AI Core 支持平台列表。
  • 新增 ascend950 二进制编译配置文件:为 HansEncodeHansDecode 分别新增 ascend950/hans_encode_binary.jsonascend950/hans_decode_binary.json,定义了 Float32、BFloat16、Float16 三种数据类型下的输入输出张量规格(含 dtype、format、shape)及属性(statisticreshuff)。
  • 新增 simplified_key_mode 配置:为两个算子分别新增 ascend950/hans_encode_simplified_key.iniascend950/hans_decode_simplified_key.ini,均配置 default=0,控制 opc 工具编译时的 --simplified_key_mode 选项行为。
  • ascendc_config.json 扩展 compute_units:在 scripts/kernel/binary_config/ascendc_config.json 的两处配置中,将 HansEncodeHansDecodecompute_units["ascend910b", "ascend910_93"] 扩展为 ["ascend910b", "ascend910_93", "ascend950"],使 ascendc 编译框架识别新平台。
likedislike
Nythas NNythas N
7月3日 update merge request[project id: 7649531, iid: 3763, commit_id: 8875eeea3985c3baab18b78b0880ebcee7b9a773] virtual merging success
Nythas NNythas N
7月3日 推送  1 个提交:db791046-feat: 修复编译错误
Nythas NNythas N
7月3日 update merge request[project id: 7649531, iid: 3763, commit_id: 127432994bb321ffdcddd93c9697e6218f45b69f] virtual merging success
CANN-robotCANN-robot成员
7月3日 添加了label:stat/needs-squash
Nythas N
Nythas N
7月3日 评论:

compile

likedislike
Nythas NNythas N
7月3日 update merge request[project id: 7649531, iid: 3763, commit_id: 70f781644f354d56c9535b958f4bef7d48408cd6] virtual merging success
CANN-robotCANN-robot成员
7月3日 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
7月3日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
7月3日 评论:

流水线任务触发成功
任务链接 [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执行结束

likedislike
CANN-robot
CANN-robot成员
7月3日 评论:

流水线任务触发成功
任务链接 [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 >>>>> >>>>>
likedislike
CANN-robotCANN-robot成员
7月3日 添加了label:api-check-failed
CANN-robotCANN-robot成员
7月3日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
7月3日 添加了label:ci-pipeline-failed
Nythas NNythas N
7月3日 update merge request[project id: 7649531, iid: 3763, commit_id: cce3e10bb4217e227285715e11cd71ebb8b2378d] virtual merging success
Nythas NNythas N
7月3日 推送  1 个提交:8d082335-修复format问题
Nythas NNythas N
7月3日 update merge request[project id: 7649531, iid: 3763, commit_id: d4ee214e648e952ea2cc0304f4a3d65d1742b857] virtual merging success
Nythas N
Nythas N
7月3日 评论:

compile

likedislike
Nythas NNythas N
7月3日 update merge request[project id: 7649531, iid: 3763, commit_id: 31d28acdc56367108c393ddcc695a91c6230a9d4] virtual merging success
atomgit-bot
atomgit-bot
7月3日 评论:

代码审查

基于对所有 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/HansDecodecompute_units 均一致地添加了 "ascend950",与文件中其他算子的模式保持对齐

总体风险评估

  • P0: 0
  • P1: 0
  • P2: 0
  • P3: 0

整体风险判断:低风险。 本次变更为 hans_encode/hans_decode 算子新增 ascend950 平台支持,改动范围明确、模式一致,不涉及逻辑变更或向后不兼容的接口修改。

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

💬 仅评论

likedislike
CANN-robotCANN-robot成员
7月3日 删除了label:ci-pipeline-failedapi-check-failed
CANN-robotCANN-robot成员
7月3日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
7月3日 评论:

流水线任务触发成功
任务链接 [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执行结束

likedislike
CANN-robot
CANN-robot成员
7月3日 评论:

流水线任务触发成功
任务链接 [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 >>>>> >>>>>
likedislike
CANN-robotCANN-robot成员
7月3日 添加了label:api-check-failed
CANN-robotCANN-robot成员
7月3日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
7月3日 添加了label:ci-pipeline-failed
Nythas N
Nythas N
7月3日 评论:

compile

likedislike
CANN-robotCANN-robot成员
7月3日 删除了label:ci-pipeline-failedapi-check-failed
CANN-robotCANN-robot成员
7月3日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
7月3日 评论:

流水线任务触发成功
任务链接 [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执行结束

likedislike
CANN-robot
CANN-robot成员
7月3日 评论:

流水线任务触发成功
任务链接 [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 >>>>> >>>>>
likedislike
CANN-robotCANN-robot成员
7月3日 添加了label:api-check-failed
CANN-robotCANN-robot成员
7月3日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
7月3日 添加了label:ci-pipeline-failed
Nythas NNythas N
14 天前 关闭了 pull request