基于 CANNBot-DSL 的 Ascend NPU 复杂算子示例集合。
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
切换CCE集群 Co-authored-by: wangchuang616<wangchuang12@huawei.com> # message auto-generated for no-merge-commit merge: !37 merge master into master 切换CCE集群 Created-by: wangchuang616 Commit-by: wangchuang616 Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [ ] 单元测试通过 / UT passed - [ ] 集成测试通过 / ST passed - [ ] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [ ] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [ ] 文档已更新 / Docs updated if needed - [ ] 无硬编码敏感信息 / No secrets hardcoded - [ ] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!37 | 1 个月前 | |
更新flash attention性能对比图:DSL vs FIA (CANN built-in),15条用例覆盖decode/mtp/GQA/S1>S2/S1<S2等场景 Co-authored-by: ZacharyX<xiongzhiqiang3@hisilicon.com> # message auto-generated for no-merge-commit merge: !39 merge master into master 更新flash attention性能对比图:DSL vs FIA (CANN built-in),15条用例覆盖decode/mtp/GQA/S1>S2/S1<S2等场景 Created-by: ZacharyX Commit-by: ZacharyX Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [ ] 单元测试通过 / UT passed - [ ] 集成测试通过 / ST passed - [ ] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [ ] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [ ] 文档已更新 / Docs updated if needed - [ ] 无硬编码敏感信息 / No secrets hardcoded - [ ] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!39 | 1 个月前 | |
adapt api change Co-authored-by: ly_cann_coder<liyao152@huawei.com> # message auto-generated for no-merge-commit merge: !34 merge dev_0811 into master adapt api change Created-by: ly_cann_coder Commit-by: ly_cann_coder Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [ ] 单元测试通过 / UT passed - [ ] 集成测试通过 / ST passed - [ ] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [ ] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [ ] 文档已更新 / Docs updated if needed - [ ] 无硬编码敏感信息 / No secrets hardcoded - [ ] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!34 | 2 个月前 | |
ci: move test_config.yaml to test directory Co-authored-by: zhu-lei0614<zhulei113@huawei.com> # message auto-generated for no-merge-commit merge: !33 merge move-test-config into master ci: move test_config.yaml to test directory Created-by: zhu-lei0614 Commit-by: zhu-lei0614 Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [ ] 单元测试通过 / UT passed - [ ] 集成测试通过 / ST passed - [ ] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [ ] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [ ] 文档已更新 / Docs updated if needed - [ ] 无硬编码敏感信息 / No secrets hardcoded - [ ] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!33 | 2 个月前 | |
adapt api change Co-authored-by: ly_cann_coder<liyao152@huawei.com> # message auto-generated for no-merge-commit merge: !34 merge dev_0811 into master adapt api change Created-by: ly_cann_coder Commit-by: ly_cann_coder Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [ ] 单元测试通过 / UT passed - [ ] 集成测试通过 / ST passed - [ ] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [ ] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [ ] 文档已更新 / Docs updated if needed - [ ] 无硬编码敏感信息 / No secrets hardcoded - [ ] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!34 | 2 个月前 | |
add ci Co-authored-by: zhu-lei0614<zhulei113@huawei.com> # message auto-generated for no-merge-commit merge: !24 merge master into master add ci Created-by: zhu-lei0614 Commit-by: zhu-lei0614 Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [ ] 单元测试通过 / UT passed - [ ] 集成测试通过 / ST passed - [ ] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [ ] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [ ] 文档已更新 / Docs updated if needed - [ ] 无硬编码敏感信息 / No secrets hardcoded - [ ] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!24 | 2 个月前 | |
add ci Co-authored-by: zhu-lei0614<zhulei113@huawei.com> # message auto-generated for no-merge-commit merge: !24 merge master into master add ci Created-by: zhu-lei0614 Commit-by: zhu-lei0614 Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [ ] 单元测试通过 / UT passed - [ ] 集成测试通过 / ST passed - [ ] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [ ] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [ ] 文档已更新 / Docs updated if needed - [ ] 无硬编码敏感信息 / No secrets hardcoded - [ ] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!24 | 2 个月前 | |
| 2 个月前 | ||
chore: OAT.xml移除注释项,README更新voxel_conv公式描述 Co-authored-by: ZacharyX<xiongzhiqiang3@hisilicon.com> # message auto-generated for no-merge-commit merge: !15 merge master into master chore: OAT.xml移除注释项,README更新voxel_conv公式描述 Created-by: ZacharyX Commit-by: ZacharyX Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [ ] 单元测试通过 / UT passed - [ ] 集成测试通过 / ST passed - [ ] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [ ] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [ ] 文档已更新 / Docs updated if needed - [ ] 无硬编码敏感信息 / No secrets hardcoded - [ ] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!15 | 2 个月前 | |
fix media to figures Co-authored-by: sky-zyh<zhangyuhan45@huawei.com> # message auto-generated for no-merge-commit merge: !23 merge zyh into master fix media to figures Created-by: sky-zyh Commit-by: sky-zyh Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: - 将仓库根目录 media/ 重命名为语义更明确的 figures/。 - 迁移以下四张性能对比图片,图片内容未发生变化: - flash_attn.png - flash_kda.png - matmul.png - rms_norm.png - 更新根目录 README.md 中的仓库结构说明。 - 更新 flash_attn、flash_kda、matmul、rms_norm README 中的图片引用路径。 - 统一仓库图片资源的目录命名,避免目录重命名后 README 图片链接失效。 ### 该PR关联的issue fixes [#2](https://gitcode.com/cann/cannbot-dsl/issues/2) ### 希望检视人员了解: - 本次修改只涉及图片目录重命名和 Markdown 引用更新,不涉及算子实现或运行逻辑。 - 四张图片均为 Git 100% rename,图片二进制内容未修改。 - 仓内已不存在有效的 media/ 路径引用。 ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [x] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing - 扫描仓内路径,确认没有遗留有效的 media/ 引用。 - 检查 figures/ 下四张图片均存在。 - [ ] 单元测试通过 / UT passed - [ ] 集成测试通过 / ST passed - [ ] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [ ] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [x] 文档已更新 / Docs updated if needed - [x] 无硬编码敏感信息 / No secrets hardcoded - [ ] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!23 | 2 个月前 | |
fix: match test runner full labels Co-authored-by: zhu-lei0614<zhulei113@huawei.com> # message auto-generated for no-merge-commit merge: !30 merge fix-test-runs-on into master fix: match test runner full labels Created-by: zhu-lei0614 Commit-by: zhu-lei0614 Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [ ] 单元测试通过 / UT passed - [ ] 集成测试通过 / ST passed - [ ] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [ ] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [ ] 文档已更新 / Docs updated if needed - [ ] 无硬编码敏感信息 / No secrets hardcoded - [ ] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!30 | 2 个月前 | |
add ci Co-authored-by: zhu-lei0614<zhulei113@huawei.com> # message auto-generated for no-merge-commit merge: !24 merge master into master add ci Created-by: zhu-lei0614 Commit-by: zhu-lei0614 Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [ ] 单元测试通过 / UT passed - [ ] 集成测试通过 / ST passed - [ ] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [ ] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [ ] 文档已更新 / Docs updated if needed - [ ] 无硬编码敏感信息 / No secrets hardcoded - [ ] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!24 | 2 个月前 | |
add ci Co-authored-by: zhu-lei0614<zhulei113@huawei.com> # message auto-generated for no-merge-commit merge: !24 merge master into master add ci Created-by: zhu-lei0614 Commit-by: zhu-lei0614 Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [x] 否 [ ] 是 __1. AI Agent 平台: __2. AI 模型: __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> ### 该PR关联的issue *(格式为fixes #<issue号>, 或者resolves #<issue号>)*: fixes # ### 希望检视人员了解: ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [ ] 单元测试通过 / UT passed - [ ] 集成测试通过 / ST passed - [ ] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [ ] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [ ] 文档已更新 / Docs updated if needed - [ ] 无硬编码敏感信息 / No secrets hardcoded - [ ] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!24 | 2 个月前 |
CANNBot-DSL
基于 CANNBot-DSL 的 Ascend NPU 复杂算子示例集合。
📖 概述 · 📦 算子列表 · 📂 目录结构 · 📜 许可证
概述
当前仓库中的 samples 使用 CANNBot 基于 CANNBot-DSL 生成,涵盖 VoxelConv、PointNet Set Abstraction、Flash Attention、Kimi Delta Attention 等复杂算子。本次开源样例代码,自定义开发、测试等功能将于近期发布,敬请期待。
项目面向 NPU ARCH 3510(Ascend 950PR / Ascend 950DT),详见 算子列表。
算子列表
| 算子 | 公式 | 文档 |
|---|---|---|
| voxel_conv | C[N,Co,Ho,Wo]=VoxelConv(x,filter)C[N, Co, Ho, Wo] = \text{VoxelConv}(x, filter)C[N,Co,Ho,Wo]=VoxelConv(x,filter) | samples/voxel_conv |
| flash_attn | O=softmax(QKT⋅scale)VO = softmax(QK^T \cdot scale) VO=softmax(QKT⋅scale)V | samples/flash_attn |
| flash_kda | Kimi Delta Attention prefill 融合算子 | samples/flash_kda |
| matmul | C[M,N]=A[M,K]@B[N,K]TC[M,N] = A[M,K] @ B[N,K]^TC[M,N]=A[M,K]@B[N,K]T | samples/matmul |
| pointnet_sa | feat[K,Dout]=maxjMLP(points[K,j,Din])\text{feat}[K, D_{out}] = \max_{j} \text{MLP}(\text{points}[K, j, D_{in}])feat[K,Dout]=maxjMLP(points[K,j,Din]) | samples/pointnet_sa |
| rms_norm | y=x⋅rstd⋅γy = x \cdot rstd \cdot \gammay=x⋅rstd⋅γ | samples/rms_norm |
目录结构
├── samples/ # 算子实现与使用说明
│ ├── voxel_conv/ # VoxelConv 卷积
│ ├── flash_attn/ # Flash Attention
│ ├── flash_kda/ # Kimi Delta Attention
│ ├── matmul/ # 非量化矩阵乘
│ ├── pointnet_sa/ # PointNet Set Abstraction
│ └── rms_norm/ # RmsNorm 归一化
├── test/ # 测试
│ ├── voxel_conv/
│ ├── flash_attn/
│ ├── flash_kda/
│ ├── matmul/
│ ├── pointnet_sa/
│ └── rms_norm/
├── figures/
└── README.md
相关信息
- 许可证
- 源文件头部包含完整的版权与许可声明,遵循 CANN Open Software License Agreement Version 2.0