Closed
[Bug-Report|缺陷反馈]: MC2 通信融合 Pass 迁移引入性能劣化+图编译耗时增长 #5834
chenyifanAdd on Oct 8Closed at Oct 10
chenyifan
Oct 8 Comments:
Oct 8 Comments:
/assign @mutex_lock


Oct 8 Assign mutex_lock as responsible person
Oct 10 Close issue
Oct 10 Added label: resolved
周云飞
Oct 14 Comments:
Oct 14 Comments:
您好,PR !13266 已合入master,对报告中的8个MC2通信融合Pass增加了 Run 前置剪枝:先扫描当前图的直接节点,若不存在该Pass需要的锚点算子类型,就返回SUCCESS,跳过pattern枚举与匹配;发现锚点时继续调用原 PatternFusionPass::Run。例如MatmulAllReduce入口与公共类型探测。
这能消除“图中没有相应通信融合算子,却仍反复执行该Pass的pattern匹配”这一类额外开销。有锚点的图仍执行匹配,因此不是关闭这些融合规则;剪枝只检查 GetDirectNode(),不会把嵌套子图中的算子当作当前图直接锚点。
本轮确认了实际改动与当前源码,不将其等同于原TF模型的编译耗时已恢复到4.4分钟;该模型的修复后耗时需要独立测量,PR的源码改动本身不能给出恢复比例。


Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
tc_ge_tf_readable_print_subgraph,动态 shape、约 2047 层嵌套 If、数千子图)经 tf_adapter/GEOP 在线编译,GE 图编译耗时从约 4.4 分钟增加到 17.8 分钟GraphManager::OptimizeOriginalGraph内GraphFusion::Fusion从 2.6 min → 17.7 min(6.9x)。原因是 MC2 8 个通信融合 Pass 由 canndev 迁移为 ops-transformer 的 ESPatternFusionPass(注册 stage=kCompatibleInherited),随 0924 起日包进入 OPP,在无 MatMul/AllReduce 算子的模型上对每个图每个 pass 走 GERunPatternFusion全图 pattern 匹配:113.5 万条 0 匹配空转(单次 47~57ms);0915 包无此迁移(只有 canndev 老实现快路径)。Environment Information / 环境信息 (Mandatory / 必填)
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
图模式
Describe the expected behavior / 预期结果 (Mandatory / 必填)
patterns匹配剪枝,不空转
Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
无
Special notes for this issue/备注 (Optional / 选填)