| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(index): add SparseFillEmptyRows AICPU op Co-authored-by: zhaowenrui666<zhaowenrui7@huawei.com> # message auto-generated for no-merge-commit merge: !7571 merge sparse_fill_empty_rows into master feat(index): add SparseFillEmptyRows AICPU op Created-by: zhaowenrui666 Commit-by: zhaowenrui666 Merged-by: cann-robot Description: ## 描述 将 canndev 中的 SparseFillEmptyRows 作为 AICPU 算子迁移到 ops-nn/index/sparse_fill_empty_rows。 主要改动: - 新增 SparseFillEmptyRows AICPU kernel 实现,保持 canndev 核心语义:统计每行元素数,对空行补 [row, 0, ...] = default_value,生成 empty_row_indicator 和 reverse_index_map。 - 新增 AICPU OpDef、op_graph proto、GEIR graph example 和 AICPU UT。 - 新增算子 README,说明输入输出、空行补齐规则、dtype 支持和约束。 - 更新 docs/zh/op_list.md,将 sparse_fill_empty_rows 加入 index 分类。 本轮未新增 aclnn/op_api;canndev 中未检索到 aclnnSparseFillEmptyRows 或对应两段式接口实现。 ## 关联的Issue 无。 ## 测试 已执行: bash pre-commit run --files docs/zh/op_list.md index/sparse_fill_empty_rows/CMakeLists.txt index/sparse_fill_empty_rows/README.md index/sparse_fill_empty_rows/examples/test_geir_sparse_fill_empty_rows.cpp index/sparse_fill_empty_rows/op_graph/CMakeLists.txt index/sparse_fill_empty_rows/op_graph/sparse_fill_empty_rows_proto.h index/sparse_fill_empty_rows/op_kernel_aicpu/CMakeLists.txt index/sparse_fill_empty_rows/op_kernel_aicpu/sparse_fill_empty_rows_aicpu.cpp index/sparse_fill_empty_rows/op_kernel_aicpu/sparse_fill_empty_rows_aicpu.h index/sparse_fill_empty_rows/op_kernel_aicpu/sparse_fill_empty_rows_aicpu_def.cpp index/sparse_fill_empty_rows/tests/CMakeLists.txt index/sparse_fill_empty_rows/tests/ut/CMakeLists.txt index/sparse_fill_empty_rows/tests/ut/op_kernel_aicpu/test_sparse_fill_empty_rows.cpp 结果:通过。 已执行 AICPU UT: bash bash build.sh --opkernel_aicpu_test --ops=sparse_fill_empty_rows -j8 结果:33 个 TEST_SPARSE_FILL_EMPTY_ROWS_UT 用例通过。 已执行自定义包和 GEIR example 验证: bash bash build.sh --pkg --ops=sparse_fill_empty_rows --vendor_name=sfer -j8 ./build_out/cann-ops-nn-sfer_linux-aarch64.run export ASCEND_CUSTOM_OPP_PATH=/home/developer/Ascend/cann-9.0.0/opp/vendors/sfer_nn export LD_LIBRARY_PATH=/home/developer/Ascend/cann-9.0.0/opp/vendors/sfer_nn/op_api/lib:${LD_LIBRARY_PATH} export ASCEND_GLOBAL_LOG_LEVEL=0 bash build.sh --run_example sparse_fill_empty_rows graph 结果:通过。日志确认走到自定义 AICPU kernel:RunCpuKernel[SparseFillEmptyRows] 出现在 aicpu_custom_scheduler 路径下。 ## 文档更新 - 新增 index/sparse_fill_empty_rows/README.md。 - 更新 docs/zh/op_list.md。 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!7571 | 1 个月前 | |
SparseFillEmptyRows RT2 infershape 迁移 Co-authored-by: zhaowenrui666<zhaowenrui7@huawei.com> # message auto-generated for no-merge-commit merge: !8003 merge sparse_fill_empty_rows_rt2_infershape into master SparseFillEmptyRows RT2 infershape 迁移 Created-by: zhaowenrui666 Commit-by: zhaowenrui666 Merged-by: cann-robot Description: ### 修改内容 - 新增 SparseFillEmptyRows RT2 InferShapeRange。 - 输出 shape range 语义对齐 canndev RT2 实现。 - 增加 op_host infershape UT 覆盖 dense_shape 常量输入场景。 ### 依据 - canndev: ops/built-in/op_proto/runtime/sparse_fill_empty_rows_infer.cc ### 验证 - git diff --check - bash build.sh -u --ophost --ops=sparse_fill_empty_rows --noexec -j8 - pre-commit 已在提交时通过 See merge request: cann/ops-nn!8003 | 20 天前 | |
SparseFillEmptyRows RT2 infershape 迁移 Co-authored-by: zhaowenrui666<zhaowenrui7@huawei.com> # message auto-generated for no-merge-commit merge: !8003 merge sparse_fill_empty_rows_rt2_infershape into master SparseFillEmptyRows RT2 infershape 迁移 Created-by: zhaowenrui666 Commit-by: zhaowenrui666 Merged-by: cann-robot Description: ### 修改内容 - 新增 SparseFillEmptyRows RT2 InferShapeRange。 - 输出 shape range 语义对齐 canndev RT2 实现。 - 增加 op_host infershape UT 覆盖 dense_shape 常量输入场景。 ### 依据 - canndev: ops/built-in/op_proto/runtime/sparse_fill_empty_rows_infer.cc ### 验证 - git diff --check - bash build.sh -u --ophost --ops=sparse_fill_empty_rows --noexec -j8 - pre-commit 已在提交时通过 See merge request: cann/ops-nn!8003 | 20 天前 | |
feat(index): add SparseFillEmptyRows AICPU op Co-authored-by: zhaowenrui666<zhaowenrui7@huawei.com> # message auto-generated for no-merge-commit merge: !7571 merge sparse_fill_empty_rows into master feat(index): add SparseFillEmptyRows AICPU op Created-by: zhaowenrui666 Commit-by: zhaowenrui666 Merged-by: cann-robot Description: ## 描述 将 canndev 中的 SparseFillEmptyRows 作为 AICPU 算子迁移到 ops-nn/index/sparse_fill_empty_rows。 主要改动: - 新增 SparseFillEmptyRows AICPU kernel 实现,保持 canndev 核心语义:统计每行元素数,对空行补 [row, 0, ...] = default_value,生成 empty_row_indicator 和 reverse_index_map。 - 新增 AICPU OpDef、op_graph proto、GEIR graph example 和 AICPU UT。 - 新增算子 README,说明输入输出、空行补齐规则、dtype 支持和约束。 - 更新 docs/zh/op_list.md,将 sparse_fill_empty_rows 加入 index 分类。 本轮未新增 aclnn/op_api;canndev 中未检索到 aclnnSparseFillEmptyRows 或对应两段式接口实现。 ## 关联的Issue 无。 ## 测试 已执行: bash pre-commit run --files docs/zh/op_list.md index/sparse_fill_empty_rows/CMakeLists.txt index/sparse_fill_empty_rows/README.md index/sparse_fill_empty_rows/examples/test_geir_sparse_fill_empty_rows.cpp index/sparse_fill_empty_rows/op_graph/CMakeLists.txt index/sparse_fill_empty_rows/op_graph/sparse_fill_empty_rows_proto.h index/sparse_fill_empty_rows/op_kernel_aicpu/CMakeLists.txt index/sparse_fill_empty_rows/op_kernel_aicpu/sparse_fill_empty_rows_aicpu.cpp index/sparse_fill_empty_rows/op_kernel_aicpu/sparse_fill_empty_rows_aicpu.h index/sparse_fill_empty_rows/op_kernel_aicpu/sparse_fill_empty_rows_aicpu_def.cpp index/sparse_fill_empty_rows/tests/CMakeLists.txt index/sparse_fill_empty_rows/tests/ut/CMakeLists.txt index/sparse_fill_empty_rows/tests/ut/op_kernel_aicpu/test_sparse_fill_empty_rows.cpp 结果:通过。 已执行 AICPU UT: bash bash build.sh --opkernel_aicpu_test --ops=sparse_fill_empty_rows -j8 结果:33 个 TEST_SPARSE_FILL_EMPTY_ROWS_UT 用例通过。 已执行自定义包和 GEIR example 验证: bash bash build.sh --pkg --ops=sparse_fill_empty_rows --vendor_name=sfer -j8 ./build_out/cann-ops-nn-sfer_linux-aarch64.run export ASCEND_CUSTOM_OPP_PATH=/home/developer/Ascend/cann-9.0.0/opp/vendors/sfer_nn export LD_LIBRARY_PATH=/home/developer/Ascend/cann-9.0.0/opp/vendors/sfer_nn/op_api/lib:${LD_LIBRARY_PATH} export ASCEND_GLOBAL_LOG_LEVEL=0 bash build.sh --run_example sparse_fill_empty_rows graph 结果:通过。日志确认走到自定义 AICPU kernel:RunCpuKernel[SparseFillEmptyRows] 出现在 aicpu_custom_scheduler 路径下。 ## 文档更新 - 新增 index/sparse_fill_empty_rows/README.md。 - 更新 docs/zh/op_list.md。 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!7571 | 1 个月前 | |
SparseFillEmptyRows RT2 infershape 迁移 Co-authored-by: zhaowenrui666<zhaowenrui7@huawei.com> # message auto-generated for no-merge-commit merge: !8003 merge sparse_fill_empty_rows_rt2_infershape into master SparseFillEmptyRows RT2 infershape 迁移 Created-by: zhaowenrui666 Commit-by: zhaowenrui666 Merged-by: cann-robot Description: ### 修改内容 - 新增 SparseFillEmptyRows RT2 InferShapeRange。 - 输出 shape range 语义对齐 canndev RT2 实现。 - 增加 op_host infershape UT 覆盖 dense_shape 常量输入场景。 ### 依据 - canndev: ops/built-in/op_proto/runtime/sparse_fill_empty_rows_infer.cc ### 验证 - git diff --check - bash build.sh -u --ophost --ops=sparse_fill_empty_rows --noexec -j8 - pre-commit 已在提交时通过 See merge request: cann/ops-nn!8003 | 20 天前 | |
feat(index): add SparseFillEmptyRows AICPU op Co-authored-by: zhaowenrui666<zhaowenrui7@huawei.com> # message auto-generated for no-merge-commit merge: !7571 merge sparse_fill_empty_rows into master feat(index): add SparseFillEmptyRows AICPU op Created-by: zhaowenrui666 Commit-by: zhaowenrui666 Merged-by: cann-robot Description: ## 描述 将 canndev 中的 SparseFillEmptyRows 作为 AICPU 算子迁移到 ops-nn/index/sparse_fill_empty_rows。 主要改动: - 新增 SparseFillEmptyRows AICPU kernel 实现,保持 canndev 核心语义:统计每行元素数,对空行补 [row, 0, ...] = default_value,生成 empty_row_indicator 和 reverse_index_map。 - 新增 AICPU OpDef、op_graph proto、GEIR graph example 和 AICPU UT。 - 新增算子 README,说明输入输出、空行补齐规则、dtype 支持和约束。 - 更新 docs/zh/op_list.md,将 sparse_fill_empty_rows 加入 index 分类。 本轮未新增 aclnn/op_api;canndev 中未检索到 aclnnSparseFillEmptyRows 或对应两段式接口实现。 ## 关联的Issue 无。 ## 测试 已执行: bash pre-commit run --files docs/zh/op_list.md index/sparse_fill_empty_rows/CMakeLists.txt index/sparse_fill_empty_rows/README.md index/sparse_fill_empty_rows/examples/test_geir_sparse_fill_empty_rows.cpp index/sparse_fill_empty_rows/op_graph/CMakeLists.txt index/sparse_fill_empty_rows/op_graph/sparse_fill_empty_rows_proto.h index/sparse_fill_empty_rows/op_kernel_aicpu/CMakeLists.txt index/sparse_fill_empty_rows/op_kernel_aicpu/sparse_fill_empty_rows_aicpu.cpp index/sparse_fill_empty_rows/op_kernel_aicpu/sparse_fill_empty_rows_aicpu.h index/sparse_fill_empty_rows/op_kernel_aicpu/sparse_fill_empty_rows_aicpu_def.cpp index/sparse_fill_empty_rows/tests/CMakeLists.txt index/sparse_fill_empty_rows/tests/ut/CMakeLists.txt index/sparse_fill_empty_rows/tests/ut/op_kernel_aicpu/test_sparse_fill_empty_rows.cpp 结果:通过。 已执行 AICPU UT: bash bash build.sh --opkernel_aicpu_test --ops=sparse_fill_empty_rows -j8 结果:33 个 TEST_SPARSE_FILL_EMPTY_ROWS_UT 用例通过。 已执行自定义包和 GEIR example 验证: bash bash build.sh --pkg --ops=sparse_fill_empty_rows --vendor_name=sfer -j8 ./build_out/cann-ops-nn-sfer_linux-aarch64.run export ASCEND_CUSTOM_OPP_PATH=/home/developer/Ascend/cann-9.0.0/opp/vendors/sfer_nn export LD_LIBRARY_PATH=/home/developer/Ascend/cann-9.0.0/opp/vendors/sfer_nn/op_api/lib:${LD_LIBRARY_PATH} export ASCEND_GLOBAL_LOG_LEVEL=0 bash build.sh --run_example sparse_fill_empty_rows graph 结果:通过。日志确认走到自定义 AICPU kernel:RunCpuKernel[SparseFillEmptyRows] 出现在 aicpu_custom_scheduler 路径下。 ## 文档更新 - 新增 index/sparse_fill_empty_rows/README.md。 - 更新 docs/zh/op_list.md。 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!7571 | 1 个月前 | |
feat(index): add SparseFillEmptyRows AICPU op Co-authored-by: zhaowenrui666<zhaowenrui7@huawei.com> # message auto-generated for no-merge-commit merge: !7571 merge sparse_fill_empty_rows into master feat(index): add SparseFillEmptyRows AICPU op Created-by: zhaowenrui666 Commit-by: zhaowenrui666 Merged-by: cann-robot Description: ## 描述 将 canndev 中的 SparseFillEmptyRows 作为 AICPU 算子迁移到 ops-nn/index/sparse_fill_empty_rows。 主要改动: - 新增 SparseFillEmptyRows AICPU kernel 实现,保持 canndev 核心语义:统计每行元素数,对空行补 [row, 0, ...] = default_value,生成 empty_row_indicator 和 reverse_index_map。 - 新增 AICPU OpDef、op_graph proto、GEIR graph example 和 AICPU UT。 - 新增算子 README,说明输入输出、空行补齐规则、dtype 支持和约束。 - 更新 docs/zh/op_list.md,将 sparse_fill_empty_rows 加入 index 分类。 本轮未新增 aclnn/op_api;canndev 中未检索到 aclnnSparseFillEmptyRows 或对应两段式接口实现。 ## 关联的Issue 无。 ## 测试 已执行: bash pre-commit run --files docs/zh/op_list.md index/sparse_fill_empty_rows/CMakeLists.txt index/sparse_fill_empty_rows/README.md index/sparse_fill_empty_rows/examples/test_geir_sparse_fill_empty_rows.cpp index/sparse_fill_empty_rows/op_graph/CMakeLists.txt index/sparse_fill_empty_rows/op_graph/sparse_fill_empty_rows_proto.h index/sparse_fill_empty_rows/op_kernel_aicpu/CMakeLists.txt index/sparse_fill_empty_rows/op_kernel_aicpu/sparse_fill_empty_rows_aicpu.cpp index/sparse_fill_empty_rows/op_kernel_aicpu/sparse_fill_empty_rows_aicpu.h index/sparse_fill_empty_rows/op_kernel_aicpu/sparse_fill_empty_rows_aicpu_def.cpp index/sparse_fill_empty_rows/tests/CMakeLists.txt index/sparse_fill_empty_rows/tests/ut/CMakeLists.txt index/sparse_fill_empty_rows/tests/ut/op_kernel_aicpu/test_sparse_fill_empty_rows.cpp 结果:通过。 已执行 AICPU UT: bash bash build.sh --opkernel_aicpu_test --ops=sparse_fill_empty_rows -j8 结果:33 个 TEST_SPARSE_FILL_EMPTY_ROWS_UT 用例通过。 已执行自定义包和 GEIR example 验证: bash bash build.sh --pkg --ops=sparse_fill_empty_rows --vendor_name=sfer -j8 ./build_out/cann-ops-nn-sfer_linux-aarch64.run export ASCEND_CUSTOM_OPP_PATH=/home/developer/Ascend/cann-9.0.0/opp/vendors/sfer_nn export LD_LIBRARY_PATH=/home/developer/Ascend/cann-9.0.0/opp/vendors/sfer_nn/op_api/lib:${LD_LIBRARY_PATH} export ASCEND_GLOBAL_LOG_LEVEL=0 bash build.sh --run_example sparse_fill_empty_rows graph 结果:通过。日志确认走到自定义 AICPU kernel:RunCpuKernel[SparseFillEmptyRows] 出现在 aicpu_custom_scheduler 路径下。 ## 文档更新 - 新增 index/sparse_fill_empty_rows/README.md。 - 更新 docs/zh/op_list.md。 ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!7571 | 1 个月前 |
SparseFillEmptyRows
产品支持情况
| 产品 | 是否支持 |
|---|---|
| Ascend 950PR/Ascend 950DT | √ |
| Atlas A3 训练系列产品/Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品/Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | × |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
功能说明
- 算子功能:对稀疏张量的第0维逐行检查,当某一行没有任何非零元素时,在输出稀疏张量中为该行补充一个位置为
[row, 0, ...]、取值为default_value的元素。
参数说明
| 参数名 | 输入/输出/属性 | 描述 | 数据类型 | 数据格式 |
|---|---|---|---|---|
indices |
输入 | 形状为[N, rank]的二维张量,每一行表示一个稀疏元素在 dense tensor 中的坐标。 |
INT64 | ND |
values |
输入 | 形状为[N]的一维张量,表示indices中每个稀疏元素对应的值。 |
BOOL、COMPLEX128、COMPLEX64、DOUBLE、FLOAT、FLOAT16、INT16、INT32、INT64、INT8、UINT16、UINT32、UINT64、UINT8 | ND |
dense_shape |
输入 | 形状为[rank]的一维张量,表示稀疏张量对应 dense tensor 的形状,dense_shape[0]表示行数。 |
INT64 | ND |
default_value |
输入 | 标量张量,表示空行回补时写入y_values的默认值。 |
BOOL、COMPLEX128、COMPLEX64、DOUBLE、FLOAT、FLOAT16、INT16、INT32、INT64、INT8、UINT16、UINT32、UINT64、UINT8 | ND |
y_indices |
输出 | 回补空行后的稀疏索引,形状为[N + empty_row_count, rank]。 |
INT64 | ND |
y_values |
输出 | 回补空行后的稀疏值,形状为[N + empty_row_count],数据类型与values一致。 |
BOOL、COMPLEX128、COMPLEX64、DOUBLE、FLOAT、FLOAT16、INT16、INT32、INT64、INT8、UINT16、UINT32、UINT64、UINT8 | ND |
empty_row_indicator |
输出 | 形状为[dense_shape[0]]的一维布尔张量,true表示对应行在输入稀疏张量中为空。 |
BOOL | ND |
reverse_index_map |
输出 | 形状为[N]的一维张量,reverse_index_map[i]表示输入第i个元素在输出中的位置。 |
INT64 | ND |
约束说明
indices必须是二维张量,第二维大小为rank。values的元素数必须与indices第一维N一致。dense_shape必须是一维张量,元素数为rank。indices[i, 0]必须满足0 <= indices[i, 0] < dense_shape[0]。- 当
dense_shape[0] == 0时,N必须为0。 values、default_value、y_values的数据类型需要保持一致。- 本算子为AI CPU实现。
调用说明
| 调用方式 | 调用样例 | 说明 |
|---|---|---|
| 图模式调用 | test_geir_sparse_fill_empty_rows | 通过算子IR构图方式调用SparseFillEmptyRows算子。 |