| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(index): add SparseSegmentMean AICPU op Co-authored-by: zhaowenrui666<zhaowenrui7@huawei.com> # message auto-generated for no-merge-commit merge: !7587 merge sparse_segment_mean_aicpu into master feat(index): add SparseSegmentMean AICPU op Created-by: zhaowenrui666 Commit-by: zhaowenrui666 Merged-by: cann-robot Description: ## 描述 迁移 SparseSegmentMean AICPU 算子到 ops-nn/index 目录,补齐自定义 AICPU 构建、注册、UT、GEIR example 和 README 文档。 主要改动: - 新增 index/sparse_segment_mean/op_kernel_aicpu,包含 AICPU kernel、头文件、AICPU OpDef 和 CMakeLists.txt。 - 新增 index/sparse_segment_mean/tests/ut/op_kernel_aicpu/test_sparse_segment_mean.cpp,覆盖 float/double/float16、int32/int64 indices 和异常场景。 - 新增 index/sparse_segment_mean/examples/test_geir_sparse_segment_mean.cpp,验证图模式 cust 调用链路。 - 新增 index/sparse_segment_mean/README.md,并更新 docs/zh/op_list.md。 ## 关联的Issue 暂无。 ## 测试 已完成以下验证: - pre-commit run --files docs/zh/op_list.md index/sparse_segment_mean/README.md index/sparse_segment_mean/examples/test_geir_sparse_segment_mean.cpp index/sparse_segment_mean/op_kernel_aicpu/CMakeLists.txt index/sparse_segment_mean/op_kernel_aicpu/sparse_segment_mean_aicpu.cpp index/sparse_segment_mean/op_kernel_aicpu/sparse_segment_mean_aicpu.h index/sparse_segment_mean/op_kernel_aicpu/sparse_segment_mean_aicpu_def.cpp index/sparse_segment_mean/tests/ut/op_kernel_aicpu/test_sparse_segment_mean.cpp - bash build.sh -u --opkernel_aicpu --ops=sparse_segment_mean - bash build.sh --pkg --soc=ascend910b --ops=sparse_segment_mean - bash build.sh --run_example sparse_segment_mean graph cust ## 文档更新 - 新增 index/sparse_segment_mean/README.md。 - 更新 docs/zh/op_list.md,补充 sparse_segment_mean 的 AI Core/AI CPU 支持信息。 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!7587 | 1 个月前 | |
format cpp Co-authored-by: yang-di52<yangdi52@huawei.com> # message auto-generated for no-merge-commit merge: !6784 merge issue_fix into master format cpp Created-by: yang-di52 Commit-by: yang-di52 Merged-by: cann-robot Description: ## 描述 批量刷新cpp代码格式 ## 关联的Issue [#3791](https://gitcode.com/cann/ops-nn/issues/3791) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:代码格式化 ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!6784 | 2 个月前 | |
优化sparse_segment_mean分核策略 Co-authored-by: 张鑫<zhangxin660@h-partners.com> # message auto-generated for no-merge-commit merge: !5533 merge ssm_simd_modify into master 优化sparse_segment_mean分核策略 Created-by: z30075199 Commit-by: 张鑫 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 优化sparse_segment_mean分核策略 row上的核尽可能少(每个核处理尽可能多的索引),同时,col上的每个核处理的数据块根据segment_id重复度不能小于min(4k/8K/9K, innerSize) ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/ops-nn/issues/3889 ## 测试 <!--描述进行了哪些测试来验证你的改动。--> 泛化用例500条,平均性能提升25% ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-nn!5533 | 2 个月前 | |
format cpp Co-authored-by: yang-di52<yangdi52@huawei.com> # message auto-generated for no-merge-commit merge: !6784 merge issue_fix into master format cpp Created-by: yang-di52 Commit-by: yang-di52 Merged-by: cann-robot Description: ## 描述 批量刷新cpp代码格式 ## 关联的Issue [#3791](https://gitcode.com/cann/ops-nn/issues/3791) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:代码格式化 ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!6784 | 2 个月前 | |
feat(index): add SparseSegmentMean AICPU op Co-authored-by: zhaowenrui666<zhaowenrui7@huawei.com> # message auto-generated for no-merge-commit merge: !7587 merge sparse_segment_mean_aicpu into master feat(index): add SparseSegmentMean AICPU op Created-by: zhaowenrui666 Commit-by: zhaowenrui666 Merged-by: cann-robot Description: ## 描述 迁移 SparseSegmentMean AICPU 算子到 ops-nn/index 目录,补齐自定义 AICPU 构建、注册、UT、GEIR example 和 README 文档。 主要改动: - 新增 index/sparse_segment_mean/op_kernel_aicpu,包含 AICPU kernel、头文件、AICPU OpDef 和 CMakeLists.txt。 - 新增 index/sparse_segment_mean/tests/ut/op_kernel_aicpu/test_sparse_segment_mean.cpp,覆盖 float/double/float16、int32/int64 indices 和异常场景。 - 新增 index/sparse_segment_mean/examples/test_geir_sparse_segment_mean.cpp,验证图模式 cust 调用链路。 - 新增 index/sparse_segment_mean/README.md,并更新 docs/zh/op_list.md。 ## 关联的Issue 暂无。 ## 测试 已完成以下验证: - pre-commit run --files docs/zh/op_list.md index/sparse_segment_mean/README.md index/sparse_segment_mean/examples/test_geir_sparse_segment_mean.cpp index/sparse_segment_mean/op_kernel_aicpu/CMakeLists.txt index/sparse_segment_mean/op_kernel_aicpu/sparse_segment_mean_aicpu.cpp index/sparse_segment_mean/op_kernel_aicpu/sparse_segment_mean_aicpu.h index/sparse_segment_mean/op_kernel_aicpu/sparse_segment_mean_aicpu_def.cpp index/sparse_segment_mean/tests/ut/op_kernel_aicpu/test_sparse_segment_mean.cpp - bash build.sh -u --opkernel_aicpu --ops=sparse_segment_mean - bash build.sh --pkg --soc=ascend910b --ops=sparse_segment_mean - bash build.sh --run_example sparse_segment_mean graph cust ## 文档更新 - 新增 index/sparse_segment_mean/README.md。 - 更新 docs/zh/op_list.md,补充 sparse_segment_mean 的 AI Core/AI CPU 支持信息。 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!7587 | 1 个月前 | |
feat(index): add SparseSegmentMean AICPU op Co-authored-by: zhaowenrui666<zhaowenrui7@huawei.com> # message auto-generated for no-merge-commit merge: !7587 merge sparse_segment_mean_aicpu into master feat(index): add SparseSegmentMean AICPU op Created-by: zhaowenrui666 Commit-by: zhaowenrui666 Merged-by: cann-robot Description: ## 描述 迁移 SparseSegmentMean AICPU 算子到 ops-nn/index 目录,补齐自定义 AICPU 构建、注册、UT、GEIR example 和 README 文档。 主要改动: - 新增 index/sparse_segment_mean/op_kernel_aicpu,包含 AICPU kernel、头文件、AICPU OpDef 和 CMakeLists.txt。 - 新增 index/sparse_segment_mean/tests/ut/op_kernel_aicpu/test_sparse_segment_mean.cpp,覆盖 float/double/float16、int32/int64 indices 和异常场景。 - 新增 index/sparse_segment_mean/examples/test_geir_sparse_segment_mean.cpp,验证图模式 cust 调用链路。 - 新增 index/sparse_segment_mean/README.md,并更新 docs/zh/op_list.md。 ## 关联的Issue 暂无。 ## 测试 已完成以下验证: - pre-commit run --files docs/zh/op_list.md index/sparse_segment_mean/README.md index/sparse_segment_mean/examples/test_geir_sparse_segment_mean.cpp index/sparse_segment_mean/op_kernel_aicpu/CMakeLists.txt index/sparse_segment_mean/op_kernel_aicpu/sparse_segment_mean_aicpu.cpp index/sparse_segment_mean/op_kernel_aicpu/sparse_segment_mean_aicpu.h index/sparse_segment_mean/op_kernel_aicpu/sparse_segment_mean_aicpu_def.cpp index/sparse_segment_mean/tests/ut/op_kernel_aicpu/test_sparse_segment_mean.cpp - bash build.sh -u --opkernel_aicpu --ops=sparse_segment_mean - bash build.sh --pkg --soc=ascend910b --ops=sparse_segment_mean - bash build.sh --run_example sparse_segment_mean graph cust ## 文档更新 - 新增 index/sparse_segment_mean/README.md。 - 更新 docs/zh/op_list.md,补充 sparse_segment_mean 的 AI Core/AI CPU 支持信息。 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!7587 | 1 个月前 | |
sparse_segment_mean和concat_offset算子支持Ascend950 Co-authored-by: 张鑫<zhangxin660@h-partners.com> # message auto-generated for no-merge-commit merge: !2328 merge move_nn_dst into master sparse_segment_mean和concat_offset算子支持Ascend950 Created-by: z30075199 Commit-by: 张鑫 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> **sparse_segment_mean和concat_offset算子支持Ascend950** concat_offset:计算concat的输入在其输出中的偏移量 <table style="undefined;table-layout: fixed; width: 1479px"><colgroup> <col style="width: 163px"> <col style="width: 180px"> <col style="width: 240px"> <col style="width: 200px"> <col style="width: 197px"> <col style="width: 114px"> <col style="width: 156px"> <col style="width: 145px"> </colgroup> <thead> <tr> <th>参数名</th> <th>输入/输出/属性</th> <th>描述</th> <th>数据类型</th> <th>数据格式</th> </tr></thead> <tbody> <tr> <td>concat_dim</td> <td>输入</td> <td>输入aclTensor</td> <td>INT32</td> <td>ND</td> </tr> <tr> <td>x</td> <td>输入</td> <td>输入TensorList</td> <td>INT32</td> <td>ND</td> </tr> <tr> <td>N</td> <td>属性</td> <td>输入Tensor的个数</td> <td>INT</td> <td>-</td> </tr> <tr> <td>y</td> <td>输出</td> <td>输出TensorList</td> <td>INT32</td> <td>ND</td> </tr> </tbody></table> sparse_segment_mean:计算张量稀疏片段的均值 <table style="undefined;table-layout: fixed; width: 1479px"><colgroup> <col style="width: 163px"> <col style="width: 180px"> <col style="width: 240px"> <col style="width: 200px"> <col style="width: 197px"> <col style="width: 114px"> <col style="width: 156px"> <col style="width: 145px"> </colgroup> <thead> <tr> <th>参数名</th> <th>输入/输出</th> <th>描述</th> <th>数据类型</th> <th>数据格式</th> </tr></thead> <tbody> <tr> <td>x</td> <td>输入</td> <td>输入aclTensor</td> <td>FLOAT, DOUBLE, FLOAT16, BFLOAT16</td> <td>ND</td> </tr> <tr> <td>indices</td> <td>输入</td> <td>输入aclTensor</td> <td>INT32, INT64</td> <td>ND</td> </tr> <tr> <td>segment_ids</td> <td>输入</td> <td>输入aclTensor</td> <td>INT32, INT64</td> <td>ND</td> </tr> <tr> <td>y</td> <td>输出</td> <td>输出aclTensor</td> <td>FLOAT, DOUBLE, FLOAT16, BFLOAT16</td> <td>ND</td> </tr> </tbody></table> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/ops-nn/issues/1558 ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-nn!2328 | 5 个月前 | |
feat(index): add SparseSegmentMean AICPU op Co-authored-by: zhaowenrui666<zhaowenrui7@huawei.com> # message auto-generated for no-merge-commit merge: !7587 merge sparse_segment_mean_aicpu into master feat(index): add SparseSegmentMean AICPU op Created-by: zhaowenrui666 Commit-by: zhaowenrui666 Merged-by: cann-robot Description: ## 描述 迁移 SparseSegmentMean AICPU 算子到 ops-nn/index 目录,补齐自定义 AICPU 构建、注册、UT、GEIR example 和 README 文档。 主要改动: - 新增 index/sparse_segment_mean/op_kernel_aicpu,包含 AICPU kernel、头文件、AICPU OpDef 和 CMakeLists.txt。 - 新增 index/sparse_segment_mean/tests/ut/op_kernel_aicpu/test_sparse_segment_mean.cpp,覆盖 float/double/float16、int32/int64 indices 和异常场景。 - 新增 index/sparse_segment_mean/examples/test_geir_sparse_segment_mean.cpp,验证图模式 cust 调用链路。 - 新增 index/sparse_segment_mean/README.md,并更新 docs/zh/op_list.md。 ## 关联的Issue 暂无。 ## 测试 已完成以下验证: - pre-commit run --files docs/zh/op_list.md index/sparse_segment_mean/README.md index/sparse_segment_mean/examples/test_geir_sparse_segment_mean.cpp index/sparse_segment_mean/op_kernel_aicpu/CMakeLists.txt index/sparse_segment_mean/op_kernel_aicpu/sparse_segment_mean_aicpu.cpp index/sparse_segment_mean/op_kernel_aicpu/sparse_segment_mean_aicpu.h index/sparse_segment_mean/op_kernel_aicpu/sparse_segment_mean_aicpu_def.cpp index/sparse_segment_mean/tests/ut/op_kernel_aicpu/test_sparse_segment_mean.cpp - bash build.sh -u --opkernel_aicpu --ops=sparse_segment_mean - bash build.sh --pkg --soc=ascend910b --ops=sparse_segment_mean - bash build.sh --run_example sparse_segment_mean graph cust ## 文档更新 - 新增 index/sparse_segment_mean/README.md。 - 更新 docs/zh/op_list.md,补充 sparse_segment_mean 的 AI Core/AI CPU 支持信息。 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!7587 | 1 个月前 |
SparseSegmentMean
产品支持情况
| 产品 | 是否支持 |
|---|---|
| Ascend 950PR/Ascend 950DT | √ |
| Atlas A3 训练系列产品/Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品/Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | × |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
功能说明
- 算子功能:根据
indices和有序的segment_ids从x中选取若干行,并对同一个 segment 内的行按第0维求平均。
参数说明
| 参数名 | 输入/输出/属性 | 描述 | 数据类型 | 数据格式 |
|---|---|---|---|---|
x |
输入 | 输入张量,rank至少为1。 | FLOAT、DOUBLE、FLOAT16 | ND |
indices |
输入 | 一维张量,表示从x第0维选取的行索引。 |
INT32、INT64 | ND |
segment_ids |
输入 | 一维张量,元素个数与indices一致,值必须非负且按非递减顺序排列。 |
INT32、INT64 | ND |
y |
输出 | 输出张量,数据类型与x一致,第0维大小为segment_ids最后一个元素加1,其余维度与x一致。 |
FLOAT、DOUBLE、FLOAT16 | ND |
约束说明
x、indices、segment_ids不能为空张量。x的rank必须大于等于1。indices与segment_ids元素个数必须一致。indices中的值必须小于x第0维大小。segment_ids必须非负且按非递减顺序排列。x和y的数据类型必须一致。- 本算子支持AI CPU实现,AI CPU实现支持FLOAT、DOUBLE、FLOAT16。
调用说明
| 调用方式 | 调用样例 | 说明 |
|---|---|---|
| 图模式调用 | test_geir_sparse_segment_mean | 通过算子IR构图方式调用SparseSegmentMean算子。 |