用于学习和开发昇腾 NPU 复杂算子,快速参考 Ascend 950 的算子实现。项目提供 Flash Attention、Kimi Delta Attention、矩阵乘等示例,基于 CANNBot-DSL 生成,含测试与说明。【此简介由AI生成】
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
action上线适配:checkout改allow-unsafe-pr-checkout,revise-img改comment+TESTTOKEN | 1 个月前 | |
文档站点搭建 & api文档模板 Co-authored-by: taomengyuan-hw<taomengyuan3@huawei.com> # message auto-generated for no-merge-commit merge: !57 merge master into master 文档站点搭建 & api文档模板 Created-by: taomengyuan-hw Commit-by: taomengyuan-hw 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!57 | 1 个月前 | |
update_matmul_sample Co-authored-by: chen-shuai<chenshuai96@huawei.com> # message auto-generated for no-merge-commit merge: !45 merge update_matmul_sample into master update_matmul_sample Created-by: chen-shuai Commit-by: chen-shuai Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [] 否 [√] 是 __1. AI Agent 平台: cannbot __2. AI 模型: GLM5.3 __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> 本 PR 完善 Matmul 类算子样例,新增 GroupedMatmul 和 MXFP8 QBMM,并调整 Matmul 目录结构,使不同场景的实现、文档和测试能够独立维护。 主要改动: - 新增 GroupedMatmul 样例,支持 group_type=-1/0/2、group_list_type=0/1 和 split_item=0/1/2/3。 - GroupedMatmul 覆盖 S1~S6 输入组织方式,支持单/多 Tensor、M 轴分组、K 轴分组,以及显式或隐式 group_list。 - GroupedMatmul Kernel 按各 Group 的真实 M/K 边界计算,Host 侧不执行 cat/stack/contiguous 或补齐。 - GroupedMatmul 使用自适应滑动窗口多核调度、跨 Group 负载均衡和 L2 Cache 控制。 - 新增 MXFP8 QBMM 样例,A/B 支持 float8_e4m3fn、float8_e5m2,ScaleA/ScaleB 使用公开三维 E8M0 paired-scale 布局。 - MXFP8 QBMM 支持四种 transposeA/transposeB 组合、M/N/K 尾块、Bias,以及 FP16/BF16/FP32 输出。 - MXFP8 Host Tiling 根据 Shape 和片上存储容量选择 baseM/baseN/baseK、kL1/scaleKL1 与 Buffer 深度。 - MXFP8 Kernel 支持 ASW 多核调度、AL1_FULL_LOAD、L1/L0 Ping-Pong、L0C Ping-Pong、UnitFlag 和 L2 Cache 控制。 - MXFP8 Torch 接口的参数顺序与 torch_npu.npu_quant_matmul 保持一致。 - 将非量化 Matmul 移入 samples/matmul/matmul,MXFP8 QBMM 放入 samples/matmul/quant_matmul。 - 同步调整测试目录和引用路径,并补充非对齐 Shape 的精度覆盖。 - 为 GroupedMatmul、Matmul 和 MXFP8 QBMM 补充 README、使用示例、精度测试和性能对比图。 ### 该PR关联的issue 无 ### 希望检视人员了解: - Device Kernel 面向 NPU ARCH 3510(Ascend 950PR / Ascend 950DT)。 - GroupedMatmul 请重点检视 S1~S6 输入映射、group_list 语义和跨 Group 多核调度。 - MXFP8 QBMM 请重点检视四种转置的数据与 Scale 布局、尾块 actual shape、kL1/scaleKL1 流水和 AL1_FULL_LOAD。 - samples/matmul/README.md 的删除属于目录拆分,内容已迁移到对应子目录。 ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [x] 新功能 / New Feature - [x] 性能优化 / Performance - [x] 代码重构 / Refactoring - [x] 文档更新 / Documentation - [x] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [x] 单元测试通过 / UT passed - [x] 集成测试通过 / ST passed - [x] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [x] 代码符合规范 / Code follows style guide - [x] 测试添加并通过 / Tests added and passed - [x] 文档已更新 / Docs updated if needed - [x] 无硬编码敏感信息 / No secrets hardcoded - [x] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!45 | 1 个月前 | |
feat: migrate latest FlashKDA and fused_recurrent_kda Co-authored-by: chuqihang<chuqihang@huawei.com> # message auto-generated for no-merge-commit merge: !55 merge flashkda-migration into master feat: migrate latest FlashKDA and fused_recurrent_kda Created-by: chuqihang Commit-by: chuqihang 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!55 | 1 个月前 | |
update_matmul_sample Co-authored-by: chen-shuai<chenshuai96@huawei.com> # message auto-generated for no-merge-commit merge: !45 merge update_matmul_sample into master update_matmul_sample Created-by: chen-shuai Commit-by: chen-shuai Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [] 否 [√] 是 __1. AI Agent 平台: cannbot __2. AI 模型: GLM5.3 __3. Prompt上下文 : ### PR功能描述 / 为什么需要这个合入**: <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> 本 PR 完善 Matmul 类算子样例,新增 GroupedMatmul 和 MXFP8 QBMM,并调整 Matmul 目录结构,使不同场景的实现、文档和测试能够独立维护。 主要改动: - 新增 GroupedMatmul 样例,支持 group_type=-1/0/2、group_list_type=0/1 和 split_item=0/1/2/3。 - GroupedMatmul 覆盖 S1~S6 输入组织方式,支持单/多 Tensor、M 轴分组、K 轴分组,以及显式或隐式 group_list。 - GroupedMatmul Kernel 按各 Group 的真实 M/K 边界计算,Host 侧不执行 cat/stack/contiguous 或补齐。 - GroupedMatmul 使用自适应滑动窗口多核调度、跨 Group 负载均衡和 L2 Cache 控制。 - 新增 MXFP8 QBMM 样例,A/B 支持 float8_e4m3fn、float8_e5m2,ScaleA/ScaleB 使用公开三维 E8M0 paired-scale 布局。 - MXFP8 QBMM 支持四种 transposeA/transposeB 组合、M/N/K 尾块、Bias,以及 FP16/BF16/FP32 输出。 - MXFP8 Host Tiling 根据 Shape 和片上存储容量选择 baseM/baseN/baseK、kL1/scaleKL1 与 Buffer 深度。 - MXFP8 Kernel 支持 ASW 多核调度、AL1_FULL_LOAD、L1/L0 Ping-Pong、L0C Ping-Pong、UnitFlag 和 L2 Cache 控制。 - MXFP8 Torch 接口的参数顺序与 torch_npu.npu_quant_matmul 保持一致。 - 将非量化 Matmul 移入 samples/matmul/matmul,MXFP8 QBMM 放入 samples/matmul/quant_matmul。 - 同步调整测试目录和引用路径,并补充非对齐 Shape 的精度覆盖。 - 为 GroupedMatmul、Matmul 和 MXFP8 QBMM 补充 README、使用示例、精度测试和性能对比图。 ### 该PR关联的issue 无 ### 希望检视人员了解: - Device Kernel 面向 NPU ARCH 3510(Ascend 950PR / Ascend 950DT)。 - GroupedMatmul 请重点检视 S1~S6 输入映射、group_list 语义和跨 Group 多核调度。 - MXFP8 QBMM 请重点检视四种转置的数据与 Scale 布局、尾块 actual shape、kL1/scaleKL1 流水和 AL1_FULL_LOAD。 - samples/matmul/README.md 的删除属于目录拆分,内容已迁移到对应子目录。 ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [x] 新功能 / New Feature - [x] 性能优化 / Performance - [x] 代码重构 / Refactoring - [x] 文档更新 / Documentation - [x] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [x] 单元测试通过 / UT passed - [x] 集成测试通过 / ST passed - [x] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [x] 代码符合规范 / Code follows style guide - [x] 测试添加并通过 / Tests added and passed - [x] 文档已更新 / Docs updated if needed - [x] 无硬编码敏感信息 / No secrets hardcoded - [x] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!45 | 1 个月前 | |
feat: migrate latest FlashKDA and fused_recurrent_kda Co-authored-by: chuqihang<chuqihang@huawei.com> # message auto-generated for no-merge-commit merge: !55 merge flashkda-migration into master feat: migrate latest FlashKDA and fused_recurrent_kda Created-by: chuqihang Commit-by: chuqihang 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!55 | 1 个月前 | |
文档站点搭建 & api文档模板 Co-authored-by: taomengyuan-hw<taomengyuan3@huawei.com> # message auto-generated for no-merge-commit merge: !57 merge master into master 文档站点搭建 & api文档模板 Created-by: taomengyuan-hw Commit-by: taomengyuan-hw 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!57 | 1 个月前 | |
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 个月前 | |
docs: 更新 CHANGELOG 与 README,补充 FlashKDA 迁移相关算子 Co-authored-by: ZacharyX<xiongzhiqiang3@hisilicon.com> # message auto-generated for no-merge-commit merge: !62 merge docs/changelog-sync into master docs: 更新 CHANGELOG 与 README,补充 FlashKDA 迁移相关算子 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!62 | 1 个月前 | |
| 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 个月前 | |
docs: 更新 CHANGELOG 与 README,补充 FlashKDA 迁移相关算子 Co-authored-by: ZacharyX<xiongzhiqiang3@hisilicon.com> # message auto-generated for no-merge-commit merge: !62 merge docs/changelog-sync into master docs: 更新 CHANGELOG 与 README,补充 FlashKDA 迁移相关算子 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!62 | 1 个月前 | |
fix: adapt samples to cannbotdsl 0.0.3 Co-authored-by: liqingsong16<liqingsong16@huawei.com> # message auto-generated for no-merge-commit merge: !43 merge fix/ci-cannbotdsl-0.0.3 into master fix: adapt samples to cannbotdsl 0.0.3 Created-by: liqingsong16 Commit-by: liqingsong16 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!43 | 1 个月前 | |
ci: remove user-specific wheel cache path Co-authored-by: liqingsong16<liqingsong16@huawei.com> # message auto-generated for no-merge-commit merge: !50 merge ci/remove-user-cache-path into master ci: remove user-specific wheel cache path Created-by: liqingsong16 Commit-by: liqingsong16 Merged-by: cann-robot Description: <!-- 感谢您的合入申请! --> ### 当前PR是否有AI参与: [ ] 否 [x] 是 __1. AI Agent 平台: Codex __2. AI 模型: GPT-5 __3. Prompt上下文: 检查并移除 install_deps.sh 中与个人账号绑定的 wheel 缓存路径。 ### PR功能描述 / 为什么需要这个合入**: install_deps.sh 的 wheel 搜索路径中同时包含当前用户的 $HOME/.cache/cannbot-bootstrap 和一个固定用户目录。固定目录不可移植,并且在对应账号下与 $HOME 路径重复。 本 PR 仅删除该固定用户目录,保留以下通用搜索入口: - ${CANNBOTDSL_WHEEL_ROOT:-/opt/cannbot-dsl}:CI/平台预置 wheel 的主要目录。 - ${HOME:-}/.cache/cannbot-bootstrap:跟随实际运行账号的用户缓存目录。 因此依赖安装顺序和有效搜索位置不变,不再把仓库绑定到个人工号。 ### 该PR关联的issue N/A ### 希望检视人员了解: - 仅修改 install_deps.sh 一行,不涉及版本、API、算子或工作流逻辑。 - 在原账号环境下,${HOME}/.cache/cannbot-bootstrap 仍解析到原缓存目录。 - 若 CI 使用其他账号,缓存路径会自动跟随该账号的 $HOME。 ## 改动类型 / Change Type - [x] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 测试信息 / Testing - [x] bash -n install_deps.sh 通过。 - [x] 使用 HOME=/home/<user> 验证通用缓存路径解析正确。 - [x] git diff --check 通过。 - [x] GitCode Push Hooks 通过。 - [ ] 上游 CPU/NPU CI:创建 PR 后验证。 ## 检查清单 / Checklist - [x] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [x] 文档已更新 / Docs updated if needed - [x] 无硬编码敏感信息 / No secrets hardcoded - [x] 提交信息符合规范 / Commit message follows convention See merge request: cann/cannbot-dsl!50 | 1 个月前 | |
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 |
| flash_kda_metadata | FlashKDA 调度 metadata 生成(AICPU) | samples/flash_kda_metadata |
| fused_recurrent_kda_snapshot | Kimi Delta Attention decode(1~8 token,状态快照) | samples/fused_recurrent_kda_snapshot |
| 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/matmul |
| quant_batch_matmul_mxfp8 | C[M,N]=Dequant(A)[M,K]@Dequant(B)[N,K]TC[M,N] = Dequant(A)[M,K] @ Dequant(B)[N,K]^TC[M,N]=Dequant(A)[M,K]@Dequant(B)[N,K]T | samples/matmul/quant_matmul |
| grouped_matmul | yi[mi,ni]=xi[mi,ki]×weighti[ki,ni]y_i[m_i,n_i] = x_i[m_i,k_i] \times weight_i[k_i,n_i]yi[mi,ni]=xi[mi,ki]×weighti[ki,ni] | samples/grouped_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 |
| kv_compress_epilog | KV Cache 压缩、量化与按槽位原地更新 | samples/kv_compress_epilog |
目录结构
├── samples/ # 算子实现与使用说明
│ ├── voxel_conv/ # VoxelConv 卷积
│ ├── flash_attn/ # Flash Attention
│ ├── flash_kda/ # Kimi Delta Attention
│ ├── flash_kda_metadata/ # FlashKDA 调度 metadata(AICPU)
│ ├── fused_recurrent_kda_snapshot/ # KDA decode 状态快照
│ ├── matmul/ # 矩阵乘
│ │ ├── matmul/ # 非量化矩阵乘
│ │ └── quant_matmul/ # MXFP8 全量化矩阵乘
│ ├── grouped_matmul/ # 非量化分组矩阵乘
│ ├── pointnet_sa/ # PointNet Set Abstraction
│ ├── rms_norm/ # RmsNorm 归一化
│ └── kv_compress_epilog/ # KV Cache 压缩更新
├── test/ # 测试
│ ├── voxel_conv/
│ ├── flash_attn/
│ ├── flash_kda/
│ ├── flash_kda_metadata/
│ ├── fused_recurrent_kda_snapshot/
│ ├── matmul/
│ │ ├── matmul/
│ │ └── quant_matmul/
│ ├── grouped_matmul/
│ ├── pointnet_sa/
│ ├── rms_norm/
│ └── kv_compress_epilog/
├── figures/
└── README.md
🔥 最新动态
最新更新与历史记录详见 CHANGELOG.md。
相关信息
- 许可证
- 源文件头部包含完整的版权与许可声明,遵循 CANN Open Software License Agreement Version 2.0