Merged
fix(codegen): Bind local buffers before skipping VIEW/RESHAPE ops #6279
anyangleAdd on Sep 14
fix(codegen): Bind local buffers before skipping VIEW/RESHAPE ops #6279
Merged
Merged fromquadrate/pypto_aylcodegen_9.2intocann/pypto9.2.0
Pull Request has been successfully merged by CANN-robot.
(Thank you for anyangle's contribution.)atomgit-bot
Sep 14 Comments:
Sep 14 Comments:
atomgit-bot
Sep 14 Comments:
Sep 14 Comments:
Sep 14 Added label: cann-cla/yes
CANN-robot
Sep 14 Comments:
Sep 14 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/codegen | ✅ make_pto, lululu40888 (2/2) | ✅ make_pto (1/1) |
| framework/src/codegen/npu/litenpu | ✅ make_pto, lululu40888 (2/2) | ✅ make_pto (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
quadrate, thanks for your pull request. All authors of the commits have signed the CLA. 👍


Sep 14 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
Sep 14 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
Sep 14 Set lululu40888,yinjie27_,make_pto,linjiashu as approver
Sep 14 Associated issue: [Bug-Report|缺陷反馈]: Codegen skip RESHAPE/VIEW 时未消费 needAlloc 导致 SYMBOL_NOT_FOUND
Sep 14 Associated issue: [Bug-Report|缺陷反馈]: Codegen skip RESHAPE/VIEW 时未消费 needAlloc 导致 SYMBOL_NOT_FOUND
anyangle
Sep 14 Comments:
Sep 14 Comments:
compile


Sep 14 Pre merge succeeded (commit_id: be6ec27bf143e8956e36aecb878ca280076815b8)
CANN-robot
Sep 14 Comments:
Sep 14 Comments:
| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


Sep 14 Added label: ci-pipeline-running
Sep 14 Removed label: ci-pipeline-running
Sep 14 Added label: ci-pipeline-passed
Sep 15 Modify description of pull request
make_pto
Sep 15 Comments:
Sep 15 Comments:
/approve


Sep 15 Approval passed
Sep 15 Approval passed
Sep 15 Added label: approved
huanglu
Sep 15 Comments:
Sep 15 Comments:
/lgtm


Sep 15 Added label: lgtm
Sep 15 Merged pull request
问题背景:
codegen对SKIP_OPCODE_FOR_CODEGEN中的op会直接continue,连GenAllocForLocalBuffer一并跳过。Mix拆leaf子图后,C,V共用同一memId的UB时,needAlloc被打在被skip的RESHAPE/VIEW输出上,codegen未bind;后续COPY_OUT读的是VIEW后的新tensor(未带needAlloc),导致codegen报SYMBOL_NOT_FOUND。
解决方案:
在 CodeGenCloudNPU::GenFuncBody / CodeGenLiteNPU::GenFuncBody 中,将 GenAllocForLocalBuffer(op, symbolMgr) 移到 SKIP_OPCODE_FOR_CODEGEN 判断之前: