op-plugin:基于昇腾Ascend Extension for PyTorch的算子插件项目

OpPlugin of Ascend Extension for PyTorch

分支12Tags2
文件最后提交记录最后更新时间
[docs]add PR notes info Co-authored-by: liangsongwei<liangsongwei@huawei.com> # message auto-generated for no-merge-commit merge: !4254 merge cherry-pick-mr-4253-1770867840154-auto into 7.3.0 [docs]add PR notes info Created-by: liangsongwei Commit-by: liangsongwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > (如有)请关联需求文档/issue链接 - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [x] 资料更新 # 【修改方案】 一是要求必须关联社区issue链接; 二是禁止填写需求链接、问题单等内部流程信息。 该修改通过直接更新模板文件生效,不涉及任何代码逻辑变更。 # 【资料变更】 PR提交模板信息补充 # 【接口变更】 不涉及 # 【功能验证】 ![image.png](https://raw.gitcode.com/user-images/assets/7404318/6b276c27-f6bc-463b-a340-1c3e155aa1e3/image.png 'image.png') # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/op-plugin!42543 个月前
Update URL (gitcode) Co-authored-by: dilililiwhy<why.wuhuanyu@huawei.com> # message auto-generated for no-merge-commit merge: merge update_url into master Update URL (gitcode) Created-by: dilililiwhy Commit-by: dilililiwhy Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** > Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line: > > /kind bug > /kind task > /kind feature **What does this PR do / why do we need it**: **Special notes for your reviewers**: See merge request: Ascend/op-plugin!31658 个月前
fix docs Co-authored-by: SCh-zx<1325467101@qq.com> # message auto-generated for no-merge-commit merge: !3995 merge 7.3.0 into 7.3.0 fix docs Created-by: SCh_zx Commit-by: SCh-zx Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** > Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line: > > /kind bug > /kind task > /kind feature **What does this PR do / why do we need it**: **Special notes for your reviewers**: See merge request: Ascend/op-plugin!39954 个月前
[fix] 修复PR3423修改的文档问题 Co-authored-by: yiqiao-wjp<wangjianping48@huawei.com> # message auto-generated for no-merge-commit merge: !4724 merge 7.3.0 into 7.3.0 [fix] 修复PR3423修改的文档问题 Created-by: yiqiao-wjp Commit-by: yiqiao-wjp Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [x] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 修复[PR](https://gitcode.com/Ascend/op-plugin/pull/3423)修改带来的logit不支持为空的情况 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/op-plugin!47241 个月前
Update URL (gitcode) Co-authored-by: dilililiwhy<why.wuhuanyu@huawei.com> # message auto-generated for no-merge-commit merge: merge update_url into master Update URL (gitcode) Created-by: dilililiwhy Commit-by: dilililiwhy Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** > Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line: > > /kind bug > /kind task > /kind feature **What does this PR do / why do we need it**: **Special notes for your reviewers**: See merge request: Ascend/op-plugin!31658 个月前
[revert] fix conv3d mask Co-authored-by: shaoyf<shaoyifan1@huawei.com> # message auto-generated for no-merge-commit merge: !4156 merge revert-mr-3998-1769825255340-auto into 7.3.0 [revert] fix conv3d mask Created-by: shaoyf Commit-by: shaoyf Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** > Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line: > > /kind bug > /kind task > /kind feature **What does this PR do / why do we need it**: **Special notes for your reviewers**: See merge request: Ascend/op-plugin!41561 个月前
[revert] fix conv3d mask Co-authored-by: shaoyf<shaoyifan1@huawei.com> # message auto-generated for no-merge-commit merge: !4156 merge revert-mr-3998-1769825255340-auto into 7.3.0 [revert] fix conv3d mask Created-by: shaoyf Commit-by: shaoyf Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** > Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line: > > /kind bug > /kind task > /kind feature **What does this PR do / why do we need it**: **Special notes for your reviewers**: See merge request: Ascend/op-plugin!41561 个月前
init submodule 3 年前
update LICENSE. Signed-off-by: weili10 <liwei386@huawei.com>2 年前
Update URL (gitcode) Co-authored-by: dilililiwhy<why.wuhuanyu@huawei.com> # message auto-generated for no-merge-commit merge: merge update_url into master Update URL (gitcode) Created-by: dilililiwhy Commit-by: dilililiwhy Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** > Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line: > > /kind bug > /kind task > /kind feature **What does this PR do / why do we need it**: **Special notes for your reviewers**: See merge request: Ascend/op-plugin!31658 个月前
docs:Modifying the README file Co-authored-by: s50057208<shiyunhan1@huawei.com> # message auto-generated for no-merge-commit merge: !4432 merge new into 7.3.0 docs:Modifying the README file Created-by: mengmeizi05 Commit-by: s50057208 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 修改了README.md 并依照修改意见挪动了部分文档和新增了部分文档在docs/zh文件夹中 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/op-plugin!44322 个月前
!2388 [master] Update the referenced PyTorch version to v2.3.1. Merge pull request !2388 from shaoyf/master_notice 1 年前
Checkout v2r10 Co-authored-by: dilililiwhy<why.wuhuanyu@huawei.com> # message auto-generated for no-merge-commit merge: merge pr_3154_1757822748315 into master Checkout v2r10 Created-by: dilililiwhy Commit-by: dilililiwhy Merged-by: ascend-robot Description: 1. add v2r10 --- <!-- Thanks for sending a pull request! --> **What type of PR is this?** > Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line: > > /kind bug > /kind task > /kind feature **What does this PR do / why do we need it**: **Special notes for your reviewers**: See merge request: Ascend/op-plugin!31548 个月前

