已合并
refactor: 迁移 kv_compress_epilog / pointnet_sa / rms_norm / voxel_conv #99
refactor: 迁移 kv_compress_epilog / pointnet_sa / rms_norm / voxel_conv #99
已合并
mayafei创建于 15 天前
mayafei
15 天前

概述

kv_compress_epilog / pointnet_sa / rms_norm / voxel_conv 四个算子样例此前固定在旧版 DSL whl 上,无法在 CANNBot-DSL 0.6.0 上运行。本 MR 将这四个算子迁移至 0.6.0 新接口,并按代码检视意见完成整改,测试同步迁移。

改动范围仅限这四个算子(grouped_matmul / matmul 不在本次范围内,未做改动)。

接口迁移

  • 模块路径迁至 cannbotdsl.ops.* / cannbotdsl.lang.*
  • tile_view 更名 tile_slice;@jit 入口更名 @host
  • 张量搬运改为 Channel.produce() / consume() 显式槽位协议
  • torch 张量直传,去掉 as_tensor 转换层
  • vf 寄存器模式 raw → simd;删除 vf 结尾不再需要的 membar
  • pointnet_sa 按新接口重写 host 侧并统一 tiling 属性为 snake_case
  • rms_norm 采用 arena 维护版内核与接口;voxel_conv 补齐 produce/consume 槽位协议与 @host 入口

代码检视整改

  • host 侧不再校验 tensor 是否在 NPU;不再读取 device tensor 的值(移除 .cpu() / .item() 路径)
  • workspace 与输出 tensor 统一用 torch.empty 构造
  • 校验由 assert 改为显式 raise ValueError / TypeError,只校验算子规格
  • 类名统一大驼峰,tiling 属性统一 snake_case
  • 清理未使用的 import 与变量;修正首字母小写的 docstring
  • metadata 与主算子 py 文件同目录

测试

四个算子的测试同步迁移至 @host 入口与新模块路径,61 个用例全部通过。

算子 用例数
kv_compress_epilog 8
pointnet_sa 13
rms_norm 25
voxel_conv 15

🤖 Generated with Claude Code

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 mayafei 的贡献)
Mmayafei
15 天前 创建了 pull request,commit ad567665
CANN-robotCANN-robot成员
15 天前 添加了label:cann-cla/no
CANN-robot
CANN-robot成员
15 天前 评论:

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
repo-cann/cannbot-dsl ✅ liujun2025, yang-jiwei (2/2) ✅ liujun2025, yang-jiwei (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
mayafei
15 天前 评论:

/check-cla

likedislike
Mmayafei
15 天前 预合并成功(commit_id: b3a89beda4ae992ae327e0ae38eef7087eeb7a00)
此处折叠了144条消息 查看更多
yang-jiwei成员
13 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
13 天前 添加了label:approved
liujun2025成员
13 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
13 天前 添加了label:lgtm
CANN-robotCANN-robot成员
13 天前 合入了pull request