已开启
[fix] change topomatch1d topomatch to onelevel #2770
acoolntly创建于 10 天前
[fix] change topomatch1d topomatch to onelevel #2770
已开启
acoolntly创建于 10 天前
acoolntly
10 天前

描述

关联的Issue

测试

文档更新

类型标签

likedislike
合并受阻
Aacoolntly
10 天前 创建了 pull request,commit 17ac180f
atomgit-bot
atomgit-bot
10 天前 评论:

变更摘要

该 PR 将旧的 TopoMatch1D/TopoMatchMultilevel 拓扑匹配切换为新的 V2 分层匹配体系:新增 TopoMatchBaseV2 基类及 TopoMatchOneLevelTopoMatchTwoLevelTopoMatchThreeLevelTopoMatchConcurrentV2 实现,MatchTopo 接口增加 AlgorithmProfile 参数;新增基于 RankGraph 的 NetInstance/TopoInstance 合成的物理层级链 physicalLevels(含构建、归一化、一致性校验与序列化),并让各 executor 的注册与 CalcAlgHierarchyInfo 调用随之适配;同时补充 POD 机型形态检测与老 CANN/老驱动的兼容降级处理。

主要改动

  • 新增 V2 拓扑匹配框架: 新增 TopoMatchBaseV2 基类与 TopoMatchOneLevel/TopoMatchTwoLevel/TopoMatchThreeLevel/TopoMatchConcurrentV2(含 topo_match_base_v2.cc/h 等新文件),MatchTopo 统一增加 const AlgorithmProfile& profile 参数;各 executor 注册由 TopoMatch1D/TopoMatchMultilevel 改为 TopoMatchOneLevel/TopoMatchTwoLevel/TopoMatchThreeLevel,并通过 if constexpr (std::is_base_of_v<TopoMatchBaseV2, AlgTopoMatch>) 分支调用新签名或旧签名。

  • 新增物理层级链数据结构与构建流程: alg_param.h 新增 PhysicalLevelInfoPhysicalLevelViewPhysicalSourceRefPhysicalLevelIndexAlgoType 等结构,TopoInfoWithNetLayerDetails 新增 physicalLevelsphysicalLevelNumisPod 字段并接入 Serialize/DeSerialize(带 PHYSICAL_LEVEL_NUM_LIMIT 阈值校验与 EndpointDesc 可平凡复制断言);新增 physical_level_build.cc/physical_level_normalize.cc 实现 BuildPhysicalLevelsNormalizePhysicalLevelsValidatePhysicalLevels,任何失败一律降级为空视图,不影响 CalcTopoShape 返回与旧路径。

  • 算法画像与调用链打通: 新增 BuildAlgorithmProfile 按算法名推断 algoTypes/engineexecutor_v2_base 增加 SetAlgName/algName_op_common.ccCalcAlgHierarchyInfo 前调用 executor->SetAlgName(param.algName)AlgHierarchyInfoForAllLevel 新增 physicalIdxForAlgoLevels 并纳入 AlgResourceCtxSerializable 序列化。

  • POD 机型形态检测与兼容降级: topo_host.cc 新增 CalcDeviceFormFactor 查询 ACL_DEV_ATTR_DEVICE_FORM_FACTOR 写入 isPod 并接入 CalcTopoShapehcalrtGetDeviceInfo 增加 quiet 参数(失败改按 WARNING 降噪),adapter_acl.hACL_DEVICE_FORM_FACTOR_POD 宏探测 HCCL_SUPPORT_DEV_FORM_FACTOR 以兼容老 CANN。

  • 构建接入: scatter_aicpu_kernel.cmake 将新增的 topo_match_base_v2.cctopo_match_one_level.cctopo_match_two_level.cctopo_match_three_level.cctopo_match_concurrent_v2.cc 加入 AICPU 内核编译源文件列表。

likedislike
atomgit-bot
atomgit-bot
10 天前 评论:

代码审查

✅ 未发现问题

likedislike
CANN-robotCANN-robot成员
10 天前 添加了label:stat/needs-squash
CANN-robotCANN-robot成员
10 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
10 天前 评论:

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

⚠️ 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
src ❌ (0/2)(You can also ask: 程祥乐, 施秉辰, 颜业峰, 陈浩, 李标智) ❌ (0/1)(You can also ask: 颜业峰, 文学敏, 李标智)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robot成员
10 天前 将leabclove,yanglianxiang2,linyf950,yanzhenghang,chenliang267,yanyefeng,chenhao_,dingweiqin_57,songmingyang,wenxuemin,yangxiaoyuan,laodazhao1,yangshaohua,chenke2026,zhongqin2020,bz_lee,Innoecho,chenyia,temper7620,zhangxp1030,lilin_137,hulk1997,ouyangxizi,one_random设为评审人
CANN-robotCANN-robot成员
10 天前 将yanyefeng,wenxuemin,bz_lee设为审查人