OpPlugin

简介

本项目开发了Ascend Extension for Pytorch(torch_npu)算子插件,为使用PyTorch框架的开发者提供便捷的NPU算子库调用能力。 OpPlugin算子插件的编译、使用依赖昇腾Ascend Extension for PyTorch。因此,在编译OpPlugin之前,需要了解、安装昇腾PyTorch。使用手册可参考昇腾社区Ascend Extension for Pytorch

目录结构

关键目录如下:

├─docs                             # 文档目录
├─ci                               # 自动化构建与测试脚本目录
├─op_plugin                        # 项目核心目录
│  ├─config                        # 配置管理目录
│  ├─ops                           # 算子实现目录
│  ├─python                        # python绑定目录
├─codegen                          # 代码生成目录
├─examples                         # 示例目录                        
└─test                             # 测试目录

版本说明

op-plugin仓旨在为torch_npu提供运行所需要的算子适配文件,两个仓的对应关系如下:

op-plugin分支 对应Ascend Extension for PyTorch版本(分支)
master 主线版本,如v2.7.1等
7.3.0 7.3.0版本,如v2.7.1-7.3.0等
7.2.0 7.2.0版本,如v2.7.1-7.2.0等
7.1.0 7.1.0版本,如v2.1.0-7.1.0等
7.0.0 7.0.0版本,如v2.1.0-7.0.0等
6.0.0 6.0.0版本,如v2.1.0-6.0.0等
6.0.rc3 6.0.rc3版本,如v2.1.0-6.0.rc3等
6.0.rc2 6.0.rc2版本,如v2.1.0-6.0.rc2等
6.0.rc1 6.0.rc1版本,如v2.1.0-6.0.rc1等
5.0.0 5.0.0版本,如v2.1.0-5.0.0等
5.0.rc3 5.0.rc3版本,如v2.1.0-5.0.rc3等

安装OpPlugin

支持通过源码编译的方式安装OpPlugin。具体操作,请参考安装OpPlugin

快速入门

提供了一个通过OpPlugin插件实现PyTorch调用Ascend C自定义算子的完整开发指南,涵盖了从环境配置、算子注册、适配实现到测试验证提供了全流程说明。具体操作,请参考调用样例

API参考

基于PyTorch2.9.0/2.8.0/2.7.1/2.6.0版本,提供Ascend Extension for PyTorch自定义API的功能说明、函数原型、参数说明与调用示例等。具体信息,请参考自定义API参考

生命周期

op-plugin仓依赖torch_npu运行,生命周期请参考torch_npu中的PyTorch版本维护策略

贡献指导

介绍如何向OpPlugin仓库贡献代码,具体请参见贡献指南

联系我们

如果有任何疑问或建议,请提交GitCode Issues,我们会尽快回复。感谢您的支持。

安全声明

主要描述了OpPlugin的安全加固信息、公网地址信息及通信矩阵等内容。具体介绍,请参考OpPlugin安全声明

免责声明

致OpPlugin插件使用者

  • 本插件仅供调试和开发使用,使用者需自行承担使用风险,并理解以下内容:
    • 数据处理及删除:用户在使用本插件过程中产生的数据属于用户责任范畴。建议用户在使用完毕后及时删除相关数据,以防信息泄露。
    • 数据保密与传播:使用者了解并同意不得将通过本插件产生的数据随意外发或传播。对于由此产生的信息泄露、数据泄露或其他不良后果,本插件及其开发者概不负责。
    • 用户输入安全性:用户需自行保证输入的命令行的安全性,并承担因输入不当而导致的任何安全风险或损失。对于输入命令行不当所导致的问题,本插件及其开发者概不负责。
  • 免责声明范围:本免责声明适用于所有使用本插件的个人或实体。使用本插件即表示您同意并接受本声明的内容,并愿意承担因使用该功能而产生的风险和责任,如有异议请停止使用本插件。
  • 在使用本工具之前,请谨慎阅读并理解以上免责声明的内容。对于使用本插件所产生的任何问题或疑问,请及时联系开发者。

License

OpPlugin的使用许可证,详见LICENSE

致谢

感谢来自社区的每一个PR,欢迎贡献Ascend Extension for TensorPipe插件!

项目介绍

OpPlugin of Ascend Extension for PyTorch

定制我的领域

下载使用量

0

项目总下载次数(含Clone、Pull、 zip 包及 release 下载),每日凌晨更新

语言类型

Python60.5%
C++39.17%
C0.24%
Shell0.07%
CMake0.02%