AscendNPU-IR:基于MLIR的昇腾亲和算子编译中间表示项目

AscendNPU-IR是基于MLIR(Multi-Level Intermediate Representation)构建的,面向昇腾亲和算子编译时使用的中间表示,提供昇腾完备表达能力,通过编译优化提升昇腾AI处理器计算效率,支持通过生态框架使能昇腾AI处理器与深度调优

分支4Tags6
文件最后提交记录最后更新时间
[AscendNPU IR] modify issue template Co-authored-by: huchengbei<huqiao9@huawei.com> # message auto-generated for no-merge-commit merge: !59 merge update_issue_template into master [AscendNPU IR] modify issue template Created-by: huchengbei Commit-by: huchengbei Merged-by: ascend-robot Description: ## 描述 Description 请提供此 Pull Request 的高级别说明。 Please describe what this PR is about. ## 类型 Category - [ ] Bug修复 Bugfix - [ ] 新功能 New feature - [ ] 代码风格更新(格式化,局部变量)Style changes - [ ] 重构(即不是新增功能,也不是修改bug的代码变动)Refactor - [x] 构建过程或辅助工具的变动 Build-related - [ ] 文档内容更新 Docs ## Checklist - [x] 我的代码遵循这个项目的代码风格 My code follows the project's code style - [x] 我已经自己测试过我的代码 I have self-tested my code - [x] 我已经更新了相应的文档 I have updated the relevant documentation - [x] 我已经根据需要更新了对应的变更日志 I have updated the changelog as needed - [x] 我已经在标题中正确使用了类型标签(例如:feat:, fix:)I have correctly used type labels in the title (e.g., feat:, fix:) 相关issue:https://gitcode.com/Ascend/AscendNPU-IR/issues/43 See merge request: Ascend/AscendNPU-IR!597 个月前
!1078 merge feature_dot_scale_fp4 into master [AscendNPU IR] Implement data format for dot scale Created-by: ZhaoWentengZWT Commit-by: Zhao Wenteng Merged-by: ascend-robot Description: ## 描述 Description 请提供此 Pull Request 的高级别说明。 Please describe what this PR is about. ## 类型 Category - [ ] Bug修复 Bugfix - [x] 新功能 New feature - [ ] 代码风格更新(格式化,局部变量)Style changes - [ ] 重构(即不是新增功能,也不是修改bug的代码变动)Refactor - [ ] 构建过程或辅助工具的变动 Build-related - [ ] 文档内容更新 Docs ## Checklist - [x] 我的代码遵循这个项目的代码风格 My code follows the project's code style - [x] 我已经自己测试过我的代码 I have self-tested my code - [ ] 我已经更新了相应的文档 I have updated the relevant documentation - [ ] 我已经根据需要更新了对应的变更日志 I have updated the changelog as needed - [ ] 我已经在标题中正确使用了类型标签(例如:feat:, fix:)I have correctly used type labels in the title (e.g., feat:, fix:) See merge request: Ascend/AscendNPU-IR!10781 个月前
!748 merge fix-one-shot-bufferize-attribute into master [Huawei][MLIR] Fix OneShotBufferize to maintain attribute Created-by: kang-ingu Commit-by: kang-ingu Merged-by: ascend-robot Description: --- [Huawei][MLIR] Fix OneShotBufferize to maintain attribute --- ## Description This change adds two new LLVM/MLIR patch files in build-tools/patches/llvm-project that adjust how rewritten operations preserve attributes. In both ViewLikeInterface.h and BufferizableOpInterface.h, newly created replacement ops now copy over all attributes from the original op when those attributes are not already present on the new op. It also updates tensor bufferization logic in BufferizableOpInterfaceImpl.cpp for ExtractSliceOpInterface: the created memref::SubViewOp now similarly inherits missing attributes from the source op, and the replacement call is updated to pass subView.getResult() explicitly. Together, these updates ensure metadata on transformed ops is retained through folding/bufferization rewrites instead of being dropped. ## Important Notes This is a behavioral change in rewrite paths: attributes that were previously lost during op replacement will now be preserved unless the new op already defines them. If any downstream logic implicitly depended on those attributes being stripped during these transformations, results may differ. ## 类型 Category - [ ] Bug修复 Bugfix - [ ] 新功能 New feature - [ ] 代码风格更新(格式化,局部变量)Style changes - [ ] 重构(即不是新增功能,也不是修改bug的代码变动)Refactor - [ ] 构建过程或辅助工具的变动 Build-related - [ ] 文档内容更新 Docs ## Checklist - [ ] 我的代码遵循这个项目的代码风格 My code follows the project's code style - [ ] 我已经自己测试过我的代码 I have self-tested my code - [ ] 我已经更新了相应的文档 I have updated the relevant documentation - [ ] 我已经根据需要更新了对应的变更日志 I have updated the changelog as needed - [ ] 我已经在标题中正确使用了类型标签(例如:feat:, fix:)I have correctly used type labels in the title (e.g., feat:, fix:) See merge request: Ascend/AscendNPU-IR!7481 个月前
fix: markdownlint bug 1 个月前
[AscendNPU IR] Add HFusion Co-authored-by: chenxiangting<chenxiangting@huawei.com> 7 个月前
[BiShengIR] add clang-format/tidy 10 个月前
Fix clang-tidy naming rule 7 个月前
[Huawei][AscendNPUIR]practice 3 个月前
[AscendNPU IR] Add HFusion Co-authored-by: chenxiangting<chenxiangting@huawei.com> 7 个月前
[Huawei][AscendNPU IR] fix LLVM 22 compatible problems to support TA3.5 1 个月前
[AscendNPU IR] Add HFusion Co-authored-by: chenxiangting<chenxiangting@huawei.com> 7 个月前
[AscendNPU IR] Add HFusion Co-authored-by: chenxiangting<chenxiangting@huawei.com> 7 个月前
[AscendNPU IR] Add OWNERS Co-authored-by: SL25<L912572014@163.com> 7 个月前
fix: markdownlint error 2 个月前
fix: markdownlint error 2 个月前
[Huawei][AscendNPU IR] add notice for open source software Signed-off-by: tianjihua <tianjihua@huawei.com>1 个月前

