Merged
[feat] CCU api for resource management #3367
[feat] CCU api for resource management #3367
Merged
p_chAdd on Jul 3
p_ch
p_ch
Jul 3

描述

本 PR 在已合入的 #3538 新增的 CCU 资源管理接口声明及阶段性桩实现基础上,将资源描述符、CCU 实例创建与资源查询相关的 C 接口落地为功能实现,并补齐「资源描述符 -> CCU 实例 -> 绑定通信域」的资源规划链路,使上层能够在创建 CCU 实例前按 ioDie 查询 Kernel 资源诉求、配置资源数量并申请实例。本批新增能力当前仅支持 Ascend 950PR/950DT。

主要改动:

  • CCU 资源管理接口
    • 实现资源描述符相关接口:HcommCcuInsResDescCreate、HcommCcuInsResDescDestroy、HcommCcuInsResDescSetNum、HcommCcuInsResDescQueryNum、HcommCcuInsResDescQueryDieId。
    • 实现 CCU 实例创建与销毁接口:HcommCcuInsCreate、HcommCcuInsCreateDefault、HcommCcuInsDestroy。
    • 实现 CCU 实例与剩余资源查询接口:HcommCcuInsQueryResDesc、HcommCcuQueryRemainResDesc。
    • 实现 Kernel 资源诉求查询接口:HcommCcuKernelQueryResReq。
  • 通信域与 CCU 实例
    • 实现 CCU 实例绑定通信域接口:HcclCommAssignCcuIns。
    • 修改通信域 CCU 实例查询接口说明:HcclCommQueryCcuIns。
    • 修改 MyRank 的 CCU 初始化与清理流程。
  • 内部资源管理
    • 新增 CcuResDesc、CcuResDescMgr 和 ccu_res_type_converter.h。
    • 修改 CcuInstance、CcuInstanceMgr、CcuResPack、CcuKernel 和 CcuKernelMgr。
  • device 与 legacy 平台
    • 新增 device 资源数量查询与批量分配接口:CcuGet{LoopEngine,Ms,Cke,Xn,Gsa,Instruction,Mission}Num、CcuAllocResHandleByResDescs。
    • 修改 base_comm 与 legacy ascend950 的 ccu_component、ccu_res_allocator 和 ccu_res_batch_allocator。

hccl 仓侧通过 dlsym 动态加载本批接口并进行算子侧动态资源分配的配套改动见 cann/hccl#1998。

变更类型

请选择本次引入的变更类型:

关联的PR

  • 前序:资源管理接口声明、对外类型、安装规则及阶段性桩实现(已合并,cann/hcomm):#3538
  • 配套:hccl 仓 dlsym 动态加载与算子侧资源分配(cann/hccl,@zhongyu1):#1998

测试

本 PR 补充或调整了以下 UT 代码:

  • 新增 ut_HcommCcuKernelQueryResReq_test.cc(623 行)
  • 新增 ut_HcommCcuResDescApi_test.cc(327 行)
  • 新增 ut_coll_comm_ccu_c_adpt.cc(257 行,覆盖 HcclCommAssignCcuIns)
  • 扩展 next 框架 ut_ccu_res_batch_allocator.cc(新增 233 行)和 legacy 框架 ut_ccu_res_batch_allocator.cpp(新增 213 行)
  • 更新 ut_HcommCcuControlApi_test.cc、ut_my_rank.cc、ccu_dev_mgr_mock.cc、llt_next_orion_ccu_stub.cc
  • 移除 #3538 引入的旧桩用例 ut_hcomm_ccu_res_stub_api_test.cc

文档更新

  • 新增 CCU 资源管理文档:ccu_resource_mgmt/README.md、index.md、HcommCcuKernelQueryResReq.md
  • 新增 HcclCommAssignCcuIns.md
  • 更新 comm_opdev/README.md、_dump_node_ctrl.md 和 comms_domain_resource_mgmt/README.md 的目录索引
  • 更新 ccu_kernel_launch_execution/README.md 中 CCU 实例的获取与绑定流程

合入检查

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for p_ch's contribution.)
CANN-robotCANN-robotCollaborators
Jul 3 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Jul 3 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


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
docs ✅ 颜业峰, laodazhao1 (2/2) ✅ 颜业峰 (1/1)
include ✅ 颜业峰, laodazhao1 (2/2) ✅ 颜业峰 (1/1)
src/base_comm ✅ Innoecho, 颜业峰, laodazhao1 (3/2) ✅ Innoecho, 颜业峰 (2/1)
src/coll_communicator_mgr ✅ 颜业峰, laodazhao1 (2/2) ✅ 颜业峰 (1/1)
src/legacy/ascend910/framework ✅ 颜业峰, laodazhao1 (2/2) ✅ 颜业峰 (1/1)
src/legacy/ascend950/service/collective/alg ✅ 颜业峰, laodazhao1 (2/2) ✅ 颜业峰 (1/1)
src/legacy/ascend950/unified_platform ✅ Innoecho, 颜业峰, laodazhao1 (3/2) ✅ Innoecho, 颜业峰 (2/1)
test ✅ 颜业峰, Innoecho, laodazhao1 (3/2) ✅ Innoecho, 颜业峰 (2/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

p_ch, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
p_chp_ch
Jul 3 Force-pushed 1 commits:88e58625-init: public definitions
p_chp_ch
Jul 3 Pushed 1 commits:ade830c3-feat(ccu): add resource descriptor type enum
CANN-robotCANN-robotCollaborators
Jul 3 Added label: stat/needs-squash
1200 messages are collapsed here。 See more
laodazhao1
laodazhao1Collaborators
Aug 1 Comments:

/lgtm

likedislike
Innoecho
InnoechoCollaborators
Aug 1 Comments:

/approve

likedislike
philo
philoCollaborators
Aug 1 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Aug 1 Added label: lgtmapproved
CANN-robotCANN-robotCollaborators
Aug 1 Merged pull request