已合并
feat(ccu): align CCU handles and resource descriptors with POD ABI #182
feat(ccu): align CCU handles and resource descriptors with POD ABI #182
已合并
cellur_z创建于 9月14日
cellur_z
cellur_z成员
9月14日

当前PR是否有AI参与:

[x] 否

[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :

PR功能描述 / 为什么需要这个合入**:

该PR关联的issue

(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #27

希望检视人员了解:

改动类型 / Change Type

测试信息 / Testing

检查清单 / Checklist

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 cellur_z 的贡献)
cellur_zcellur_z成员
9月14日 创建了 pull request,commit a756ff17
atomgit-bot
atomgit-bot
9月14日 评论:

变更摘要

该 PR 将 CCU 的句柄、Channel 快照与资源描述符整体对齐到 POD ABI 定档口径:CcuInsHandle 由 uint64_t 升级为带 CommAbiHeader 的结构体;HcommCcuRegisterContextPod 重构为按 die × 资源类型嵌套的 HcommCcuInstance,控制面函数表并入 ascCustom 槽位数组;Channel POD 升级到 v4(16 槽 + 有效计数 + RegedBufferEntity 远端 buffer);指令空间改为经 ascCustom 接口向 hcomm 按需申请与下发,不再走本地 range 池与自管理设备内存;同时删除旧的 host launch 实现,新增 ResDesc 资源描述符查询链,并配套调整设备号获取方式(aclrtGetDevice)与全部相关示例/单元测试。

主要改动

  • CCU Instance 句柄与注册上下文 POD 定档: CcuInsHandle 从 uint64_t 改为 32 字节结构体(header/ccuInsKey/ccuInsPtr,0 键为无效句柄),HcommCcuRegisterContextHandle 更名 HcommCcuInstanceHandle,hcomm_ccu_res.h 中的 POD 重构为 HcommCcuResRange/HcommCcuResRanges/HcommCcuDieMetadata/HcommCcuDieRes/HcommCcuInstance 两级嵌套结构,HcommCcuDieMetadata 携带 RegedBufferEntity ccuResBuffer 与唯一 loopChannelId(die 内/间共用);各示例 alg_resource.cc 与 asccomm_ccu_kernel_register_start 签名同步切换,ccu_kernel_registry_mgr 的实例表改以 ccuInsKey 为键。
  • Channel POD 升级 v4 并按有效数量校验: HcommCcuChannelPod ABI 版本升至 4、资源槽容量扩至 16、尺寸固定 544 字节,字段改名(localVarIds/remoteEventIds/localEventMasks 等),远端 CCU buffer 折叠为 rmtCcuResBuffer,ccu_channel::init 经 ascCustom 槽 0 HcommCcuGetChannelEntityFn 取借用指针并深拷贝,get_id_by_array 按 localVarNum 等有效数量(而非定长容量)校验下标。
  • 指令空间与下发链路重构: INS 不再进入 asc_ccu_res_repository.instruction range 池,改由 ascCustom 槽 1 allocInstSpace 按需切分;ccu_kernel_mgr::load_instruction 删除自管理的 instruction_load_dev_mem_ 及 aclrtMalloc/Memcpy 路径,改为调用槽 2 submitInsts 直接传 host 指令数据,HcommCcuInstructionLoadPod 随之删除。
  • 控制面函数表删除与 DFX 降级: HcommCcuControlOpsPod 删除,hcomm_ccu_control.h 降级为转发头,线程级 set_current_ccu_device_logic_id 移除、设备号改由 aclrtGetDevice 即时获取;ccu_dfx.cc 因 mission/loop/CKE/XN/GSA 硬件现场查询未注入 ascCustom(槽 3-7 预留)而整体降级返回 CCU_E_NOT_SUPPORT,资源值查询恒返回 UINT64_MAX。
  • 新增 ResDesc 查询链并删除 host launch: 新增 hcomm_ccu_res_desc.h 与 ccu_res_desc_c_adpt.cc,实现 HcommCcuResDesc POD、handle table(HcommCcuInsResDescCreate/Destroy/QueryDieId/SetNum/QueryNum/Query)及 HcommCcuKernelQueryResReq(执行 kernel func 统计资源需求,block/非 block 合并计数);同时删除 ccu_host_launch.h/.cpp、asccomm_ccu_host_kernel_launch 及对应 UT,并补充 aclrtGetDevice 桩。
likedislike
不准确?
atomgit-bot
atomgit-bot
9月14日 评论:

🤖 AI 代码检视正在进行中,请稍候…

likedislike
不准确?
CANN-robotCANN-robot成员
9月14日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
9月14日 评论:

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
examples ✅ changxianyu, DragonBornHD84 (2/2) ✅ changxianyu (1/1)
include ✅ zhanghao_0689, changxianyu, DragonBornHD84 (3/2) ✅ zhanghao_0689 (1/1)
src ✅ changxianyu, DragonBornHD84 (2/2) ✅ changxianyu (1/1)
tests ✅ changxianyu, DragonBornHD84 (2/2) ✅ changxianyu (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
此处折叠了148条消息 查看更多
zhanghao_0689zhanghao_0689成员
9月22日 解决了最后一个问题
zhanghao_0689
zhanghao_0689成员
9月22日 评论:

/approve

likedislike
CANN-robot
CANN-robot成员
9月22日 评论:

The following users do not have permission to comment /lgtm or /approve on any module in this PR:
/approve: DragonBornHD84

likedislike
CANN-robotCANN-robot成员
9月22日 添加了label:approved
CANN-robotCANN-robot成员
9月22日 合入了pull request