Open
feat(quant): support torch.compile for SwiGLU operators #72
feat(quant): support torch.compile for SwiGLU operators #72
Open
daisysjAdd on 13 hours ago
daisysj
13 hours ago

当前PR是否有AI参与:

[x] 否

[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :

PR功能描述 / 为什么需要这个合入**:

支持 SwiGLU 系列算子入图,使前向、融合量化前向和反向能够通过 torch.compile 使用 npugraph_ex 执行。

  • 为 swiglu_forward、swiglu_forward_and_per_token_cast 和 swiglu_backward 注册 custom op 与 FakeTensor 实现,统一普通调用和编译路径。
  • 显式传递向量核数、token alignment 和量化 clamp 配置,使配置变化能够触发对应的图特化。
  • 声明 clamped_count 的写入行为,并支持反向按需返回路由权重梯度及重算激活。
  • 在已有测试文件中补充核心用例,验证数值正确性、输入修改契约、FakeTensor、图捕获与重放。

该PR关联的issue

(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #

希望检视人员了解:

改动类型 / Change Type

测试信息 / Testing

检查清单 / Checklist

likedislike
Merge blocked
Ddaisysj
13 hours ago Created pull request, commit b1ee0380
CANN-robotCANN-robotCollaborators
13 hours ago Added label: stat/needs-squash
CANN-robotCANN-robotCollaborators
13 hours ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
13 hours ago 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

⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)

Module Approval Details

module lgtm status approve status
repo-cann/ops-tilelang ❌ (0/2)(You can also ask: 蒋礼锐, jiawei_zhuang, ChaoyangJi, kevin365, 刘丹) ❌ (0/1)(You can also ask: 马兵, kevin365, 蒋礼锐, jiawei_zhuang, 刘丹)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
13 hours ago Set ChaoyangJi,kevin365,monologue815,jiang-lirui,Allan_Yu,jiawei_zhuang,liudan12,mabing1118 as approver
CANN-robotCANN-robotCollaborators
13 hours ago Set ChaoyangJi,kevin365,monologue815,jiang-lirui,Allan_Yu,jiawei_zhuang,liudan12,mabing1118 as approver