已关闭
[Bug-Report|缺陷反馈]: 处理 swiglu_group和swiglu_group_quant 算子的自动反向传播未在 dispatcher 层注册的问题 #4636
liuhongpeng创建于  8月7日关闭于  28 天前
liuhongpeng
8月7日 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

此 PR 主要解决 swiglu_group 算子的自动反向传播未在 dispatcher 层注册的问题,导致图模式(torch.compile)下部分场景的反向传播异常。核心改动是将反向传播逻辑从自定义的 torch.autograd.Function 子类 SwigluGroupFn 迁移至 torch.library.register_autograd 进行注册,使 autograd 在 dispatcher 层生效;同时调整了算子签名中参数的位置/关键字属性,将 weight 和 group_index 变为位置参数,clamp_limit 变为 keyword-only 参数。

Environment / 环境信息 (Mandatory / 必填)

ascend950

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

编写脚本调用自动反向功能

Describe the expected behavior / 预期结果 (Mandatory / 必填)

自动反向的用例OK

会出现:NoneType object has no attribute dim的报错

Special notes for this issue/备注 (Optional / 选填)

likedislike
liuhongpeng
8月7日 评论:

/assign

likedislike
CANN-robotCANN-robot成员
8月7日 将 liu_hp711 设为负责人
Lliuhongpeng
29 天前 修改标题为 “[Bug-Report|缺陷反馈]: 处理 swiglu_group和swiglu_group_quant 算子的自动反向传播未在 dispatcher 层注册的问题”,原标题为“[Bug-Report|缺陷反馈]: 处理 swiglu_group 算子的自动反向传播未在 dispatcher 层注册的问题”
CANN-robotCANN-robot成员
28 天前 关闭了 issue
CANN-robotCANN-robot成员
28 天前 添加了label:resolved