AscendNPU IR定位

🎯 项目介绍

AscendNPU IR(AscendNPU Intermediate Representation)是基于MLIR(Multi-Level Intermediate Representation)构建的,面向昇腾亲和算子编译时使用的中间表示,提供昇腾完备表达能力,通过编译优化提升昇腾AI处理器计算效率,支持通过生态框架使能昇腾AI处理器与深度调优。

AscendNPU IR提供多级抽象接口:提供一系列高层抽象接口,屏蔽昇腾计算、搬运、同步指令细节,编译优化自动感知硬件架构,将硬件无关表达映射到底层指令,提升算子开发易用性;同时提供细粒度性能控制接口,能够精准控制片上内存地址、流水同步插入位置以及是否使能乒乓流水优化等,允许性能细粒度控制。

AscendNPU IR通过开源社区开放接口,支持生态框架灵活对接,高效使能昇腾AI处理器。

🔗 仓库与文档

🔍 仓库结构

AscendNPU IR仓关键目录如下所示:

├── bishengir            // 源码目录
│   ├── cmake
│   ├── include          // 头文件
│   ├── lib              // 源文件
│   ├── test             // 测试用例
│   │   └── Integration   // 端到端用例
│   └── tools            // 二进制工具
├── build-tools          // 构建工具
├── CMakeLists.txt
├── docs                 // 文档
├── LICENSE
├── NOTICE
├── README.md
└── README_zh.md

📚 文档说明

本项目在 docs/ 目录下使用基于 Sphinx 的文档工程,通过成对的 Markdown 源文件提供英文与中文双语文档

  • 语言:完整文档方案请参见 docs/README.md(英文)与 docs/README_zh.md(中文)。
  • 文档组织方案
    • 英文:入口页为 docs/source/en/index.rst,正文位于 docs/source/en 目录下。
    • 中文:入口页为 docs/source/zh_cn/index.rst,正文位于 docs/source/zh_cn 目录下。
  • 命名规范docs/(包含 docs/source/)下的目录名文档文件名统一采用 snake_case 小写下划线风格,例如:quick_start/installing_guide.mduser_guide/,以保持路径与 URL 风格一致。

在仓库根目录下构建文档:

make -C docs html      # 仅英文 → docs/_build/en
make -C docs html-zh   # 仅中文 → docs/_build/zh_cn
make -C docs html-all  # 中英文均构建

关于本地预览、Read the Docs 部署、新增文档与整体结构说明,请参考 docs/README_zh.md(或英文版 docs/README.md)。

⚡️ 快速上手

快速上手指南请见:快速上手

编译与安装指南请见:构建安装

构建端到端用例示例请见:README_zh.md

示例名称 构建指南
HIVM VecAdd VecAdd README_zh.md

📝 版本配套说明

请参考CANN社区版文档相关章节,对昇腾硬件、CANN软件及相应深度学习框架进行安装准备。

📄 许可证书

Apache License v2.0

项目介绍

AscendNPU-IR是基于MLIR(Multi-Level Intermediate Representation)构建的,面向昇腾亲和算子编译时使用的中间表示,提供昇腾完备表达能力,通过编译优化提升昇腾AI处理器计算效率,支持通过生态框架使能昇腾AI处理器与深度调优

https://ascendnpu-ir.gitcode.com定制我的领域

下载使用量

0

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

语言类型

C++57.88%
MLIR40.2%
CMake0.8%
C0.43%
Python0.41%