| Files | Last commit | Last update |
|---|---|---|
fix(unique): validate output dtype and correct Unique/MaskedScatter docs Co-authored-by: Qianwen Ye<yeqianwen2@huawei.com> # message auto-generated for no-merge-commit merge: !14361 merge codex/fix-unique-masked-scatter-issues into master fix(unique): validate output dtype and correct Unique/MaskedScatter docs Created-by: Annyqw Commit-by: Annyqw;Qianwen Ye Merged-by: cann-robot Description: ## 描述 aclnnUnique/Unique2 未校验 valueOut 的 dtype,允许 COMPLEX64 等输出继续执行并按 self 的类型写入。本次在第一段参数检查中要求 valueOut 与已通过白名单检查的 self 类型一致,不匹配返回 ACLNN_ERR_PARAM_INVALID (161002),校验覆盖空输入早退路径。 同时修正文档中的以下契约问题: - Unique2:删除拒绝非连续 self 的错误码条目并更新 rowspan。 - UniqueDim:修正标量 dim 的格式、维度及非连续字段;补齐 valueOut 的 13 种 dtype。 - InplaceMaskedScatter:明确 source 数量由调用方保证,按广播后的 mask 统计 true,接口不校验该条件(采用 #8176 方案 B);同步 README。 - InplaceMaskedScatter:补充 selfRef/mask/source 的 0-8 维限制及超限错误码说明。 - experimental MaskedScatter:mask dtype 改为仅 BOOL,与 def/tiling 实现对齐。 ## 关联的Issue Fixes #8176 Fixes #7854 Fixes #7855 Fixes #8386 Fixes #8270 Fixes #8318 ## 测试 - bash build.sh -u --opapi --ops=unique --soc=ascend910b -j8:44/44 passed。 - 新增 12 个 dtype 回归用例,覆盖 Unique/Unique2 的 COMPLEX64、COMPLEX128、白名单内但与 self 不一致的 FLOAT 输出,分别覆盖普通输入及空输入。 - 文档参数表静态校验通过;git diff --check 通过。 - 本次验证为 OP API UT,未执行设备侧完整 ST。 ## 文档更新 更新 Unique/Unique2、UniqueDim、InplaceMaskedScatter、experimental MaskedScatter 接口文档及 MaskedScatter README。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他 ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!14361 | 4 days ago | |
refactor(unique): 将全局去重接口迁移到独立目录 Co-authored-by: yourealize<chenzhanxi1@huawei.com> # message auto-generated for no-merge-commit merge: !10273 merge codex/unique-api-independent-dir into master refactor(unique): 将全局去重接口迁移到独立目录 Created-by: yourealize Commit-by: yourealize Merged-by: cann-robot Description: ## 描述 aclnnUnique/Unique2 提供全局去重,当前与连续去重算子 UniqueConsecutive 放在同一目录。将两个接口及其共享实现 unique_common 迁移至独立的 index/unique/op_api,由该模块管理 AI Core 组合路径和 AI CPU 回退依赖。 同步迁移文档、示例、ST 和 UT,补齐独立模块的构建和测试入口,更新接口索引和分类路径。UniqueConsecutive 接口、L0 和 Kernel 保留原目录。15 个迁移文件内容完全不变,不调整接口行为和计算逻辑。 ## 关联的Issue [#5427](https://gitcode.com/cann/ops-nn/issues/5427) ## 测试 - git diff --check 通过。 - 15 个迁移文件与基线 Git blob 哈希一致。 - 迁移旧路径无残留,迁移文档的本地链接及 UT 相对 include 检查通过。 - 已静态核对模块源码收集、头文件导出及 UT 注册入口。 - 本机无可用 CANN 编译环境,未运行编译、UT 或设备测试。 ## 文档更新 新增 index/unique/README.md,迁移 aclnnUnique/Unique2 文档与示例,更新接口菜单及列表。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [x] 其他,请描述:目录结构调整 ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!10273 | 2 months ago | |
fix(unique): validate output dtype and correct Unique/MaskedScatter docs Co-authored-by: Qianwen Ye<yeqianwen2@huawei.com> # message auto-generated for no-merge-commit merge: !14361 merge codex/fix-unique-masked-scatter-issues into master fix(unique): validate output dtype and correct Unique/MaskedScatter docs Created-by: Annyqw Commit-by: Annyqw;Qianwen Ye Merged-by: cann-robot Description: ## 描述 aclnnUnique/Unique2 未校验 valueOut 的 dtype,允许 COMPLEX64 等输出继续执行并按 self 的类型写入。本次在第一段参数检查中要求 valueOut 与已通过白名单检查的 self 类型一致,不匹配返回 ACLNN_ERR_PARAM_INVALID (161002),校验覆盖空输入早退路径。 同时修正文档中的以下契约问题: - Unique2:删除拒绝非连续 self 的错误码条目并更新 rowspan。 - UniqueDim:修正标量 dim 的格式、维度及非连续字段;补齐 valueOut 的 13 种 dtype。 - InplaceMaskedScatter:明确 source 数量由调用方保证,按广播后的 mask 统计 true,接口不校验该条件(采用 #8176 方案 B);同步 README。 - InplaceMaskedScatter:补充 selfRef/mask/source 的 0-8 维限制及超限错误码说明。 - experimental MaskedScatter:mask dtype 改为仅 BOOL,与 def/tiling 实现对齐。 ## 关联的Issue Fixes #8176 Fixes #7854 Fixes #7855 Fixes #8386 Fixes #8270 Fixes #8318 ## 测试 - bash build.sh -u --opapi --ops=unique --soc=ascend910b -j8:44/44 passed。 - 新增 12 个 dtype 回归用例,覆盖 Unique/Unique2 的 COMPLEX64、COMPLEX128、白名单内但与 self 不一致的 FLOAT 输出,分别覆盖普通输入及空输入。 - 文档参数表静态校验通过;git diff --check 通过。 - 本次验证为 OP API UT,未执行设备侧完整 ST。 ## 文档更新 更新 Unique/Unique2、UniqueDim、InplaceMaskedScatter、experimental MaskedScatter 接口文档及 MaskedScatter README。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他 ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!14361 | 4 days ago | |
UniqueSortFusionPass add supported npu archs Co-authored-by: jerry_gd<jerry.luo@huawei.com> # message auto-generated for no-merge-commit merge: !13845 merge unique_sort_fusion_pass into master UniqueSortFusionPass add supported npu archs Created-by: jerry_gd Commit-by: jerry_gd Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> UniqueSortFusionPass融合规则支持Ascend960DT/Ascend960PR ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> https://gitcode.com/cann/ops-nn/issues/8373 ## 测试 <!--描述进行了哪些测试来验证你的改动。--> - 二级冒烟通过 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> 不涉及 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!13845 | 12 days ago | |
fix(unique): validate output dtype and correct Unique/MaskedScatter docs Co-authored-by: Qianwen Ye<yeqianwen2@huawei.com> # message auto-generated for no-merge-commit merge: !14361 merge codex/fix-unique-masked-scatter-issues into master fix(unique): validate output dtype and correct Unique/MaskedScatter docs Created-by: Annyqw Commit-by: Annyqw;Qianwen Ye Merged-by: cann-robot Description: ## 描述 aclnnUnique/Unique2 未校验 valueOut 的 dtype,允许 COMPLEX64 等输出继续执行并按 self 的类型写入。本次在第一段参数检查中要求 valueOut 与已通过白名单检查的 self 类型一致,不匹配返回 ACLNN_ERR_PARAM_INVALID (161002),校验覆盖空输入早退路径。 同时修正文档中的以下契约问题: - Unique2:删除拒绝非连续 self 的错误码条目并更新 rowspan。 - UniqueDim:修正标量 dim 的格式、维度及非连续字段;补齐 valueOut 的 13 种 dtype。 - InplaceMaskedScatter:明确 source 数量由调用方保证,按广播后的 mask 统计 true,接口不校验该条件(采用 #8176 方案 B);同步 README。 - InplaceMaskedScatter:补充 selfRef/mask/source 的 0-8 维限制及超限错误码说明。 - experimental MaskedScatter:mask dtype 改为仅 BOOL,与 def/tiling 实现对齐。 ## 关联的Issue Fixes #8176 Fixes #7854 Fixes #7855 Fixes #8386 Fixes #8270 Fixes #8318 ## 测试 - bash build.sh -u --opapi --ops=unique --soc=ascend910b -j8:44/44 passed。 - 新增 12 个 dtype 回归用例,覆盖 Unique/Unique2 的 COMPLEX64、COMPLEX128、白名单内但与 self 不一致的 FLOAT 输出,分别覆盖普通输入及空输入。 - 文档参数表静态校验通过;git diff --check 通过。 - 本次验证为 OP API UT,未执行设备侧完整 ST。 ## 文档更新 更新 Unique/Unique2、UniqueDim、InplaceMaskedScatter、experimental MaskedScatter 接口文档及 MaskedScatter README。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他 ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!14361 | 4 days ago | |
refactor(unique): 清理冗余测试 CMake 配置 Co-authored-by: yourealize<chenzhanxi1@huawei.com> # message auto-generated for no-merge-commit merge: !10421 merge codex/unique-top-level-cmake-cleanup into master refactor(unique): 清理冗余测试 CMake 配置 Created-by: yourealize Commit-by: yourealize Merged-by: cann-robot Description: ## 描述 PR #10273 将 aclnnUnique/Unique2 迁移到独立目录后,新增检视意见指出:算子顶层配置 CMake 后,tests 目录不需要重复配置。 本 PR 将 index/unique/CMakeLists.txt 切换为 add_all_modules_sources 统一入口,由顶层直接收集生产源码及 tests/ut/op_host 下的 UT 源,并删除 tests 目录下三份冗余 CMakeLists.txt。接口行为和计算逻辑不变。 ## 关联的Issue [#5427](https://gitcode.com/cann/ops-nn/issues/5427) ## 测试 - pre-commit run --from-ref upstream/master --to-ref HEAD:通过。 - bash build.sh -u --opapi --ops=unique --ut_mode=fast -j8:通过。 - Unique/Unique2 OpApi UT:16/16 通过。 - 构建日志确认 test_aclnn_unique.cpp 和 test_aclnn_unique2.cpp 由顶层统一入口正确收集。 ## 文档更新 无文档更新。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:构建配置清理 ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!10421 | 2 months ago | |
refactor(unique): 将全局去重接口迁移到独立目录 Co-authored-by: yourealize<chenzhanxi1@huawei.com> # message auto-generated for no-merge-commit merge: !10273 merge codex/unique-api-independent-dir into master refactor(unique): 将全局去重接口迁移到独立目录 Created-by: yourealize Commit-by: yourealize Merged-by: cann-robot Description: ## 描述 aclnnUnique/Unique2 提供全局去重,当前与连续去重算子 UniqueConsecutive 放在同一目录。将两个接口及其共享实现 unique_common 迁移至独立的 index/unique/op_api,由该模块管理 AI Core 组合路径和 AI CPU 回退依赖。 同步迁移文档、示例、ST 和 UT,补齐独立模块的构建和测试入口,更新接口索引和分类路径。UniqueConsecutive 接口、L0 和 Kernel 保留原目录。15 个迁移文件内容完全不变,不调整接口行为和计算逻辑。 ## 关联的Issue [#5427](https://gitcode.com/cann/ops-nn/issues/5427) ## 测试 - git diff --check 通过。 - 15 个迁移文件与基线 Git blob 哈希一致。 - 迁移旧路径无残留,迁移文档的本地链接及 UT 相对 include 检查通过。 - 已静态核对模块源码收集、头文件导出及 UT 注册入口。 - 本机无可用 CANN 编译环境,未运行编译、UT 或设备测试。 ## 文档更新 新增 index/unique/README.md,迁移 aclnnUnique/Unique2 文档与示例,更新接口菜单及列表。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [x] 其他,请描述:目录结构调整 ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!10273 | 2 months ago | |
docs: add English translations for operator READMEs and repo docs Co-authored-by: jenny_xiang<jenny.xiang@huawei.com> # message auto-generated for no-merge-commit merge: !13351 merge docs/add-english-docs into master docs: add English translations for operator READMEs and repo docs Created-by: jenny_xiang Commit-by: jenny_xiang Merged-by: cann-robot Description: ## Description Add English translations for 652 markdown documents: - Repo-level guides: README_en.md, CONTRIBUTING_en.md, SECURITY_en.md, CHANGELOG_en.md, codearts_check_rule_config_en.md - Operator READMEs under activation/, conv/, control/, foreach/, hash/, index/, loss/, matmul/, norm/, optim/, pooling/, quant/, rnn/, vfusion/, etc. - API and design docs under docs/ (aclnn_*, ascendir_*, fusion pass docs) - examples/ and torch_extension/ guides Note: a few cross-reference links whose English targets are not published yet temporarily point to their Chinese counterparts to keep links valid; they will be switched back to the English docs in a follow-up PR after this one is merged. ## Related Issue N/A ## Test - Verified all 1,344 intra-repo markdown links in the added files resolve against master: 0 broken links, 0 missing targets. ## Documentation Update - This PR only adds English documentation files (*_en.md); no existing Chinese documents are modified. ## Type Labels - [ ] Bug fix - [ ] New feature - [ ] Performance optimization - [x] Documentation update - [ ] Other, please describe: ## AI/Agent-Generated Declaration - [x] AI-assisted authoring See merge request: cann/ops-nn!13351 | 17 days ago |
Unique
English | 简体中文
This directory provides the global deduplication interfaces aclnnUnique and aclnnUnique2. Both interfaces return the unique elements in the input tensor and can optionally return the indices from the original input to the deduplication result; aclnnUnique2 can also return the number of occurrences of each unique element.
This module implements functions by combining existing operators and does not contain an independent kernel. The path supporting AI Core uses operators such as Sort and UniqueConsecutive; other scenarios call the UniqueWithCountsAndSorting AI CPU implementation. For specific support conditions, refer to the interface implementation and the interface documentation.
op_api/unique_common.cpp and op_api/unique_common.h are the internal implementations shared by the two interfaces. The consecutive deduplication interface aclnnUniqueConsecutive and its underlying implementation are still located in unique_consecutive.
| Interface | Documentation | Example |
|---|---|---|
| aclnnUnique | Interface description | Invocation example |
| aclnnUnique2 | Interface description and example | See the interface documentation |