| 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 个月前 |