已合并
【PR】: [feat] 只对Load节点做L2CacheHint #2011
xchu42创建于 16 天前
【PR】: [feat] 只对Load节点做L2CacheHint #2011
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 xchu42 的贡献)16 天前 添加了label:enhancement
atomgit-bot
16 天前 评论:
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 节点则跳过"的原有条件,逻辑更清晰。


不准确?
atomgit-bot
16 天前 评论:
16 天前 评论:
16 天前 添加了label:cann-cla/yes
xchu42
16 天前 评论:
16 天前 评论:
compile


CANN-robot
16 天前 评论:
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
/approveor/lgtm- Commenting
/approveimplies 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. 👍


16 天前 将niuyuhu,yangyongqiang0606,liyuewei,zhang_shengjie,depeng1994,wqtshg_wt,peiyang,shengnan666,XuebinYang,sjtulxh,zhanj,zhujingjing,xuyafei,wangxiaotian995设为评审人
16 天前 将niuyuhu,yangyongqiang0606,liyuewei,zhang_shengjie,depeng1994,wqtshg_wt,peiyang,shengnan666,XuebinYang,sjtulxh,zhanj,zhujingjing,xuyafei,wangxiaotian995设为评审人
16 天前 将niuyuhu,yangyongqiang0606,liyuewei,zhang_shengjie,depeng1994,wqtshg_wt,peiyang,shengnan666,XuebinYang,sjtulxh,zhanj,zhujingjing,xuyafei,wangxiaotian995设为审查人
16 天前 将niuyuhu,yangyongqiang0606,liyuewei,zhang_shengjie,depeng1994,wqtshg_wt,peiyang,shengnan666,XuebinYang,sjtulxh,zhanj,zhujingjing,xuyafei,wangxiaotian995设为审查人
xchu42
16 天前 评论:
16 天前 评论:
compile


16 天前 预合并成功(commit_id: 8d87b8769258fdaa8f970527cbdff50d2078ec42)
CANN-robot
16 天前 评论:
16 天前 评论:
| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


16 天前 添加了label:ci-pipeline-running
16 天前 删除了label:ci-pipeline-running
16 天前 添加了label:ci-pipeline-passed
zhang_shengjie
16 天前 评论:
16 天前 评论:
/lgtm


yangyongqiang
16 天前 评论:
16 天前 评论:
/approve


16 天前 添加了label:lgtmapproved
16 天前 合入了pull request
Pull Request
描述
请清晰准确地描述本次 Pull Request 的意图和变更内容。
Nddma节点禁用L2Cache可能会导致性能劣化,暂只对Load节点做L2CacheHint
变更类型
请选择本次引入的变更类型:
关联的Issue
如何测试
描述测试此变更的步骤和前提条件:
NA
核对清单
其他信息
在此添加任何其他关于本次 PR 的说明。