已合并
fix(ir): Machine depends incast/outcast not share same slot #5474
lidongsheng创建于 8月17日
fix(ir): Machine depends incast/outcast not share same slot #5474
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 lidongsheng 的贡献)8月17日 创建了 pull request,commit e7952b8f
8月17日 关联了issue:[Task|任务跟踪]: 新IR适配
atomgit-bot
8月17日 评论:
8月17日 评论:
变更摘要
该 PR 修复了 Machine 依赖场景下 incast 与 outcast 不应共享同一 slot 的问题(关联 Issue #2559)。核心改动位于 RootFunctionBuilder::BuildPathFuncSlotScope:当 incast 与 outcast 的底层张量 memoryId 相同时,不再通过 slotManager->SetSameSlot(incast, outcast) 强制二者共享槽位,而是将二者的关联关系记录到 pathFunc->outIncastLinkMap 中,从而改变 incast/outcast 依赖关系的表达方式。
主要改动
- 移除共享槽位逻辑: 在
BuildPathFuncSlotScope中删除了slotManager->SetSameSlot(incast, outcast)调用,不再强制使incast与outcast复用同一 slot。 - 新增 incast/outcast 关联映射: 改为通过
pathFunc->outIncastLinkMap[incast->tensor] = outcast->tensor记录二者的依赖关联,以incast->tensor为键、outcast->tensor为值保存到outIncastLinkMap字段中。


不准确?
atomgit-bot
8月17日 评论:
8月17日 评论:
代码审查
审查结论
已审查变更文件 framework/src/interface/tensor/ir_func_builder.cpp,共发现 1 个问题。
各文件审查结果
- framework/src/interface/tensor/ir_func_builder.cpp:发现 1 个 P1 问题(
BuildPathFuncSlotScope中outIncastLinkMap键值写反)。
问题统计
- P0:0
- P1:1
- P2:0
- P3:0
总体风险判断
该变更意图正确(不再让 incast/outcast 共享 slot,改为记录 inplace 关联),但新增行的键值方向与全库 outIncastLinkMap 约定(键=outcast、值=incast)相反,导致机器端按 outcast 键查找时关联信息丢失、本 PR 想修复的功能实际不生效,存在功能性回归风险。建议交换键值后合入。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 1 |
| 🟡 建议 | 0 |
⛔ 需要修改


不准确?
lidongsheng
8月17日 评论:
8月17日 评论:
compile


此处折叠了152条消息 查看更多
Jie Yin
8月19日 评论:
8月19日 评论:
/approve


8月19日 添加了label:approved
杨旭
8月19日 评论:
8月19日 评论:
/lgtm


8月19日 添加了label:lgtm
8月19日 合入了pull request
Related Issue: #2559