Merged
fix(pypto_pro):delete unuse tensor ops #6613
huanyongbenAdd on Sep 22
fix(pypto_pro):delete unuse tensor ops #6613
Merged
huanyongbenAdd on Sep 22
huanyongben
Sep 22

删除废弃的tensor op相关代码

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for huanyongben's contribution.)
huanyongbenhuanyongben
Sep 22 Created pull request, commit a53e474a
atomgit-bot
atomgit-bot
Sep 22 Comments:

变更摘要

该 PR 主要删除了 pypto_pro 中未被使用、且缺乏后端实现的 tensor.* 算子体系(C++ 与 Python 两侧),并移除了 OpConversionRegistry 中 tensor.* -> block.* 的默认降级转换;同时统一了编译错误首行中枚举名的渲染格式,并在 runtime pipeline 校验中补充了跨核缓冲 tile 数量的检查。

主要改动

  • 删除 tensor.* 算子实现与注册: 删除 framework/src/interface/ir/op/tensor_ops/ 下的 elementwise.cpp、matmul.cpp、memory.cpp、reduction.cpp、transform.cpp、unary.cpp 及 Python 的 python/pypto_pro/ir/op/tensor_ops.py,移除其中全部 REGISTER_OP("tensor.*") 注册与 register_table 项,并从 op/__init__.py 的 __all__ 与导入中移除 tensor 命名空间。
  • 移除默认算子转换规则: OpConversionRegistry::OpConversionRegistry() 改为 = default,不再注册 tensor.add -> block.add 等默认映射,转换改由使用方通过 RegisterSimple / RegisterCustom 或 register_op_conversion 自行注册。
  • 统一错误枚举名渲染格式: framework/src/interface/pypto_pro/error.cpp 新增 EnumClassName 与 BareEnumName,ErrHead 输出 ExternalError:: / InternalError:: 前缀;python/pypto_pro/_errors.py 的 _first_line 相应按 0xF0000 掩码派生相同前缀,使两侧格式一致。
  • pipeline 同步校验新增 tile 数量检查: validate_sync 增加 schedule 参数并新增 _check_slot_counts,按生产者与消费者所在 stage 的距离校验跨核缓冲所需 tile 数;_check_cross_core_users 新增跨核缓冲必须交给紧邻后一 stage 的校验。
  • 文档与测试同步更新: 注释与文档示例由 tensor.add 等改为 block.add 等,测试用例改用 block.*、ptr.make_tensor、make_tile 等算子,并删除 test_tensor_ops 相关测试。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 22 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Sep 22 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 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.
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
9.2.0 ✅ gcw_kUomxQ2l, gaoxiang618 (2/2) ✅ gcw_kUomxQ2l (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
Sep 22 Set xinweiliu,lyz0328,cam_bxh,dai-zhentao,TianXL,lululu40888,shi-dingkun,gguuaanngg,codehjp423,jiangtao_rts,gitcode-chenjiao,hanxiaolong,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,gcw_kUomxQ2l,Andy-lb,WenboCodes as approver
CANN-robotCANN-robotCollaborators
Sep 22 Set TianXL,jiangtao_rts,gitcode-chenjiao,hanxiaolong,gcw_kUomxQ2l,Andy-lb as approver
huanyongbenhuanyongben
Sep 22 Modify description of pull request
huanyongben
huanyongben
Sep 22 Comments:

compile

likedislike
huanyongbenhuanyongben
Sep 22 Pre merge succeeded (commit_id: 3a87607b98a0db67bd31095baf097fea0aa3a079)
CANN-robot
CANN-robotCollaborators
Sep 22 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 22 Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 22 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 22 Added label: ci-pipeline-failed
huanyongbenhuanyongben
Sep 22 Associated issue: [Documentation|文档反馈]: pypto_pro.language.jit缺少接口文档
huanyongben
huanyongben
Sep 22 Comments:

compile

likedislike
CANN-robot
CANN-robotCollaborators
Sep 22 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 22 Removed label: ci-pipeline-failed
CANN-robotCANN-robotCollaborators
Sep 22 Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 22 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 22 Added label: ci-pipeline-passed
liulun0308
liulun0308Collaborators
Sep 23 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 23 Added label: approved
gaoxiang618
gaoxiang618Collaborators
Sep 23 Comments:

/approve
/lgtm

likedislike
CANN-robot
CANN-robotCollaborators
Sep 23 Comments:

The following users do not have permission to comment /lgtm or /approve on any module in this PR:
/approve: gaoxiang618

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