已合并
【PR】: [feat] 只对Load节点做L2CacheHint #2011
【PR】: [feat] 只对Load节点做L2CacheHint #2011
已合并
xchu42创建于 16 天前
xchu42
xchu42成员
16 天前

Pull Request

描述

请清晰准确地描述本次 Pull Request 的意图和变更内容。
Nddma节点禁用L2Cache可能会导致性能劣化,暂只对Load节点做L2CacheHint

变更类型

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

关联的Issue

如何测试

描述测试此变更的步骤和前提条件:
NA

核对清单

其他信息

在此添加任何其他关于本次 PR 的说明。

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 xchu42 的贡献)
xchu42xchu42成员
16 天前 添加了label:enhancement
xchu42xchu42成员
16 天前 创建了 pull request,commit e71e3b58
atomgit-bot
atomgit-bot
16 天前 评论:

变更摘要

本 PR 旨在将 L2CacheHint 的标记范围收窄为仅针对输出节点为 Load 算子的 Data 节点,以避免对 Nddma 等节点禁用 L2Cache 导致性能劣化。改动位于 autofuse/common/l2_cache_hint_manager.cpp:新增了跳过判断函数 NeedSkipL2CacheHint,并重构 L2CacheHintManager::MarkInternal 中的判断逻辑,使只有输出节点为 Load 时才应用 L2CacheHint。

主要改动

  • 新增 NeedSkipL2CacheHint 函数: 封装 Data 节点是否应跳过 L2CacheHint 的判断逻辑;当输出节点数量大于 1、输出节点可缓存(ascgen_utils::IsNodeCacheable)、输出为小张量(IsSmallTensor)或输出节点不是 Load 算子时返回 true(跳过标记)。
  • 仅对 Load 节点做 L2CacheHint: 新增 af::ops::IsOps<af::ascir_op::Load> 检查,只有输出节点为 Load 算子时才返回 false(不跳过),从而避免对 Nddma 等其他输出节点禁用 L2Cache 造成性能劣化。
  • 重构 MarkInternal 跳过判断: 将原先内联的多条件判断(out_data_nodes.size() > 1UL、IsNodeCacheable、IsSmallTensor 等)替换为对 NeedSkipL2CacheHint(node) 的调用,保留"index 对应多个 Data 节点则跳过"的原有条件,逻辑更清晰。
likedislike
不准确?
atomgit-bot
atomgit-bot
16 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
16 天前 添加了label:cann-cla/yes
xchu42
xchu42成员
16 天前 评论:

compile

likedislike
CANN-robot
CANN-robot成员
16 天前 评论:

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/graph-autofusion ✅ yangyongqiang0606, zhang_shengjie (2/2) ✅ yangyongqiang0606 (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robot成员
16 天前 将niuyuhu,yangyongqiang0606,liyuewei,zhang_shengjie,depeng1994,wqtshg_wt,peiyang,shengnan666,XuebinYang,sjtulxh,zhanj,zhujingjing,xuyafei,wangxiaotian995设为评审人
CANN-robotCANN-robot成员
16 天前 将niuyuhu,yangyongqiang0606,liyuewei,zhang_shengjie,depeng1994,wqtshg_wt,peiyang,shengnan666,XuebinYang,sjtulxh,zhanj,zhujingjing,xuyafei,wangxiaotian995设为审查人
xchu42
xchu42成员
16 天前 评论:

compile

likedislike
xchu42xchu42成员
16 天前 预合并成功(commit_id: 8d87b8769258fdaa8f970527cbdff50d2078ec42)
CANN-robot
CANN-robot成员
16 天前 评论:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robot成员
16 天前 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
16 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
16 天前 添加了label:ci-pipeline-passed
zhang_shengjie成员
16 天前 评论:

/lgtm

likedislike
yangyongqiang
yangyongqiang成员
16 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
16 天前 添加了label:lgtmapproved
CANN-robotCANN-robot成员
16 天前 合入了pull request