Merged
新增MhcPreSinkhorn正反向算子graph_convert文件 #8382
新增MhcPreSinkhorn正反向算子graph_convert文件 #8382
Merged
taochangminAdd on Jul 7
taochangmin
taochangminCollaborators
Jul 7

描述

MhcPreSinkhorn正反向算子新增GE Converter文件,支持ge图模式

关联的Issue

https://gitcode.com/cann/ops-transformer/issues/3698

测试

torch图模式调用测试

文档更新

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for taochangmin's contribution.)
taochangmintaochangminCollaborators
Jul 7 Created pull request, commit 68604001
atomgit-bot
atomgit-bot
Jul 7 Comments:

变更摘要

为 MhcPreSinkhorn 算子的前向和反向分别新增 GE Converter,使其在 GE 图模式下能够通过 register_fx_node_ge_converter 将对应的 torch.ops.cann_ops_transformer 自定义算子转换为 GE IR 表示,打通图编译路径。

主要改动

  • 新增 graph_convert_mhc_pre_sinkhorn.py:定义了 MhcPreSinkhorn GE 算子(4 输入、8 输出,含 hc_mult/num_iters/hc_eps/norm_eps/need_backward 属性),并通过 convert_mhc_pre_sinkhorn 注册到 torch.ops.cann_ops_transformer.mhc_pre_sinkhorn.default。
  • 新增 graph_convert_mhc_pre_sinkhorn_backward.py:定义了 MhcPreSinkhornBackward GE 算子(12 输入含 3 个梯度、4 个前向输入及 5 个中间结果,4 个梯度输出,含 hc_eps 属性),并通过 convert_mhc_pre_sinkhorn_backward 注册到 torch.ops.cann_ops_transformer.mhc_pre_sinkhorn_backward.default。
  • 双向 GE IR 定义:前向和反向均通过 IrDef 声明了完整的 IR 结构(输入/输出数据类型、属性默认值),与 REG_OP 文档注释保持一致,确保图编译时的类型匹配与校验。
likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Jul 7 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Jul 7 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
sig-ops-transformer ✅ 蒋礼锐, 马兵 (2/2) ✅ 蒋礼锐 (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
Jul 7 Set monologue815,jiang-lirui,Allan_Yu,liudan12,mabing1118 as approver
53 messages are collapsed here。 See more
mabing
mabingCollaborators
Jul 15 Comments:

/lgtm

likedislike
jiang-lirui
jiang-liruiCollaborators
Jul 15 Comments:

/approve
/lgtm

likedislike
CANN-robotCANN-robotCollaborators
Jul 15 Added label: lgtmapproved
CANN-robotCANN-robotCollaborators
Jul 15 Closed associated issue
CANN-robotCANN-robotCollaborators
Jul 15 Merged pull request