Merged
feat(opbase): 补齐 AddConfigByArch 架构与 SoC 映射并同步双语文档 #1115
esok11Add on 13 days ago
feat(opbase): 补齐 AddConfigByArch 架构与 SoC 映射并同步双语文档 #1115
Merged
Merged fromesok11/opbasef1103intocann/opbasemaster
Pull Request has been successfully merged by CANN-robot.
(Thank you for esok11's contribution.)atomgit-bot
13 days ago Comments:
13 days ago Comments:
变更摘要
本 PR 主要扩充了 src/op_common/op_host/util/op_arch_helper.cpp 中的 NPU 架构到 SoC 名称的映射表 g_archToSocNames,为多个新增的 NpuArch 枚举值补充对应的芯片型号,使算子公共层能够识别这些新平台标识。
主要改动
- 新增麒麟系列平台映射: 在映射表中加入
DAV_3003→kirinx90与DAV_3113→kirin9030两项,使麒麟芯片架构可被g_archToSocNames查询到。 - 新增 031/035 平台映射: 加入
DAV_3004→ascend031与DAV_3505→ascend035,扩展对这两款 SoC 名称的架构识别能力。 - 新增 630 及 960 系列平台映射: 加入
DAV_5102→mc62/ascend630(一个架构对应多个 SoC 名称),以及DAV_9201→ascend960dt、DAV_9202→ascend960pr。 - 保持原有映射结构不变: 新增条目沿用原有
std::map<NpuArch, std::vector<std::string>>的「架构 → SoC 名称列表」形式,未改变表的数据结构与查询方式。


Incorrect?
atomgit-bot
13 days ago Comments:
13 days ago Comments:
13 days ago Added label: cann-cla/yes
CANN-robot
13 days ago Comments:
13 days ago Comments:
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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/opbase | ✅ 宋恺, 汤平川 (2/2) | ✅ 宋恺, 汤平川 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
esok11, thanks for your pull request. All authors of the commits have signed the CLA. 👍


13 days ago Set pengjiahao96,zhou-qilong,wangrui_,rxtfeng,loov1,jia0liang,zl_hw,songkai111,pingchuantang,llimwang,gubaocheng as approver
13 days ago Set pengjiahao96,zhou-qilong,wangrui_,rxtfeng,loov1,jia0liang,zl_hw,songkai111,pingchuantang,llimwang,gubaocheng as approver
13 days ago Set pengjiahao96,zhou-qilong,wangrui_,rxtfeng,loov1,jia0liang,zl_hw,songkai111,pingchuantang,llimwang,gubaocheng as approver
13 days ago Set pengjiahao96,zhou-qilong,wangrui_,rxtfeng,loov1,jia0liang,zl_hw,songkai111,pingchuantang,llimwang,gubaocheng as approver
CANN-robot
13 days ago Comments:
13 days ago Comments:
| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


13 days ago Added label: ci-pipeline-running
13 days ago Removed label: ci-pipeline-running
13 days ago Added label: ci-pipeline-passed
songkai111
13 days ago Comments:
13 days ago Comments:
/approve


13 days ago Added label: approved
TangPC
13 days ago Comments:
13 days ago Comments:
/lgtm
/approve


13 days ago Added label: lgtm
13 days ago Closed associated issue
13 days ago Merged pull request
描述
opbase::ArchConfigHelper::AddConfigByArch通过src/op_common/op_host/util/op_arch_helper.cpp中的g_archToSocNames映射表,把一次 NpuArch 注册展开为该架构下的所有 socVersion。改动前映射表只覆盖DAV_1001、DAV_2002、DAV_2201、DAV_3002、DAV_3102、DAV_3510、DAV_5162七条,调用其它架构时find不到映射会直接return,不注册任何 socVersion(与文档“约束说明”中“入参 arch 不在映射表内时,不注册任何 SoC 版本”一致)。同时中英文文档中的映射表与代码不同步:DAV_3510只写了 ascend950(漏 ascend350),也未列出DAV_5162。本 PR 补齐缺失架构映射并同步双语文档。改动方法
g_archToSocNames新增 7 条映射,按 NpuArch 数值升序插入:DAV_3003→ kirinx90DAV_3004→ ascend031DAV_3113→ kirin9030DAV_3505→ ascend035DAV_5102→ mc62、ascend630DAV_9201→ ascend960dtDAV_9202→ ascend960pr映射表由 7 条增至 14 条;使用的
DAV_*常量均已在include/op_common/op_host/util/op_const_def.h中定义,未新增常量。DAV_3510为 ascend950、ascend350,补上DAV_5162→ ascend5162;中英文条目保持一致(中文用顿号、英文用逗号分隔)。include/op_common/op_host/util/op_arch_helper.h、文档中的函数原型/参数/返回值/约束/调用示例均不变;映射表仍是.cpp内匿名 namespace 的静态表,无对外接口变化。关联的Issue
测试
本 PR 为静态映射表数据补齐 + 文档同步,未改变
AddConfigByArch的控制流(仍是查表命中则逐项AddConfig、未命中则直接返回),仓库内也没有op_arch_helper的既有 UT,因此未新增用例。建议验证:ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_5102, cfg),确认 OpDef 中同时注册 mc62 与 ascend630;对DAV_3003、DAV_3004、DAV_3113、DAV_3505、DAV_9201、DAV_9202分别确认注册到对应 socVersion;g_archToSocNames逐条一致。文档更新
docs/zh/api/op_common/op_host/AddConfigByArch.md:NpuArch→SoC 映射表由 6 行补齐为 14 行。docs/en/api/op_common/op_host/AddConfigByArch.md:同上,与中文版对齐。类型标签