Merged
feat(interpreter): Interpreter recently fix #6122
dingbo929Add on Sep 10
feat(interpreter): Interpreter recently fix #6122
Merged
dingbo929Add on Sep 10
Merged fromDeleted :9.2.0intocann/pypto9.2.0
dingbo929
dingbo929Collaborators
Sep 10
  1. RUNTIME_GetTensorDataInt32 符号求值防御性校验加固
  2. 精度工具产物output空目录修复
  3. RANGE 算子 支持DYN_SCALAR 动态值解析
  4. 日志规范
  5. view和assemble展开时,要和其他计算op一样,重置一下展开后logicaltensor的raw
  6. 展开view时,把自身的toDynValidshape属性切分到各个slice上
likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for dingbo929's contribution.)
dingbo929dingbo929Collaborators
Sep 10 Created pull request, commit add43c7b
dingbo929dingbo929Collaborators
Sep 10 Associated issue: [Requirement|需求建议]: RUNTIME_GetTensorDataInt32 符号求值防御性校验加固
atomgit-bot
atomgit-bot
Sep 10 Comments:

变更摘要

该 PR 聚焦解释器(interpreter)的近期修复与加固,主要涵盖:RUNTIME_GetTensorDataInt32 符号求值的防御性校验加固;RANGE 算子对 DYN_SCALAR 动态值的解析支持;日志体系的规范化重构(新增按文件输出的 LogToFile 与 INTERPRETER_LOGE_TO_FILE 宏,校验失败日志改写入 execDumpErrorFile);view/assemble 展开时重置展开后 LogicalTensor 的 raw,并将 view 自身的 toDynValidShape 属性切分到各 slice;同时新增/调整了相应单测用例。

主要改动

  • RUNTIME_GetTensorDataInt32 求值防御性校验: 在 symbolic_scalar_evaluate.cpp 的 EvaluateSymbolicCallRuntimeGetTensorDataInt32 中新增 FE_ASSERT 校验:inoutDataPair 非空、ioType 仅允许 incast/outcast、下标越界检查以及数据视图非空,避免图变换后 (ioType, ioTypeIndex) 未重映射时越界/空指针取数。
  • RANGE 算子支持 DYN_SCALAR 动态值: 在 calc_vector.cpp 的 ExecuteOpRange 中为 tileIdx 非具体值分支新增 EvaluateOpImmediate 动态解析路径,解析成功后据此计算 curStart,扩展了动态 tile 场景的覆盖。
  • 日志规范与按文件输出: 将 interpreter_log 重构为 WritePrefixedLine/WriteLineImpl 结构并新增 LogToFile 及 INTERPRETER_LOGE_TO_FILE 宏;flow_verifier.cpp 中校验失败日志由 INTERPRETER_LOGE_FULL 改为写入 functionInterpreter_->execDumpErrorFile;config_manager.h 新增 IsLogRotationEnabled(),recorder.cpp 仅在日志轮转启用时设置 verify 路径,修复精度工具 output 空目录问题。
  • view/assemble 展开重置 raw 并切分 toDynValidShape: operation_impl.cpp 的 TiledAssembleRecursive/TiledViewOperationRecursive 不再直接调用 View(),而是构造新的 LogicalTensor 以重置展开后张量的 raw;slice 的 valid shape 改为基于 view 属性自身的 toDynValidShape 按 tile offset 切分计算。
  • 单测更新: 在 test_expandfunction.cpp 中新增 ViewExpandSlicesToDynValidShape 用例(校验各 slice 继承 view 的 toDynValidShape)及 ExpectSliceContractHaveDistinctRaws 辅助校验(slice/contract 输入输出不共享同一 RawTensor),并扩展 Range 用例覆盖动态 tile 求值场景。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 10 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Sep 10 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 10 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/configs ✅ tsungl4, 尹杰 (2/2) ✅ tsungl4, 尹杰 (2/1)
framework/src/interface/interpreter ✅ 尹杰, tsungl4 (2/2) ✅ tsungl4, 尹杰 (2/1)
framework/src/interface/operation ✅ tsungl4, 尹杰 (2/2) ✅ tsungl4, 尹杰 (2/1)
framework/src/interface/program ✅ tsungl4, 尹杰 (2/2) ✅ tsungl4, 尹杰 (2/1)
framework/src/interface/tensor ✅ 尹杰, tsungl4 (2/2) ✅ 尹杰, tsungl4 (2/1)
repo-cann/pypto ✅ tsungl4, 尹杰 (2/2) ✅ tsungl4, 尹杰 (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
Sep 10 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
CANN-robotCANN-robotCollaborators
Sep 10 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
dingbo929
dingbo929Collaborators
Sep 10 Comments:

compile

likedislike
dingbo929dingbo929Collaborators
Sep 10 Pre merge succeeded (commit_id: 0358dbf167c5b3f01b143aba3e0ae6edd2f77895)
CANN-robot
CANN-robotCollaborators
Sep 10 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 10 Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 10 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 10 Added label: ci-pipeline-passed
lidongsheng
lidongshengCollaborators
Sep 10 Comments:

/lgtm

likedislike
lidongsheng
lidongshengCollaborators
Sep 10 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 10 Added label: approved
Jie Yin
Jie YinCollaborators
Sep 10 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 10 Added label: lgtm
CANN-robotCANN-robotCollaborators
Sep 10 Merged pull request