Merged
fix(ir): Machine depends incast/outcast not share same slot #5474
lidongshengAdd on Aug 17
fix(ir): Machine depends incast/outcast not share same slot #5474
Merged
Merged fromtsungl4/pypto-openincastlinkintocann/pyptomaster
Pull Request has been successfully merged by CANN-robot.
(Thank you for lidongsheng's contribution.)Aug 17 Created pull request, commit e7952b8f
Aug 17 Associated issue: [Task|任务跟踪]: 新IR适配
atomgit-bot
Aug 17 Comments:
Aug 17 Comments:
变更摘要
该 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字段中。


Incorrect?
atomgit-bot
Aug 17 Comments:
Aug 17 Comments:
代码审查
审查结论
已审查变更文件 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 |
⛔ 需要修改


Incorrect?
lidongsheng
Aug 17 Comments:
Aug 17 Comments:
compile


152 messages are collapsed here。 See more
Jie Yin
Aug 19 Comments:
Aug 19 Comments:
/approve


Aug 19 Added label: approved
杨旭
Aug 19 Comments:
Aug 19 Comments:
/lgtm


Aug 19 Added label: lgtm
Aug 19 Merged pull request
Related Issue: #2559