Merged
feat(ir): Support versioned assemble outputs #5787
赵俊涵Add on Aug 29
feat(ir): Support versioned assemble outputs #5787
Merged
Pull Request has been successfully merged by CANN-robot.
(Thank you for 赵俊涵's contribution.)Aug 29 Added label: stat/needs-squash
Aug 29 Added label: cann-cla/yes
Aug 29 Associated issue: [Task|任务跟踪]: 前端插入token依赖,删除冗余token
CANN-robot
Aug 29 Comments:
Aug 29 Comments:
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 |
|---|---|---|
| framework/src/interface/function | ✅ 尹杰, DCGDDD, tsungl4 (3/2) | ✅ 尹杰, DCGDDD (2/1) |
| framework/src/interface/ir/transforms | ✅ 尹杰, tsungl4 (2/2) | ✅ 尹杰 (1/1) |
| framework/src/interface/operation | ✅ 尹杰, tsungl4 (2/2) | ✅ 尹杰 (1/1) |
| framework/src/interface/tensor | ✅ tsungl4, DCGDDD, 尹杰 (3/2) | ✅ 尹杰, DCGDDD (2/1) |
| repo-cann/pypto | ✅ DCGDDD, 尹杰, tsungl4 (3/2) | ✅ 尹杰, DCGDDD (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zhaojunhan, thanks for your pull request. All authors of the commits have signed the CLA. 👍


Aug 29 Set xinweiliu,cam_bxh,dai-zhentao,lululu40888,shi-dingkun,gguuaanngg,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
Aug 29 Set xinweiliu,cam_bxh,dai-zhentao,lululu40888,shi-dingkun,gguuaanngg,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
Aug 29 Set xinweiliu,cam_bxh,dai-zhentao,lululu40888,shi-dingkun,gguuaanngg,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
Aug 29 Set xinweiliu,cam_bxh,dai-zhentao,lululu40888,shi-dingkun,gguuaanngg,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
赵俊涵
Aug 29 Comments:
Aug 29 Comments:
/compile


Aug 29 Pre merge succeeded (commit_id: 119f59f72929fc19bc313e2a8fe23a146dd03d6b)
Aug 29 Added label: ci-pipeline-running
赵俊涵
Aug 29 Comments:
Aug 29 Comments:
/compile


Aug 29 Pre merge succeeded (commit_id: a8ff25a4dcf1c401f185435751d07afe899ed353)
11 event messages are collapsed here。 See more
Aug 31 Modify description of pull request
lidongsheng
Aug 31 Comments:
Aug 31 Comments:
/lgtm


杨旭
Aug 31 Comments:
Aug 31 Comments:
/approve


Jie Yin
Aug 31 Comments:
Aug 31 Comments:
/approve


Aug 31 Added label: lgtmapproved
Aug 31 Merged pull request
背景
旧版前端中,连续多次
assemble写入同一 destination 时会复用同一个LogicalTensor。这种表达无法区分不同写入产生的逻辑版本,因此中间读取难以准确引用第 N 次写入后的快照,并可能观察到后续写入的值。
为配合新版 IR assemble 语义及 token 访存时序,本 PR 完成前端侧适配:
每次用户可见的
assemble写入生成独立的LogicalTensor版本,同时继续共享同一个底层
RawTensor。主要修改
调整
LogicalTensor::NextVersion:LogicalTensor;RawTensor;调整 Function 构建与 outcast 处理:
RawTensor时保留各次写入对应的逻辑版本;RawTensor去重,并选择最新的LogicalTensor版本;补充 token 依赖支持:
ProducerOpsByToken依赖;token 清理 Pass 分析;
增强相关基础逻辑:
测试
LogicalTensor::NextVersion元数据继承测试;assemble共享同一RawTensor、但生成不同LogicalTensor版本的测试;assemble后仅选择最新版本作为 outcast 的快照测试。影响范围
本 PR 仅包含新版 assemble/token 方案的前端及基础 IR 适配。
MergeDanglingAssembleOutput、TokenPass 的完整访存依赖计算,以及RemoveRedundantReshape、MergeViewAssemble、GraphPartition、
OoOSchedule、GlobalMemoryReuse 等下游 Pass 的适配不在本 PR 的修改范围内。