| test: make UniqueV3 ACLNN example configurable Co-authored-by: chinlylin<huangming@tiankuan.net> # message auto-generated for no-merge-commit merge: !33 merge test/unique-v3-configurable-example into master test: make UniqueV3 ACLNN example configurable Created-by: chinlylin Commit-by: chinlylin Merged-by: cann-robot Description: ## 变更内容 - 为 UniqueV3 ACLNN 示例增加命令行参数,依次支持 element_count、value_range、device_id 和 seed。 - 保留原有默认值:1000 万个元素、1000 万值域、设备 0、随机种子 42。 - 增加 -h / --help 使用说明。 - 在初始化 ACL 和分配内存前校验参数,拒绝零元素、零值域、负设备号、负种子、数值溢出、非法字符和多余参数。 - 在启动摘要中输出实际测试规模、设备号和随机种子,便于复现实验。 ## 问题背景 原示例将 1000 万元素、值域、设备号和随机种子全部硬编码。首次验证时无法先运行小规模 smoke test,在不同设备或需要复现实验时也必须修改源码。 本 PR 只改进 ACLNN 示例入口,不修改 UniqueV3 算子实现、接口、CPU 参考计算或结果判定逻辑。 ## 使用示例 bash # 保持原默认行为 ./test_aclnn_unique_v3 # 小规模 smoke test:1024 个元素、128 值域、设备 0、种子 7 ./test_aclnn_unique_v3 1024 128 0 7 # 查看参数说明 ./test_aclnn_unique_v3 --help ## 验证 - git diff --check:通过。 - 使用 ACL/ACLNN stub 对完整源文件执行 g++ -std=c++17 -fsyntax-only:通过。 - 参数解析独立测试:正常值、默认边界、零值、负值、uint32 溢出、尾随字符和空字符串均符合预期。 - 默认参数保持检查:通过。 - ACL 初始化位于全部参数校验之后:通过。 - 变更范围检查:仅修改 unique_v3/examples/test_aclnn_unique_v3.cpp。 - 敏感信息扫描:无命中。 ## 未验证项 - 当前环境没有 CANN 和 NPU,未使用真实 ACL/ACLNN 头文件完成链接,也未运行 NPU 示例。 See merge request: cann/elec-ops-inspection!33 | 1 个月前 |
| 更新unique_v3算子,提升小shape下的性能 Co-authored-by: wiooo_<wuweihao@tiankuan.net> # message auto-generated for no-merge-commit merge: !10 merge master into master 更新unique_v3算子,提升小shape下的性能 Created-by: wiooo_ Commit-by: wiooo_ Merged-by: cann-robot Description: ## 变更描述 / Description 更新unique_v3算子,提升小shape下的性能 ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [✅] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 关联 Issue / Related Issues <!-- Closes #000 可自动关闭 / Closes #000 to auto-close --> - Closes # - References # ## 测试信息 / 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/elec-ops-inspection!10 | 1 个月前 |
| 更新unique_v3算子,提升小shape下的性能 Co-authored-by: wiooo_<wuweihao@tiankuan.net> # message auto-generated for no-merge-commit merge: !10 merge master into master 更新unique_v3算子,提升小shape下的性能 Created-by: wiooo_ Commit-by: wiooo_ Merged-by: cann-robot Description: ## 变更描述 / Description 更新unique_v3算子,提升小shape下的性能 ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [✅] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 关联 Issue / Related Issues <!-- Closes #000 可自动关闭 / Closes #000 to auto-close --> - Closes # - References # ## 测试信息 / 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/elec-ops-inspection!10 | 1 个月前 |
| 更新unique_v3算子,提升小shape下的性能 Co-authored-by: wiooo_<wuweihao@tiankuan.net> # message auto-generated for no-merge-commit merge: !10 merge master into master 更新unique_v3算子,提升小shape下的性能 Created-by: wiooo_ Commit-by: wiooo_ Merged-by: cann-robot Description: ## 变更描述 / Description 更新unique_v3算子,提升小shape下的性能 ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [✅] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 关联 Issue / Related Issues <!-- Closes #000 可自动关闭 / Closes #000 to auto-close --> - Closes # - References # ## 测试信息 / 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/elec-ops-inspection!10 | 1 个月前 |
| 更新unique_v3算子,提升小shape下的性能 Co-authored-by: wiooo_<wuweihao@tiankuan.net> # message auto-generated for no-merge-commit merge: !10 merge master into master 更新unique_v3算子,提升小shape下的性能 Created-by: wiooo_ Commit-by: wiooo_ Merged-by: cann-robot Description: ## 变更描述 / Description 更新unique_v3算子,提升小shape下的性能 ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [✅] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 关联 Issue / Related Issues <!-- Closes #000 可自动关闭 / Closes #000 to auto-close --> - Closes # - References # ## 测试信息 / 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/elec-ops-inspection!10 | 1 个月前 |
| docs: align UniqueV3 README with kernel behavior Co-authored-by: moxi_git<zhangkaizhen@tiankuan.net> # message auto-generated for no-merge-commit merge: !34 merge docs/unique-v3-readme-contract into master docs: align UniqueV3 README with kernel behavior Created-by: moxi_git Commit-by: moxi_git Merged-by: cann-robot Description: ## 变更内容 - 明确 flag_sorted=0 时按降序输出,非 0 时按升序输出。 - 同步更新功能说明、计算公式、output 描述和 flag_sorted 属性说明。 - 说明所有输入类型会在 Kernel 内转换为 FLOAT 进行排序。 - 补充 INT32 逐元素精确区分所需的 FP32 可精确表示范围 [-2^24, 2^24]。 - 将文档中的错误哨兵值 3e+99 修正为 Kernel 当前使用的 3.402823e+38f,并说明 FLOAT 输入应避开正负哨兵值。 - 删除 README 末尾残留的 </content> 和 </invoke> 模板标签。 ## 问题背景 当前 README 将输出描述为始终降序,并把 flag_sorted 解释为是否排序;Kernel 实际始终执行排序,并通过该属性控制排序方向。文档中的 3e+99 也不是有效的 float32 常量,与源码中的 FLOAT_INF = 3.402823e+38f 不一致。 此外,INT32 等非 FLOAT 输入会先转换为 FLOAT 参与排序,文档应说明超出 FP32 连续整数精确范围时可能无法逐元素区分。 本 PR 只校准文档契约和数值约束,不修改算子实现、接口或性能结论。 ## 验证 - OpDef 中 flag_sorted 默认值为 0。 - Tiling 将 flag_sorted 转换为布尔值并传入 Kernel。 - Kernel 在属性非 0 时先乘以 -1 排序,并在排序后执行符号还原,源码注释对应升序路径。 - Kernel FLOAT_INF 常量为 3.402823e+38f。 - INT32 输入走 Cast 到 FLOAT 的排序路径。 - README HTML 表格标签配对检查:通过。 - ACLNN 示例相对链接存在。 - 旧 3e+99 和模板残留标签扫描:无残留。 - git diff --check:通过。 - 变更范围检查:仅修改 unique_v3/README.md。 - 敏感信息扫描:无命中。 ## 未验证项 - 当前环境没有 CANN 和 NPU,未在真实设备上复测不同 flag_sorted 值及数值边界输入。 See merge request: cann/elec-ops-inspection!34 | 1 个月前 |