Closed
[Feature] examples 缺少 torch 前端调用路径,需支持 torch 接口直调 Blaze kernel #343
chen-kang30Add on  Oct 27Closed at  16 days ago
chen-kang30
chen-kang30Collaborators
Oct 27 Create

背景

当前 ops-tensor 的 examples 仅有纯 C++(ACL 直调)一条路径,用户需要手工准备 bin 输入文件、命令行传 shape 参数才能跑通 kernel。对于算法侧用户而言,更常见的工作流是在 Python/torch 环境中组织数据并直接调用算子,缺少这条路径提高了 Blaze kernel 的试用与验证门槛。

需求

在 examples 中增加一条 torch 调用路径:

  • 将 Blaze kernel 注册为 torch 自定义算子(TORCH_LIBRARY / TORCH_LIBRARY_IMPL),Python 侧通过 torch.ops 命名空间直接调用
  • 从 torch_npu 当前 stream 取流、转发 tensor 裸指针,直调 Blaze kernel,不引入 aclnn 中间层
  • torch/torch_npu 作为可选依赖,独立构建,不影响既有 C++ examples
  • 提供端到端测试脚本,与 torch 原生参考实现比对精度

验收标准

likedislike
chen-kang30
chen-kang30Collaborators
Oct 27 Comments:
sxb154714sxb154714Collaborators
29 days ago Assign sxb154714 as responsible person
sxb154714
sxb154714Collaborators
29 days ago Comments:

感谢你的建议,安排同学处理中

likedislike
sxb154714sxb154714Collaborators
16 days ago Removed responsible person sxb154714
sxb154714sxb154714Collaborators
16 days ago Assign chenkang30 as responsible person
sxb154714
sxb154714Collaborators
16 days ago Comments:

/close

likedislike
CANN-robotCANN-robotCollaborators
16 days ago changed custom state from 进行中 to 已完成
CANN-robotCANN-robotCollaborators
16 days ago Close issue
CANN-robotCANN-robotCollaborators
16 days ago Added label: resolved