Merged
refactor(codegen): Delete invoke param offset #4177
refactor(codegen): Delete invoke param offset #4177
Merged
HujunAdd on Jun 22
Hujun
HujunCollaborators
Jun 22
  1. Delete invoke param offset
likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for Hujun's contribution.)
HujunHujunCollaborators
Jun 22 Created pull request, commit 5d6e496f
HujunHujunCollaborators
Jun 22 Associated issue: [Task|任务跟踪]: 删除冗余的变量定义
CANN-robotCANN-robotCollaborators
Jun 22 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Jun 22 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


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-cann/pypto ✅ dai-zhentao, codehjp423 (2/2) ✅ dai-zhentao (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

cam_bxh, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
Hujun
HujunCollaborators
Jun 22 Comments:

/compile

likedislike
HujunHujunCollaborators
Jun 22 Pre merge succeeded (commit_id: 38e4ab2ffef442d1df425284ebd2337337ee2727)
CANN-robotCANN-robotCollaborators
Jun 22 Added label: ci-pipeline-running
CANN-robot
CANN-robotCollaborators
Jun 22 Comments:

流水线任务触发成功
任务链接 [691a4820707f42e7afe3732c1b07c42d][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_codestyle ✅ SUCCESS >>>>>
codecheck_precommit ✅ SUCCESS >>>>> >>>>>

[2026-06-22 15:39:32]    CI执行结束

likedislike
CANN-robot
CANN-robotCollaborators
Jun 22 Comments:

流水线任务触发成功
任务链接 [d3b79ed868e74f09bfa65509fd283260][流水线指导]

任务名称状态日志下载链接
get_pr_file ✅ SUCCESS
static-check ✅ SUCCESS
compile ❌ FAILED
likedislike
CANN-robotCANN-robotCollaborators
Jun 22 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Jun 22 Added label: ci-pipeline-failed
atomgit-bot
atomgit-bot
Jun 22 Comments:

变更摘要

此 PR 主要聚焦于从 codegen 系统中删除 invoke param offset 机制。具体包括:移除 InvokeParaOffset 结构体、从 GenCode 方法及其整个继承体系中删除 invokeParaOffset 参数、删除 GenRealizeIdMap 函数、从上下文结构体(CodeGenOpCtx、CodeGenOpNPUCtx、GenOpCodeOptions)中移除 locToOffset/lto/paramLocToParamListOffset 字段,并同步更新所有调用点及测试文件。

主要改动

  • 删除 InvokeParaOffset 结构体: 从 framework/src/interface/machine/host/machine_task.h 中完全移除该结构体及其所有成员字段和 LogRawTensorInfo 方法,同时移除了 codegen.h 和 codegen_cce.h 中对其头文件的依赖。
  • 简化 GenCode 接口: 将 CodeGen::GenCode、CodeGenCCE::GenCode、CodeGenNPU::GenCode、CodeGenLiteNPU::GenCode 的签名从接受两个参数(Function& 和 invokeParaOffset map)简化为仅接受 Function& 一个参数。
  • 删除 GenRealizeIdMap 函数: 从 codegen_cce.cpp 中删除此函数及其在 codegen_cce.h 中的声明,并从 codegen_cloudnpu.cpp 和 codegen_litenpu.cpp 的 GenFuncBody 中移除相关调用。
  • 清理 CodeGenOpCtx / CodeGenOpNPUCtx 构造函数: 移除 locToOffset/lto 参数,简化上下文结构体构造——CodeGenOpCloudNPU 和 CodeGenOpLiteNPU 的创建不再需要传递此映射。
  • 移除 CodeGenOp 中的 paramLocToParamListOffset 字段: 从 codegen_op.h 中删除该成员,CodeGenOp 子类不再持有 invoke param offset 引用。
  • 更新所有调用点与测试文件: 在 backend.cpp、main_block.cpp、test_codegen_utils.cpp 及 40+ 个测试文件中,统一将 codeGen.GenCode(*function, {}) 替换为 codeGen.GenCode(*function),并移除 GenOpCodeOptions::lto 的使用。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Jun 22 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
Hujun
HujunCollaborators
Jun 22 Comments:

/compile

likedislike
HujunHujunCollaborators
Jun 22 Pre merge succeeded (commit_id: 273d8f4e9fefa50874714f1fb9ec9cbc02d74ebf)
CANN-robotCANN-robotCollaborators
Jun 22 Removed label: ci-pipeline-failed
CANN-robotCANN-robotCollaborators
Jun 22 Added label: ci-pipeline-running
CANN-robot
CANN-robotCollaborators
Jun 22 Comments:

流水线任务触发成功
任务链接 [1ba313361f484b879b120779975a1fbf][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
UT_Test_Py3_ninja_simulation ✅ SUCCESS
UT_Test_Py3_ninja ✅ SUCCESS
UT_Test_Cpp_make_clang ✅ SUCCESS
UT_Test_Cpp_make_gnu ✅ SUCCESS
UT_Test_Cpp_make_gnu_part_1 ✅ SUCCESS
UT_Test_Cpp_make_gnu_part_2 ✅ SUCCESS
UT_Test_Cpp_make_gnu_part_3 ✅ SUCCESS
UT_Test_report ✅ SUCCESS >>>>>
PreSmoke_A900 ❌ FAILED >>>>>
likedislike
CANN-robot
CANN-robotCollaborators
Jun 22 Comments:

流水线任务触发成功
任务链接 [31eb01f424c645bcbce48f04ec0de764][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_codestyle ✅ SUCCESS >>>>>
codecheck_precommit ✅ SUCCESS >>>>> >>>>>

[2026-06-22 16:46:50]    CI执行结束

likedislike
CANN-robot
CANN-robotCollaborators
Jun 22 Comments:

流水线任务触发成功
任务链接 [23450ae16bc7485d92c477ebc1b2fe9b][流水线指导]

任务名称状态日志下载链接
get_pr_file ✅ SUCCESS
static-check ✅ SUCCESS
compile ❌ FAILED
likedislike
CANN-robotCANN-robotCollaborators
Jun 22 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Jun 22 Added label: ci-pipeline-failed
CANN-robotCANN-robotCollaborators
Jun 22 Removed label: ci-pipeline-failed
CANN-robotCANN-robotCollaborators
Jun 22 Added label: ci-pipeline-running
CANN-robot
CANN-robotCollaborators
Jun 22 Comments:

流水线任务触发成功
任务链接 [066599eba683449f9a599efc81071913][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
UT_Test_Py3_ninja_simulation ✅ SUCCESS
UT_Test_Py3_ninja ✅ SUCCESS
UT_Test_Cpp_make_clang ✅ SUCCESS
UT_Test_Cpp_make_gnu ✅ SUCCESS
UT_Test_Cpp_make_gnu_part_1 ✅ SUCCESS
UT_Test_Cpp_make_gnu_part_2 ✅ SUCCESS
UT_Test_Cpp_make_gnu_part_3 ✅ SUCCESS
UT_Test_report ✅ SUCCESS >>>>>
PreSmoke_A900 ❌ FAILED >>>>>
likedislike
CANN-robot
CANN-robotCollaborators
Jun 22 Comments:

流水线任务触发成功
任务链接 [23450ae16bc7485d92c477ebc1b2fe9b][流水线指导]

任务名称状态日志下载链接
get_pr_file ✅ SUCCESS
static-check ✅ SUCCESS
compile ❌ FAILED
likedislike
CANN-robotCANN-robotCollaborators
Jun 22 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Jun 22 Added label: ci-pipeline-failed
CANN-robotCANN-robotCollaborators
Jun 23 Removed label: ci-pipeline-failed
CANN-robotCANN-robotCollaborators
Jun 23 Added label: ci-pipeline-running
CANN-robot
CANN-robotCollaborators
Jun 23 Comments:

流水线任务触发成功
任务链接 [42ff0e658fb84c328b7c87248b39b6bd][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
UT_Test_Py3_ninja_simulation ✅ SUCCESS
UT_Test_Py3_ninja ✅ SUCCESS
UT_Test_Cpp_make_clang ✅ SUCCESS
UT_Test_Cpp_make_gnu ✅ SUCCESS
UT_Test_Cpp_make_gnu_part_1 ✅ SUCCESS
UT_Test_Cpp_make_gnu_part_2 ✅ SUCCESS
UT_Test_Cpp_make_gnu_part_3 ✅ SUCCESS
UT_Test_report ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS

[2026-06-23 11:06:09]    CI执行结束

likedislike
CANN-robot
CANN-robotCollaborators
Jun 23 Comments:

流水线任务触发成功
任务链接 [23450ae16bc7485d92c477ebc1b2fe9b][流水线指导]

任务名称状态日志下载链接
get_pr_file ✅ SUCCESS
static-check ✅ SUCCESS
compile ✅ SUCCESS

[2026-06-23 11:06:51]    CI执行结束

likedislike
CANN-robotCANN-robotCollaborators
Jun 23 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Jun 23 Added label: ci-pipeline-passed
dai-zhentao
dai-zhentaoCollaborators
Jun 23 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Jun 23 Added label: approved
韩君佩
韩君佩Collaborators
Jun 23 Comments:

/lgtm

likedislike
CANN-robotCANN-robotCollaborators
Jun 23 Added label: lgtm
CANN-robotCANN-robotCollaborators
Jun 23 Merged pull request