| Files | Last commit | Last update |
|---|---|---|
[Threshold] 算子质量加固: 静态缺陷修复+示例修复+UT补齐+资料治理+测试资产入库 Co-authored-by: dengguojie<dengguojie@huawei.com> # message auto-generated for no-merge-commit merge: !12303 merge hardening/Threshold into master [Threshold] 算子质量加固: 静态缺陷修复+示例修复+UT补齐+资料治理+测试资产入库 Created-by: dengguojie Commit-by: dengguojie Merged-by: cann-robot Description: ## 描述 本 PR 对 activation/threshold/ 算子进行质量加固,基于静态扫描(91 项检查)、全通路动态验证(TTK kernel/geir/aclnn/torch 3000+ 用例)与 UT 覆盖率治理,共 27 文件变更(521+/111-)。 **缺陷修复**: - tiling GetTilingData 两处裸解引用补 OP_CHECK_NULL_WITH_CONTEXT 判空 - op_api UT 装配缺陷: CMakeLists 误用未定义 ${OPTEST_NAME},存量 25 用例从未编入(对齐兄弟算子先例改 ${OP_API_MODULE_NAME}) - geir 示例编译缺陷: 移除不存在头 experiment_ops.h + set_attr/AttrValue 方言改类型化 setter;失败路径补资源释放 - aclnn 示例修复(输出拷贝源/失败路径资源释放/头注释 BFLOAT16 支持域) **aclnn 归位 ThresholdV2**(方案见 #6846 追加评论,对齐 celu_v2/elu_grad_v2 先例): - op_api 三文件/接口文档(zh/en)/aclnn 示例×2/aclnn UT 25 例全部迁至 threshold_v2/(git mv 保历史);threshold/ 回归纯 REG_OP 形态(对齐老 celu/ 布局);构建零适配(目录自动扫描,ACLNNTYPE 声明维持上游既有) - 验证: UT api 25/25 + host 44/44;aclnn 示例 eager success;aclnnThreshold* 导出符号在位;vendors 含 threshold+threshold_v2 双 kernel **补齐与治理**: - 新增 tiling UT 12 用例(含 GetTilingData 判空拦截分支双向覆盖实证),threshold host 侧行覆盖 93.3% - 测试资产入库: golden.py(kernel/geir 通路,两注册键;比较域对齐 kernel 实现——threshold 属性为 f32,逐元素升 f32 比较后回原 dtype,f64 输入保持原域比较;全 dtype binary_equal)+ kernel 看护集 tests/st/arch35/ 47 条(正向全绿;异常拦截看护行不入库,由 UT/board 承载) ## 关联的Issue Fixes #6893 (Threshold op_host tiling GetTilingData 返回值未判空直接解引用) 关联 #6846 (aclnn 归位方案讨论,见追加评论;self→out 可转换性校验维持 #3007 既有门控,不在本 PR 范围) ## 测试 - UT: host 44/44(threshold 17 + threshold_v2 27)+ api 25/25 PASS;threshold host 侧行覆盖 93.3% ≥ 80% - TTK(加固期全通路验证): kernel L0+L1 471 用例(434 PASS;23 FAIL 均为 0-dim 动态编译崩溃,系 CANN 编译器 DFX 框架缺陷,已反馈 cann/asc-devkit#1896)/ geir 37 全 PASS / aclnn 1263 全 PASS(归位前于原路径执行,归位后以 UT 25 例+双示例复验)/ torch eager+aclgraph 47×2 / determinism 47 - 看护集(kernel 47 条): binary_equal 100% 全绿 - 三层核验: build self-config SUCCESS / verify_install rc=0 / binpath=vendors 实证 - 修复配套精准回归全绿,零退化 ## 文档更新 - threshold/README.md: Atlas训练系列产品支持标记修正(×→√,与接口文档及 canndev 官方口径对齐);功能说明锚定 opDef 二值化语义;aclnn 接口行随归位移除 - threshold_v2/README.md: 计算公式修正为 LE 形(与设备 CMPMODE_LE 实现一致);aclnn 示例/文档链接随归位本地化 - docs/aclnnThreshold&aclnnInplaceThreshold.md: 标量 threshold/value 数值域说明、NaN 边界行为、错误码行语义修正 - 仓内引用链: op_api_list(zh/en)/menu_aclnn_api 共 3 处链接随迁修正 ## 类型标签 - [x] Bug修复 - [x] 文档更新 - [ ] 新特性 - [ ] 性能优化 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!12303 | 19 days ago | |
[Threshold] 算子质量加固: 静态缺陷修复+示例修复+UT补齐+资料治理+测试资产入库 Co-authored-by: dengguojie<dengguojie@huawei.com> # message auto-generated for no-merge-commit merge: !12303 merge hardening/Threshold into master [Threshold] 算子质量加固: 静态缺陷修复+示例修复+UT补齐+资料治理+测试资产入库 Created-by: dengguojie Commit-by: dengguojie Merged-by: cann-robot Description: ## 描述 本 PR 对 activation/threshold/ 算子进行质量加固,基于静态扫描(91 项检查)、全通路动态验证(TTK kernel/geir/aclnn/torch 3000+ 用例)与 UT 覆盖率治理,共 27 文件变更(521+/111-)。 **缺陷修复**: - tiling GetTilingData 两处裸解引用补 OP_CHECK_NULL_WITH_CONTEXT 判空 - op_api UT 装配缺陷: CMakeLists 误用未定义 ${OPTEST_NAME},存量 25 用例从未编入(对齐兄弟算子先例改 ${OP_API_MODULE_NAME}) - geir 示例编译缺陷: 移除不存在头 experiment_ops.h + set_attr/AttrValue 方言改类型化 setter;失败路径补资源释放 - aclnn 示例修复(输出拷贝源/失败路径资源释放/头注释 BFLOAT16 支持域) **aclnn 归位 ThresholdV2**(方案见 #6846 追加评论,对齐 celu_v2/elu_grad_v2 先例): - op_api 三文件/接口文档(zh/en)/aclnn 示例×2/aclnn UT 25 例全部迁至 threshold_v2/(git mv 保历史);threshold/ 回归纯 REG_OP 形态(对齐老 celu/ 布局);构建零适配(目录自动扫描,ACLNNTYPE 声明维持上游既有) - 验证: UT api 25/25 + host 44/44;aclnn 示例 eager success;aclnnThreshold* 导出符号在位;vendors 含 threshold+threshold_v2 双 kernel **补齐与治理**: - 新增 tiling UT 12 用例(含 GetTilingData 判空拦截分支双向覆盖实证),threshold host 侧行覆盖 93.3% - 测试资产入库: golden.py(kernel/geir 通路,两注册键;比较域对齐 kernel 实现——threshold 属性为 f32,逐元素升 f32 比较后回原 dtype,f64 输入保持原域比较;全 dtype binary_equal)+ kernel 看护集 tests/st/arch35/ 47 条(正向全绿;异常拦截看护行不入库,由 UT/board 承载) ## 关联的Issue Fixes #6893 (Threshold op_host tiling GetTilingData 返回值未判空直接解引用) 关联 #6846 (aclnn 归位方案讨论,见追加评论;self→out 可转换性校验维持 #3007 既有门控,不在本 PR 范围) ## 测试 - UT: host 44/44(threshold 17 + threshold_v2 27)+ api 25/25 PASS;threshold host 侧行覆盖 93.3% ≥ 80% - TTK(加固期全通路验证): kernel L0+L1 471 用例(434 PASS;23 FAIL 均为 0-dim 动态编译崩溃,系 CANN 编译器 DFX 框架缺陷,已反馈 cann/asc-devkit#1896)/ geir 37 全 PASS / aclnn 1263 全 PASS(归位前于原路径执行,归位后以 UT 25 例+双示例复验)/ torch eager+aclgraph 47×2 / determinism 47 - 看护集(kernel 47 条): binary_equal 100% 全绿 - 三层核验: build self-config SUCCESS / verify_install rc=0 / binpath=vendors 实证 - 修复配套精准回归全绿,零退化 ## 文档更新 - threshold/README.md: Atlas训练系列产品支持标记修正(×→√,与接口文档及 canndev 官方口径对齐);功能说明锚定 opDef 二值化语义;aclnn 接口行随归位移除 - threshold_v2/README.md: 计算公式修正为 LE 形(与设备 CMPMODE_LE 实现一致);aclnn 示例/文档链接随归位本地化 - docs/aclnnThreshold&aclnnInplaceThreshold.md: 标量 threshold/value 数值域说明、NaN 边界行为、错误码行语义修正 - 仓内引用链: op_api_list(zh/en)/menu_aclnn_api 共 3 处链接随迁修正 ## 类型标签 - [x] Bug修复 - [x] 文档更新 - [ ] 新特性 - [ ] 性能优化 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!12303 | 19 days ago | |
Threshold算子补充InferDataType Co-authored-by: rsj007<renshuojian@huawei.com> # message auto-generated for no-merge-commit merge: !9839 merge master into master Threshold算子补充InferDataType Created-by: rsj007 Commit-by: rsj007 Merged-by: cann-robot Description: ## 描述 Threshold算子补充输出 dtype 推导(输出 dtype = 输入 dtype)并挂接到IMPL_OP注册链。 ## 关联的Issue https://gitcode.com/cann/ops-nn/issues/5550 ## 测试 geir通路验证、obp冒烟、david冒烟 ## 文档更新 无 ## 类型标签 <!-- [x] 表示选中 --> - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!9839 | 2 months ago | |
refactor: NpuArch整改——activation类39算子注册迁移AddConfigByArch,CMake arch折叠,op_api枚举统一 Co-authored-by: ywx1080114<yuanbin22@huawei.com> # message auto-generated for no-merge-commit merge: !11992 merge npuarch-migration into master refactor: NpuArch整改——activation类39算子注册迁移AddConfigByArch,CMake arch折叠,op_api枚举统一 Created-by: yuanbin_22 Commit-by: ywx1080114 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 基础与扩展算子 NpuArch 整改第一批(activation 39 个),共 107 个文件(+306 -268): **1. 注册面迁移(39 个 activation 类 _def.cpp):** - 算子注册从 this->AICore().AddConfig("ascend950"/"ascend350"/"ascend960dt"/"ascend960pr", aicoreConfig) 迁移为 **opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510/DAV_9201/DAV_9202, aicoreConfig)**(include op_common/op_host/util/op_arch_helper.h); - 147 处旧 AddConfig 收敛为 108 处 AddConfigByArch:**Ascend950/Ascend350 折叠到 DAV_3510**(同 arch 共享一份注册),960dt=DAV_9201、960pr=DAV_9202 保留显式注册; - 涉及算子(39 个):elu、elu_grad、elu_grad_v2、erfinv、fast_gelu、fast_gelu_grad、ge_glu_grad_v2、ge_glu_v2、gelu、gelu_grad、gelu_grad_v2、gelu_quant、gelu_v2、glu_grad、hardtanh_grad、leaky_relu、leaky_relu_grad、log_sigmoid、logsigmoid_grad、mish、mish_grad、p_relu、p_relu_grad_reduce、p_relu_grad_update、relu、relu_grad、relu_grad_v2、relu_v2、sigmoid、sigmoid_grad、silu_grad、softmax_grad_ext、softplus、swi_glu_grad、swish、swish_grad、threshold、threshold_grad_v2、threshold_grad_v2_d。 **2. CMake arch 折叠同步(35 个 CMakeLists.txt):** - SUPPORT_COMPUTE_UNIT 由 soc 名折叠为 arch 名(ascend950/ascend350 → dav_3510,ascend960dt → dav_9201,ascend960pr → dav_9202),保留各算子原有其他 soc(mc62 等);SUPPORT_TILING_DIR 相应调整。 **3. op_api / op_host tiling 枚举统一(33 个文件,低风险面):** - 运行时 NpuArch::DAV_* 判断统一替换为 Ops::Base::DAV_*(约 51 处,include op_common/op_host/util/op_const_def.h,枚举同值纯改名),分支逻辑与 dtype 支持列表不变。 **三批拆分说明:** activation 批 39 个(本 PR)、quant/index 批 26 个(!14673)、长尾批 43 个(!14522)。拆分依据:Compile_single 逐算子串行构建实测 49 算子 57.0min(70s/算子,上限 3600s),65 算子合并必超时。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> - 关联 Issue #9085 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> - 注册迁移为等价替换(AddConfigByArch(DAV_3510) 展开覆盖 950/350 两个 soc,9201/9202 显式注册不变),编译期配置产物一致; - op_api/tiling 侧仅枚举命名空间统一(NpuArch::DAV_* → Ops::Base::DAV_*,枚举同值),分支逻辑不变; - 本地构建回归通过;CI compile 待触发。 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> - 无需文档更新。 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述:重构(注册面/平台判断统一) ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!11992 | 3 days ago | |
refactor: NpuArch整改——activation类39算子注册迁移AddConfigByArch,CMake arch折叠,op_api枚举统一 Co-authored-by: ywx1080114<yuanbin22@huawei.com> # message auto-generated for no-merge-commit merge: !11992 merge npuarch-migration into master refactor: NpuArch整改——activation类39算子注册迁移AddConfigByArch,CMake arch折叠,op_api枚举统一 Created-by: yuanbin_22 Commit-by: ywx1080114 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 基础与扩展算子 NpuArch 整改第一批(activation 39 个),共 107 个文件(+306 -268): **1. 注册面迁移(39 个 activation 类 _def.cpp):** - 算子注册从 this->AICore().AddConfig("ascend950"/"ascend350"/"ascend960dt"/"ascend960pr", aicoreConfig) 迁移为 **opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510/DAV_9201/DAV_9202, aicoreConfig)**(include op_common/op_host/util/op_arch_helper.h); - 147 处旧 AddConfig 收敛为 108 处 AddConfigByArch:**Ascend950/Ascend350 折叠到 DAV_3510**(同 arch 共享一份注册),960dt=DAV_9201、960pr=DAV_9202 保留显式注册; - 涉及算子(39 个):elu、elu_grad、elu_grad_v2、erfinv、fast_gelu、fast_gelu_grad、ge_glu_grad_v2、ge_glu_v2、gelu、gelu_grad、gelu_grad_v2、gelu_quant、gelu_v2、glu_grad、hardtanh_grad、leaky_relu、leaky_relu_grad、log_sigmoid、logsigmoid_grad、mish、mish_grad、p_relu、p_relu_grad_reduce、p_relu_grad_update、relu、relu_grad、relu_grad_v2、relu_v2、sigmoid、sigmoid_grad、silu_grad、softmax_grad_ext、softplus、swi_glu_grad、swish、swish_grad、threshold、threshold_grad_v2、threshold_grad_v2_d。 **2. CMake arch 折叠同步(35 个 CMakeLists.txt):** - SUPPORT_COMPUTE_UNIT 由 soc 名折叠为 arch 名(ascend950/ascend350 → dav_3510,ascend960dt → dav_9201,ascend960pr → dav_9202),保留各算子原有其他 soc(mc62 等);SUPPORT_TILING_DIR 相应调整。 **3. op_api / op_host tiling 枚举统一(33 个文件,低风险面):** - 运行时 NpuArch::DAV_* 判断统一替换为 Ops::Base::DAV_*(约 51 处,include op_common/op_host/util/op_const_def.h,枚举同值纯改名),分支逻辑与 dtype 支持列表不变。 **三批拆分说明:** activation 批 39 个(本 PR)、quant/index 批 26 个(!14673)、长尾批 43 个(!14522)。拆分依据:Compile_single 逐算子串行构建实测 49 算子 57.0min(70s/算子,上限 3600s),65 算子合并必超时。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> - 关联 Issue #9085 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> - 注册迁移为等价替换(AddConfigByArch(DAV_3510) 展开覆盖 950/350 两个 soc,9201/9202 显式注册不变),编译期配置产物一致; - op_api/tiling 侧仅枚举命名空间统一(NpuArch::DAV_* → Ops::Base::DAV_*,枚举同值),分支逻辑不变; - 本地构建回归通过;CI compile 待触发。 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> - 无需文档更新。 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述:重构(注册面/平台判断统一) ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!11992 | 3 days ago | |
[Threshold] 算子质量加固: 静态缺陷修复+示例修复+UT补齐+资料治理+测试资产入库 Co-authored-by: dengguojie<dengguojie@huawei.com> # message auto-generated for no-merge-commit merge: !12303 merge hardening/Threshold into master [Threshold] 算子质量加固: 静态缺陷修复+示例修复+UT补齐+资料治理+测试资产入库 Created-by: dengguojie Commit-by: dengguojie Merged-by: cann-robot Description: ## 描述 本 PR 对 activation/threshold/ 算子进行质量加固,基于静态扫描(91 项检查)、全通路动态验证(TTK kernel/geir/aclnn/torch 3000+ 用例)与 UT 覆盖率治理,共 27 文件变更(521+/111-)。 **缺陷修复**: - tiling GetTilingData 两处裸解引用补 OP_CHECK_NULL_WITH_CONTEXT 判空 - op_api UT 装配缺陷: CMakeLists 误用未定义 ${OPTEST_NAME},存量 25 用例从未编入(对齐兄弟算子先例改 ${OP_API_MODULE_NAME}) - geir 示例编译缺陷: 移除不存在头 experiment_ops.h + set_attr/AttrValue 方言改类型化 setter;失败路径补资源释放 - aclnn 示例修复(输出拷贝源/失败路径资源释放/头注释 BFLOAT16 支持域) **aclnn 归位 ThresholdV2**(方案见 #6846 追加评论,对齐 celu_v2/elu_grad_v2 先例): - op_api 三文件/接口文档(zh/en)/aclnn 示例×2/aclnn UT 25 例全部迁至 threshold_v2/(git mv 保历史);threshold/ 回归纯 REG_OP 形态(对齐老 celu/ 布局);构建零适配(目录自动扫描,ACLNNTYPE 声明维持上游既有) - 验证: UT api 25/25 + host 44/44;aclnn 示例 eager success;aclnnThreshold* 导出符号在位;vendors 含 threshold+threshold_v2 双 kernel **补齐与治理**: - 新增 tiling UT 12 用例(含 GetTilingData 判空拦截分支双向覆盖实证),threshold host 侧行覆盖 93.3% - 测试资产入库: golden.py(kernel/geir 通路,两注册键;比较域对齐 kernel 实现——threshold 属性为 f32,逐元素升 f32 比较后回原 dtype,f64 输入保持原域比较;全 dtype binary_equal)+ kernel 看护集 tests/st/arch35/ 47 条(正向全绿;异常拦截看护行不入库,由 UT/board 承载) ## 关联的Issue Fixes #6893 (Threshold op_host tiling GetTilingData 返回值未判空直接解引用) 关联 #6846 (aclnn 归位方案讨论,见追加评论;self→out 可转换性校验维持 #3007 既有门控,不在本 PR 范围) ## 测试 - UT: host 44/44(threshold 17 + threshold_v2 27)+ api 25/25 PASS;threshold host 侧行覆盖 93.3% ≥ 80% - TTK(加固期全通路验证): kernel L0+L1 471 用例(434 PASS;23 FAIL 均为 0-dim 动态编译崩溃,系 CANN 编译器 DFX 框架缺陷,已反馈 cann/asc-devkit#1896)/ geir 37 全 PASS / aclnn 1263 全 PASS(归位前于原路径执行,归位后以 UT 25 例+双示例复验)/ torch eager+aclgraph 47×2 / determinism 47 - 看护集(kernel 47 条): binary_equal 100% 全绿 - 三层核验: build self-config SUCCESS / verify_install rc=0 / binpath=vendors 实证 - 修复配套精准回归全绿,零退化 ## 文档更新 - threshold/README.md: Atlas训练系列产品支持标记修正(×→√,与接口文档及 canndev 官方口径对齐);功能说明锚定 opDef 二值化语义;aclnn 接口行随归位移除 - threshold_v2/README.md: 计算公式修正为 LE 形(与设备 CMPMODE_LE 实现一致);aclnn 示例/文档链接随归位本地化 - docs/aclnnThreshold&aclnnInplaceThreshold.md: 标量 threshold/value 数值域说明、NaN 边界行为、错误码行语义修正 - 仓内引用链: op_api_list(zh/en)/menu_aclnn_api 共 3 处链接随迁修正 ## 类型标签 - [x] Bug修复 - [x] 文档更新 - [ ] 新特性 - [ ] 性能优化 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!12303 | 19 days ago | |
[Threshold] 算子质量加固: 静态缺陷修复+示例修复+UT补齐+资料治理+测试资产入库 Co-authored-by: dengguojie<dengguojie@huawei.com> # message auto-generated for no-merge-commit merge: !12303 merge hardening/Threshold into master [Threshold] 算子质量加固: 静态缺陷修复+示例修复+UT补齐+资料治理+测试资产入库 Created-by: dengguojie Commit-by: dengguojie Merged-by: cann-robot Description: ## 描述 本 PR 对 activation/threshold/ 算子进行质量加固,基于静态扫描(91 项检查)、全通路动态验证(TTK kernel/geir/aclnn/torch 3000+ 用例)与 UT 覆盖率治理,共 27 文件变更(521+/111-)。 **缺陷修复**: - tiling GetTilingData 两处裸解引用补 OP_CHECK_NULL_WITH_CONTEXT 判空 - op_api UT 装配缺陷: CMakeLists 误用未定义 ${OPTEST_NAME},存量 25 用例从未编入(对齐兄弟算子先例改 ${OP_API_MODULE_NAME}) - geir 示例编译缺陷: 移除不存在头 experiment_ops.h + set_attr/AttrValue 方言改类型化 setter;失败路径补资源释放 - aclnn 示例修复(输出拷贝源/失败路径资源释放/头注释 BFLOAT16 支持域) **aclnn 归位 ThresholdV2**(方案见 #6846 追加评论,对齐 celu_v2/elu_grad_v2 先例): - op_api 三文件/接口文档(zh/en)/aclnn 示例×2/aclnn UT 25 例全部迁至 threshold_v2/(git mv 保历史);threshold/ 回归纯 REG_OP 形态(对齐老 celu/ 布局);构建零适配(目录自动扫描,ACLNNTYPE 声明维持上游既有) - 验证: UT api 25/25 + host 44/44;aclnn 示例 eager success;aclnnThreshold* 导出符号在位;vendors 含 threshold+threshold_v2 双 kernel **补齐与治理**: - 新增 tiling UT 12 用例(含 GetTilingData 判空拦截分支双向覆盖实证),threshold host 侧行覆盖 93.3% - 测试资产入库: golden.py(kernel/geir 通路,两注册键;比较域对齐 kernel 实现——threshold 属性为 f32,逐元素升 f32 比较后回原 dtype,f64 输入保持原域比较;全 dtype binary_equal)+ kernel 看护集 tests/st/arch35/ 47 条(正向全绿;异常拦截看护行不入库,由 UT/board 承载) ## 关联的Issue Fixes #6893 (Threshold op_host tiling GetTilingData 返回值未判空直接解引用) 关联 #6846 (aclnn 归位方案讨论,见追加评论;self→out 可转换性校验维持 #3007 既有门控,不在本 PR 范围) ## 测试 - UT: host 44/44(threshold 17 + threshold_v2 27)+ api 25/25 PASS;threshold host 侧行覆盖 93.3% ≥ 80% - TTK(加固期全通路验证): kernel L0+L1 471 用例(434 PASS;23 FAIL 均为 0-dim 动态编译崩溃,系 CANN 编译器 DFX 框架缺陷,已反馈 cann/asc-devkit#1896)/ geir 37 全 PASS / aclnn 1263 全 PASS(归位前于原路径执行,归位后以 UT 25 例+双示例复验)/ torch eager+aclgraph 47×2 / determinism 47 - 看护集(kernel 47 条): binary_equal 100% 全绿 - 三层核验: build self-config SUCCESS / verify_install rc=0 / binpath=vendors 实证 - 修复配套精准回归全绿,零退化 ## 文档更新 - threshold/README.md: Atlas训练系列产品支持标记修正(×→√,与接口文档及 canndev 官方口径对齐);功能说明锚定 opDef 二值化语义;aclnn 接口行随归位移除 - threshold_v2/README.md: 计算公式修正为 LE 形(与设备 CMPMODE_LE 实现一致);aclnn 示例/文档链接随归位本地化 - docs/aclnnThreshold&aclnnInplaceThreshold.md: 标量 threshold/value 数值域说明、NaN 边界行为、错误码行语义修正 - 仓内引用链: op_api_list(zh/en)/menu_aclnn_api 共 3 处链接随迁修正 ## 类型标签 - [x] Bug修复 - [x] 文档更新 - [ ] 新特性 - [ ] 性能优化 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!12303 | 19 days ago | |
[Threshold] 算子质量加固: 静态缺陷修复+示例修复+UT补齐+资料治理+测试资产入库 Co-authored-by: dengguojie<dengguojie@huawei.com> # message auto-generated for no-merge-commit merge: !12303 merge hardening/Threshold into master [Threshold] 算子质量加固: 静态缺陷修复+示例修复+UT补齐+资料治理+测试资产入库 Created-by: dengguojie Commit-by: dengguojie Merged-by: cann-robot Description: ## 描述 本 PR 对 activation/threshold/ 算子进行质量加固,基于静态扫描(91 项检查)、全通路动态验证(TTK kernel/geir/aclnn/torch 3000+ 用例)与 UT 覆盖率治理,共 27 文件变更(521+/111-)。 **缺陷修复**: - tiling GetTilingData 两处裸解引用补 OP_CHECK_NULL_WITH_CONTEXT 判空 - op_api UT 装配缺陷: CMakeLists 误用未定义 ${OPTEST_NAME},存量 25 用例从未编入(对齐兄弟算子先例改 ${OP_API_MODULE_NAME}) - geir 示例编译缺陷: 移除不存在头 experiment_ops.h + set_attr/AttrValue 方言改类型化 setter;失败路径补资源释放 - aclnn 示例修复(输出拷贝源/失败路径资源释放/头注释 BFLOAT16 支持域) **aclnn 归位 ThresholdV2**(方案见 #6846 追加评论,对齐 celu_v2/elu_grad_v2 先例): - op_api 三文件/接口文档(zh/en)/aclnn 示例×2/aclnn UT 25 例全部迁至 threshold_v2/(git mv 保历史);threshold/ 回归纯 REG_OP 形态(对齐老 celu/ 布局);构建零适配(目录自动扫描,ACLNNTYPE 声明维持上游既有) - 验证: UT api 25/25 + host 44/44;aclnn 示例 eager success;aclnnThreshold* 导出符号在位;vendors 含 threshold+threshold_v2 双 kernel **补齐与治理**: - 新增 tiling UT 12 用例(含 GetTilingData 判空拦截分支双向覆盖实证),threshold host 侧行覆盖 93.3% - 测试资产入库: golden.py(kernel/geir 通路,两注册键;比较域对齐 kernel 实现——threshold 属性为 f32,逐元素升 f32 比较后回原 dtype,f64 输入保持原域比较;全 dtype binary_equal)+ kernel 看护集 tests/st/arch35/ 47 条(正向全绿;异常拦截看护行不入库,由 UT/board 承载) ## 关联的Issue Fixes #6893 (Threshold op_host tiling GetTilingData 返回值未判空直接解引用) 关联 #6846 (aclnn 归位方案讨论,见追加评论;self→out 可转换性校验维持 #3007 既有门控,不在本 PR 范围) ## 测试 - UT: host 44/44(threshold 17 + threshold_v2 27)+ api 25/25 PASS;threshold host 侧行覆盖 93.3% ≥ 80% - TTK(加固期全通路验证): kernel L0+L1 471 用例(434 PASS;23 FAIL 均为 0-dim 动态编译崩溃,系 CANN 编译器 DFX 框架缺陷,已反馈 cann/asc-devkit#1896)/ geir 37 全 PASS / aclnn 1263 全 PASS(归位前于原路径执行,归位后以 UT 25 例+双示例复验)/ torch eager+aclgraph 47×2 / determinism 47 - 看护集(kernel 47 条): binary_equal 100% 全绿 - 三层核验: build self-config SUCCESS / verify_install rc=0 / binpath=vendors 实证 - 修复配套精准回归全绿,零退化 ## 文档更新 - threshold/README.md: Atlas训练系列产品支持标记修正(×→√,与接口文档及 canndev 官方口径对齐);功能说明锚定 opDef 二值化语义;aclnn 接口行随归位移除 - threshold_v2/README.md: 计算公式修正为 LE 形(与设备 CMPMODE_LE 实现一致);aclnn 示例/文档链接随归位本地化 - docs/aclnnThreshold&aclnnInplaceThreshold.md: 标量 threshold/value 数值域说明、NaN 边界行为、错误码行语义修正 - 仓内引用链: op_api_list(zh/en)/menu_aclnn_api 共 3 处链接随迁修正 ## 类型标签 - [x] Bug修复 - [x] 文档更新 - [ ] 新特性 - [ ] 性能优化 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!12303 | 19 days 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 |
Threshold
English | 简体中文
Applicable Products
| Product | Support |
|---|---|
| Ascend 950PR&950DT products | √ |
| Atlas A3 products | √ |
| Atlas A2 products | √ |
| Atlas 200I/500 A2 inference products | × |
| Atlas inference products | × |
| Atlas training products | √ |
Function
-
Operator function: Performs the threshold operation on the input x. When the elements in x are greater than threshold, the operator returns 1. Otherwise, it returns 0.
-
Formula:
y=(x>threshold) ? 1:0y = (x > threshold) \; ? \; 1 : 0 y=(x>threshold)?1:0
Parameters
| Parameter name | Input/Output/Attribute | Description | Data type | Data format |
|---|---|---|---|---|
| x | Input | Input parameter for the threshold computation, which is x in the formula. | FLOAT, FLOAT16, BFLOAT16 | ND |
| y | Output | Output parameter after the threshold computation, which is y in the formula. | FLOAT, FLOAT16, BFLOAT16 | ND |
| threshold | Attribute | Threshold. Elements in x that are greater than this value output 1, and otherwise output 0. Default value: 0.0. | FLOAT | - |
Constraints
- The input and output are tensors of arbitrary dimensions (ND format).
- The data types of the input and output must be consistent.
- The output values are discrete values (0.0 or 1.0), which are bit-exact consistent with the Golden result.
- A NaN input outputs 0.0 (NaN compared with any value is always False).
- A +Inf input outputs 1.0 (+Inf > threshold is always True).
- A -Inf input outputs 0.0 (-Inf > threshold is always False).
Invocation Description
| Invocation method | Invocation sample | Description |
|---|---|---|
| Graph-mode invocation | test_geir_threshold | Calls the Threshold operator through graph construction with the operator IR. |