Open
feat(quant): support torch.compile for per-block quantization ops #66
feat(quant): support torch.compile for per-block quantization ops #66
Open
daisysjAdd on 1 day ago
daisysj
1 day ago

当前PR是否有AI参与:

[x] 否

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

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

支持 Per-block 量化算子入图

  • 为 per_block_cast、per_block_cast_with_sf_only、per_block_cast_with_precomputed_sf 和 per_block_cast_lossless 添加 torch.compile 入图支持。普通调用和编译路径共用各自的 custom op。
  • 注册 FakeTensor 实现,复用输入元信息校验,并按各接口的返回契约推导量化数据和 scale 的形状、类型及布局。
  • 从公开入口显式传递 clamp_min_value 和有效向量核数。JIT 工厂使用传入的核数,公开接口签名保持原样。
  • 在已有测试文件中补充入图用例,覆盖数值正确性、输入只读契约、FakeTensor、图捕获与重放。A5 上 9 个入图用例和 2 个普通执行抽样均通过,并验证了配置切换后 Dynamo 图中的参数会更新。

该PR关联的issue

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

希望检视人员了解:

改动类型 / Change Type

测试信息 / Testing

检查清单 / Checklist

likedislike
Merge blocked
Ddaisysj
1 day ago Created pull request, commit 2cf4d3f1
CANN-robotCANN-robotCollaborators
1 day ago Added label: stat/needs-squash
CANN-robotCANN-robotCollaborators
1 day ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
1 day 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: ChaoyangJi, 黄俊健, 刘丹, kevin365, 俞郑中) ❌ (0/1)(You can also ask: jiawei_zhuang, kevin365, 俞郑中, 黄俊健, ChaoyangJi)

💡 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
1 day ago Set ChaoyangJi,kevin365,monologue815,jiang-lirui,Allan_Yu,jiawei_zhuang,liudan12,mabing1118 as approver
CANN-robotCANN-robotCollaborators
1 day ago Set ChaoyangJi,kevin365,monologue815,jiang-lirui,Allan_Yu,jiawei_zhuang,liudan12,mabing1118 as approver
Ddaisysj
12 hours ago Modify description of pull request