| format cpp Co-authored-by: yang-di52<yangdi52@huawei.com> # message auto-generated for no-merge-commit merge: !6784 merge issue_fix into master format cpp Created-by: yang-di52 Commit-by: yang-di52 Merged-by: cann-robot Description: ## 描述 批量刷新cpp代码格式 ## 关联的Issue [#3791](https://gitcode.com/cann/ops-nn/issues/3791) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:代码格式化 ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!6784 | 2 个月前 |
| foreach/lamb/scatter类算子资料及原型整改,以及示例补齐 Co-authored-by: tangpingchuan<tangpingchuan@huawei.com> # message auto-generated for no-merge-commit merge: !6065 merge master into master foreach/lamb/scatter类算子资料及原型整改,以及示例补齐 Created-by: zl_hw Commit-by: tangpingchuan Merged-by: cann-robot Description: ## 描述 foreach/Lamb/scatter类长尾算子资料规范、license规范和原型说明注释规范等补充 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> ## 测试 ut/st 全部OBP和David冒烟已通过 ## 文档更新 所有算子README.md和op_list.md以及aclnn_op_list.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-nn!6065 | 2 个月前 |
| fix(op_host): 10 个算子补齐缺失的 InferDataType 注册 Co-authored-by: tangpingchuan<tangpingchuan@huawei.com> # message auto-generated for no-merge-commit merge: !9616 merge fix/infer-datatype-missing into master fix(op_host): 10 个算子补齐缺失的 InferDataType 注册 Created-by: zl_hw Commit-by: tangpingchuan Merged-by: cann-robot Description: ## 描述 ### 问题 Relu6Grad、LambApplyOptimizerAssign、LambApplyWeightAssign、LambNextMV、LambNextMVWithDecay、LambNextRight、LambUpdateWithLr、LambUpdateWithLrV2、MultilabelMarginLoss、PoissonNllLoss 这 10 个算子在 op_host/*_infershape.cpp 中只注册了 InferShape,没有注册 InferDataType,GE 图通路上输出 dtype 缺少显式推导来源。这 10 个算子的 op_graph 原型、op_host def 与 op_kernel 均齐全,确属有 GE 图通路的算子。 ### 方法 在各算子已有的 op_host/*_infershape.cpp 中新增 InferDataType4<OpType>,并将原有 IMPL_OP_INFERSHAPE 注册扩展为 .InferShape(...).InferDataType(...)。各输出的 dtype 来源按算子语义逐个确定,未套用统一模板: | 算子 | 输出 dtype 来源 | |------|-----------------| | Relu6Grad | backprops ← gradients | | LambApplyOptimizerAssign | output0 ← grad;inputv / inputm 为同名 ref 输出,各自跟随同名输入 | | LambApplyWeightAssign | input_param 为同名 ref 输出,跟随第 5 个输入 | | LambNextMV | y1~y4 ← input_mul3 | | LambNextMVWithDecay | y1~y4 ← input_mul3 | | LambNextRight | y1、y2 ← input_square | | LambUpdateWithLr | y ← input_greater1 | | LambUpdateWithLrV2 | y ← x1 | | MultilabelMarginLoss | y ← x;**is_target ← target(INT32)** | | PoissonNllLoss | loss ← input_x | 其中 MultilabelMarginLoss 的 is_target 不能跟随 x,否则图上会把 INT32 的 is_target 推成浮点。各算子 def 中的 dtype 列表按位一一对应(lamb 系列为「全 fp16」或「全 fp32」两种组合,无混精),故以上取源自洽。 ### 关于摆放位置 仓内两种写法都有:以本 PR 基线计,op_host 的 IMPL_OP_INFERSHAPE(...).InferDataType(...) 共 323 个文件,op_graph 的 IMPL_OP(...).InferDataType(...) 共 90 个文件。本次按多数写法放在各算子已有的 op_host infershape 文件内,可直接扩展原注册行,每算子只改一个文件,diff 中仅删除 10 行旧注册行,未触碰存量代码格式。 ## 关联的Issue 关联 Issue #5417 ## 测试 bash build.sh -u --ophost --soc=ascend950 --ops=relu6_grad,lamb_apply_optimizer_assign,lamb_apply_weight_assign,lamb_next_m_v,lamb_next_m_v_with_decay,lamb_next_right,lamb_update_with_lr,lamb_update_with_lr_v2,multilabel_margin_loss,poisson_nll_loss 结果:**116 tests PASSED,0 FAILED**。其中包含本次为 10 个算子各新增的 1 条 infer_datatype 用例: [ OK ] relu6grad.relu6grad_infer_datatype [ OK ] MultilabelMarginLossInferShapeTest.multilabelmarginloss_infer_datatype [ OK ] PoissonNllLossInfershapeTest.poissonnllloss_infer_datatype [ OK ] LambApplyOptimizerAssignProtoTest.lambapplyoptimizerassign_infer_datatype [ OK ] LambApplyWeightAssignProtoTest.lambapplyweightassign_infer_datatype [ OK ] LambNextMVProtoTest.lambnextmv_infer_datatype [ OK ] LambNextMVWithDecayProtoTest.lambnextmvwithdecay_infer_datatype [ OK ] LambNextRightProtoTest.lambnextright_infer_datatype [ OK ] LambUpdateWithLrProtoTest.lambupdatewithlr_infer_datatype [ OK ] LambUpdateWithLrV2ProtoTest.lambupdatewithlrv2_infer_datatype 用例中的 ASSERT_NE(dataTypeFunc, nullptr) 实证该注册可被 OpImplRegistry 取到;MultilabelMarginLoss 那条显式断言 is_target 推导为 INT32;Relu6Grad 那条按 def 声明逐 dtype 覆盖 fp16 / fp32 / bf16。 门禁自检:clang-format 18.1.8 --style=file 20 个文件全通过;仓内 scripts/oat_check.sh 20 个文件 All checks passed;trailing-whitespace / end-of-file / 冲突标记检查通过。 **未覆盖**:本次仅验证到 op_host UT 层(用例通过 OpImplRegistry 取到 infer_datatype 函数指针后直接调用),未做真机与 GE 图 e2e 验证。 ## 文档更新 无。本次仅新增 InferDataType 注册与对应 UT,不涉及对外接口与算子资料变更。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!9616 | 5 天前 |
| format cpp Co-authored-by: yang-di52<yangdi52@huawei.com> # message auto-generated for no-merge-commit merge: !6784 merge issue_fix into master format cpp Created-by: yang-di52 Commit-by: yang-di52 Merged-by: cann-robot Description: ## 描述 批量刷新cpp代码格式 ## 关联的Issue [#3791](https://gitcode.com/cann/ops-nn/issues/3791) ## 测试 <!--描述进行了哪些测试来验证你的改动。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:代码格式化 ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [ ] AI辅助编写 See merge request: cann/ops-nn!6784 | 2 个月前 |
| fix(op_host): 10 个算子补齐缺失的 InferDataType 注册 Co-authored-by: tangpingchuan<tangpingchuan@huawei.com> # message auto-generated for no-merge-commit merge: !9616 merge fix/infer-datatype-missing into master fix(op_host): 10 个算子补齐缺失的 InferDataType 注册 Created-by: zl_hw Commit-by: tangpingchuan Merged-by: cann-robot Description: ## 描述 ### 问题 Relu6Grad、LambApplyOptimizerAssign、LambApplyWeightAssign、LambNextMV、LambNextMVWithDecay、LambNextRight、LambUpdateWithLr、LambUpdateWithLrV2、MultilabelMarginLoss、PoissonNllLoss 这 10 个算子在 op_host/*_infershape.cpp 中只注册了 InferShape,没有注册 InferDataType,GE 图通路上输出 dtype 缺少显式推导来源。这 10 个算子的 op_graph 原型、op_host def 与 op_kernel 均齐全,确属有 GE 图通路的算子。 ### 方法 在各算子已有的 op_host/*_infershape.cpp 中新增 InferDataType4<OpType>,并将原有 IMPL_OP_INFERSHAPE 注册扩展为 .InferShape(...).InferDataType(...)。各输出的 dtype 来源按算子语义逐个确定,未套用统一模板: | 算子 | 输出 dtype 来源 | |------|-----------------| | Relu6Grad | backprops ← gradients | | LambApplyOptimizerAssign | output0 ← grad;inputv / inputm 为同名 ref 输出,各自跟随同名输入 | | LambApplyWeightAssign | input_param 为同名 ref 输出,跟随第 5 个输入 | | LambNextMV | y1~y4 ← input_mul3 | | LambNextMVWithDecay | y1~y4 ← input_mul3 | | LambNextRight | y1、y2 ← input_square | | LambUpdateWithLr | y ← input_greater1 | | LambUpdateWithLrV2 | y ← x1 | | MultilabelMarginLoss | y ← x;**is_target ← target(INT32)** | | PoissonNllLoss | loss ← input_x | 其中 MultilabelMarginLoss 的 is_target 不能跟随 x,否则图上会把 INT32 的 is_target 推成浮点。各算子 def 中的 dtype 列表按位一一对应(lamb 系列为「全 fp16」或「全 fp32」两种组合,无混精),故以上取源自洽。 ### 关于摆放位置 仓内两种写法都有:以本 PR 基线计,op_host 的 IMPL_OP_INFERSHAPE(...).InferDataType(...) 共 323 个文件,op_graph 的 IMPL_OP(...).InferDataType(...) 共 90 个文件。本次按多数写法放在各算子已有的 op_host infershape 文件内,可直接扩展原注册行,每算子只改一个文件,diff 中仅删除 10 行旧注册行,未触碰存量代码格式。 ## 关联的Issue 关联 Issue #5417 ## 测试 bash build.sh -u --ophost --soc=ascend950 --ops=relu6_grad,lamb_apply_optimizer_assign,lamb_apply_weight_assign,lamb_next_m_v,lamb_next_m_v_with_decay,lamb_next_right,lamb_update_with_lr,lamb_update_with_lr_v2,multilabel_margin_loss,poisson_nll_loss 结果:**116 tests PASSED,0 FAILED**。其中包含本次为 10 个算子各新增的 1 条 infer_datatype 用例: [ OK ] relu6grad.relu6grad_infer_datatype [ OK ] MultilabelMarginLossInferShapeTest.multilabelmarginloss_infer_datatype [ OK ] PoissonNllLossInfershapeTest.poissonnllloss_infer_datatype [ OK ] LambApplyOptimizerAssignProtoTest.lambapplyoptimizerassign_infer_datatype [ OK ] LambApplyWeightAssignProtoTest.lambapplyweightassign_infer_datatype [ OK ] LambNextMVProtoTest.lambnextmv_infer_datatype [ OK ] LambNextMVWithDecayProtoTest.lambnextmvwithdecay_infer_datatype [ OK ] LambNextRightProtoTest.lambnextright_infer_datatype [ OK ] LambUpdateWithLrProtoTest.lambupdatewithlr_infer_datatype [ OK ] LambUpdateWithLrV2ProtoTest.lambupdatewithlrv2_infer_datatype 用例中的 ASSERT_NE(dataTypeFunc, nullptr) 实证该注册可被 OpImplRegistry 取到;MultilabelMarginLoss 那条显式断言 is_target 推导为 INT32;Relu6Grad 那条按 def 声明逐 dtype 覆盖 fp16 / fp32 / bf16。 门禁自检:clang-format 18.1.8 --style=file 20 个文件全通过;仓内 scripts/oat_check.sh 20 个文件 All checks passed;trailing-whitespace / end-of-file / 冲突标记检查通过。 **未覆盖**:本次仅验证到 op_host UT 层(用例通过 OpImplRegistry 取到 infer_datatype 函数指针后直接调用),未做真机与 GE 图 e2e 验证。 ## 文档更新 无。本次仅新增 InferDataType 注册与对应 UT,不涉及对外接口与算子资料变更。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!9616 | 5 天前 |
| foreach/lamb/scatter类算子资料及原型整改,以及示例补齐 Co-authored-by: tangpingchuan<tangpingchuan@huawei.com> # message auto-generated for no-merge-commit merge: !6065 merge master into master foreach/lamb/scatter类算子资料及原型整改,以及示例补齐 Created-by: zl_hw Commit-by: tangpingchuan Merged-by: cann-robot Description: ## 描述 foreach/Lamb/scatter类长尾算子资料规范、license规范和原型说明注释规范等补充 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> ## 测试 ut/st 全部OBP和David冒烟已通过 ## 文档更新 所有算子README.md和op_list.md以及aclnn_op_list.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-nn!6065 | 2 个月前 |
| docs(lamb/scatter): 补齐 16 个算子 README 产品支持表的 A2/A3 标记 Co-authored-by: tangpingchuan<tangpingchuan@huawei.com> # message auto-generated for no-merge-commit merge: !9223 merge fix/readme-a2a3-support into master docs(lamb/scatter): 补齐 16 个算子 README 产品支持表的 A2/A3 标记 Created-by: zl_hw Commit-by: tangpingchuan Merged-by: cann-robot Description: ## 描述 这 16 个算子在 A2(ascend910b)与 A3(ascend910_93)上均有可用实现,但各自 README 的「产品支持情况」表把这两行标成了 ×,与事实不符——从资料上看不出这些算子在 A2/A3 可用。本 PR 将这两行订正为 √。 判定依据(两条同时成立才改,逐个算子核对): 1. canndev ops/built-in/tbe/op_info_cfg/ai_core/{ascend910b,ascend910_93}/aic-*-ops-info.ini 中存在该 OpType 的注册段; 2. canndev ops/built-in/tbe/impl/(或 impl/dynamic/)下存在对应的实现文件。 涉及算子: - optim:lamb_apply_optimizer_assign、lamb_apply_weight_assign、lamb_next_m_v、lamb_next_m_v_with_decay、lamb_next_right、lamb_update_with_lr、lamb_update_with_lr_v2 - index:scatter、scatter_add、scatter_div、scatter_elements、scatter_max、scatter_min、scatter_mul、scatter_nd、quant_update_scatter 未改动项:仅改「Atlas A3 训练系列产品/Atlas A3 推理系列产品」与「Atlas A2 训练系列产品/Atlas A2 推理系列产品」两行的取值;「Atlas 200I/500 A2 推理产品」(名称中同样含 A2)及其余产品行、README 正文均未改动。 一致性说明:同目录下 scatter_nd_sub、scatter_non_aliasing_add、scatter_max_with_argmax 等算子同样是本仓 def 只注册 ascend950、A2/A3 实现在 canndev,其 README 本就标为 √;本次改动与既有写法保持一致。 ## 关联的Issue - 关联Issue #5164 (https://gitcode.com/cann/ops-nn/issues/5164) ## 测试 本 PR 仅涉及 README 文档,无代码改动,不涉及编译与用例执行。核对方式: 1. 脚本逐算子比对 canndev 的 ops-info 注册段与 impl 实现文件,确认 16 个算子在 ascend910b/ascend910_93 均命中;改后复跑同一脚本,同类算子中已无遗漏; 2. 核对 git diff,被修改的行全部为 <term>Atlas A2/A3 …</term> 两行,未触及其他产品行与正文。 ## 文档更新 更新了上述 16 个算子目录下的 README.md(每个文件 2 行,共 32 行)。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-nn!9223 | 11 天前 |