| Files | Last commit | Last update |
|---|---|---|
fix(examples): 删除geir样例中与ops_proto_math.h重复的本地Data/Const/Identity注册 Co-authored-by: Dazhou_Cao<caodazhou@huawei.com> # message auto-generated for no-merge-commit merge: !7000 merge fix/geir-example-duplicate-reg into master fix(examples): 删除geir样例中与ops_proto_math.h重复的本地Data/Const/Identity注册 Created-by: Dazhou_Cao Commit-by: Dazhou_Cao Merged-by: cann-robot Description: ## 描述 ge/data、ge/const、conversion/identity 迁入 ops-math 后, ops_proto_math.h(由 merge_proto.py 合并全仓算子 proto 生成)已包含 REG_OP(Data) / REG_OP(Const) / REG_OP(Identity)(带 OPS_PROTO_DEF_* 守卫)。部分迁移早期交付的 GEIR 样例(编写时上述算子尚未入库)在样例内写了无守卫的本地 REG_OP 注册,与合并头同处一个编译单元,导致类重定义编译错误: error: redefinition of 'class ge::op::Data'(如 test_geir_stop_gradient.cpp:25 与 ops_proto_math.h 冲突) 本 PR 删除 12 个受影响样例的本地注册块,改用合并头定义,与仓库既有正常样例(math/rank、conversion/size、ge/case、ge/for 等)模式一致: | 目录 | 样例 | 删除的本地注册 | |---|---|---| | conversion | stop_gradient / snapshot / prevent_gradient / identity / identity_n / flatten_v2 / trans_shape / phony_concat / phony_split | Data | | conversion | expand_dims | Data + Const | | ge | control_trigger / no_op | Data + Identity | 样例中 op::Data / op::Const / op::Identity 的使用处均不变。 ## 关联的Issue 不涉及 ## 测试 - 按构建逻辑用当前 HEAD 的 370 个算子 proto + op_math_proto_extend.h 重新生成合并头(与构建产物一致,含 Data/Const/Identity 定义)。 - 12 个受影响样例逐一完整编译+链接(g++ -D_GLIBCXX_USE_CXX11_ABI=0,链接 -lgraph -lge_runner -lgraph_base -lge_compiler):12/12 通过,0 error,均生成可执行文件。 - 排查其余样例:16 个仅 include 自身算子 proto 的自包含样例(本地注册 Data,不引用合并头)无编译冲突,保持原样未改动;math/pdist(本地注册 Pdist)同理。 ## 文档更新 不涉及 See merge request: cann/ops-math!7000 | 11 days ago | |
fix: rm operator list ymal Co-authored-by: wangrui<wangrui124@huawei.com> # message auto-generated for no-merge-commit merge: !2837 merge br_ci into master fix: rm operator list ymal Created-by: wangrui_ Commit-by: wangrui Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1. 移除 CI 分组编译的强制校验 2. 清理 CMakeLists 中的调试打印 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> https://gitcode.com/cann/ops-math/issues/1624 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> NA ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> NA ## 类型标签 <!-- [x] 表示选中 --> - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!2837 | 5 months ago | |
feat: 迁移5个conversion算子(identity/identity_n/snapshot/stop_gradient/prevent_gradient) Co-authored-by: Dazhou_Cao<caodazhou@huawei.com> # message auto-generated for no-merge-commit merge: !5245 merge feature/migrate-conversion-ops into master feat: 迁移5个conversion算子(identity/identity_n/snapshot/stop_gradient/prevent_gradient) Created-by: Dazhou_Cao Commit-by: Dazhou_Cao Merged-by: cann-robot Description: 迁移5个conversion算子,包含op_graph、op_host、tests、CMakeLists和README See merge request: cann/ops-math!5245 | 1 month ago | |
fix(aicpu): 补齐手写json缺失的opInfo字段 Co-authored-by: liu-wei<lovline.liuwei@huawei.com> # message auto-generated for no-merge-commit merge: !6519 merge fix/aicpu-opinfo-metadata into master fix(aicpu): 补齐手写json缺失的opInfo字段 Created-by: liu-wei Commit-by: liu-wei Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因、所采取的方法。--> 对齐 AICPU 整包生成侧与 CANN 9.2.0 安装版 aicpu_kernel.json 的 opInfo 元数据,补齐 6 个算子的字段缺失: - conversion/identity/op_kernel_aicpu/identity.json - 补齐 formatAgnostic=True、opsFlag=OPS_FLAG_OPEN(对齐安装版) - kernelSo 指向修正(libnn → libmath)已由 master db84400e2 率先合入,本 PR rebase 后不再重复改动 - math/rsqrt/op_kernel_aicpu/rsqrt.json、math/sqrt/op_kernel_aicpu/sqrt.json:补齐 formatAgnostic=True(对齐安装版) - math/tile/op_kernel_aicpu/tile.json:补齐 opsFlag=OPS_FLAG_OPEN(对齐安装版及同族 TileWithAxis 注册写法) - math/pow/op_kernel_aicpu/pow.json:补齐 opsFlag=OPS_FLAG_CLOSE(对齐安装版) - math/greater_equal/op_kernel_aicpu/greater_equal_aicpu_def.cpp:补齐 TRUE_FORMAT_AGNOSTIC 覆盖(安装版比较家族 GreaterEqual/Less/NotEqual 均为 True、Equal 为 False,本仓 Less/NotEqual 已覆盖,唯独 GreaterEqual 漏了 formatAgnostic) 背景:三仓 AICPU 整包 json 与安装版逐算子逐字段比对([cann/ops-cv#1276](https://gitcode.com/cann/ops-cv/issues/1276))定位到上述差异。76 个 AICPU 算子中 5 个为手写 json(identity/rsqrt/sqrt/tile/pow),不走 ApplyMathAicpuDefaultCfg+ExtendCfgInfo 注册机制,迁移/手写时字段易漏,本 PR 逐一补齐;后续建议将手写 json 逐步迁移为 def 注册,从根本上规避。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> [cann/ops-cv#1276](https://gitcode.com/cann/ops-cv/issues/1276)(AICPU整包json与安装版json 算子定义差异梳理) ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> - 5 个手写 json 语法校验通过 - 76 个 AICPU 算子源码推导值与本机 CANN 9.2.0 安装版全量比对:修复后 6 个目标算子的 formatAgnostic/opsFlag 与安装版完全对齐,其余 3 项差异(Coordinates1DTo2D/OnesLike/TileWithAxis,整包侧演进项)保持不变 - trans_soc / find_value_by_key 等既有机制无行为影响(GreaterEqual 仅新增一行 ExtendCfgInfo 覆盖) - pre-commit 全钩子通过(json 校验 / clang-format / codespell / OAT 合规) - 重建验证:重新 configure(重编 71 个 opdef 生成 aicpu_kernel.ini)并构建 gen_aicpu_json_from_opdef,再生成 aicpu_math.json——76 算子齐全,6 个目标算子的 kernelSo/formatAgnostic/opsFlag 全部落盘正确(Identity kernelSo 由 libnn 修正为 libmath,三处 True/OPEN 补齐,GreaterEqual 经 def→ini→json 链路生效),全量比对无回归 - 符号核验:构建 libmath_aicpu_kernels.so(aarch64),RunCpuKernel 动态符号导出、"Identity" 注册名字符串在 so 内,非本仓 AICPU 算子名(Conv2D/ROIAlign 等)反证 0 命中 - 未执行 NPU 上板运行与完整打包封测(无硬件环境;CUST 注册加载行为需端到端图编译验证) - rebase 至 master f597aafa 后复核:剩余字段补齐改动与原 PR 逐行一致,master db84400e2 已含 kernelSo 修正(本 PR 该项变为无差异),pre-commit 全钩子通过 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新README.md文件。--> 无 ## 类型标签 <!-- [x] 表示选中 --> - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6519 | 18 days ago | |
feat: 迁移5个conversion算子(identity/identity_n/snapshot/stop_gradient/prevent_gradient) Co-authored-by: Dazhou_Cao<caodazhou@huawei.com> # message auto-generated for no-merge-commit merge: !5245 merge feature/migrate-conversion-ops into master feat: 迁移5个conversion算子(identity/identity_n/snapshot/stop_gradient/prevent_gradient) Created-by: Dazhou_Cao Commit-by: Dazhou_Cao Merged-by: cann-robot Description: 迁移5个conversion算子,包含op_graph、op_host、tests、CMakeLists和README See merge request: cann/ops-math!5245 | 1 month ago | |
【mc62】identity bugfix Co-authored-by: xufeng12121<1074805447@qq.com> # message auto-generated for no-merge-commit merge: !7314 merge ident_cm into master 【mc62】identity bugfix Created-by: xufeng12121 Commit-by: xufeng12121 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 1.identity 算子本意当DISABLE_AICPU 为true的时候只想过滤op_kernel_aicpu目录,因为op_kernel_aicpu目录存在恒为true,原校验会把op_host 和op_graph目录都过滤掉,导致用例执行找不到inferdatatype。 2.修改--> 严格限制只过滤op_kernel_aicpu目录 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> https://gitcode.com/cann/ops-math/issues/4680 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 测试验证通过 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!7314 | 4 days ago | |
feat: 迁移5个conversion算子(identity/identity_n/snapshot/stop_gradient/prevent_gradient) Co-authored-by: Dazhou_Cao<caodazhou@huawei.com> # message auto-generated for no-merge-commit merge: !5245 merge feature/migrate-conversion-ops into master feat: 迁移5个conversion算子(identity/identity_n/snapshot/stop_gradient/prevent_gradient) Created-by: Dazhou_Cao Commit-by: Dazhou_Cao Merged-by: cann-robot Description: 迁移5个conversion算子,包含op_graph、op_host、tests、CMakeLists和README See merge request: cann/ops-math!5245 | 1 month ago | |
docs: add English translations for markdown files Co-authored-by: jenny_xiang<jenny.xiang@huawei.com> # message auto-generated for no-merge-commit merge: !7085 merge docs/add-english-translations into master docs: add English translations for markdown files Created-by: jenny_xiang Commit-by: jenny_xiang Merged-by: cann-robot Description: ## 描述 新增仓库Markdown文档英文译稿(第一批,共23个被其他译稿引用的文件):根README_en.md、CONTRIBUTING_en.md、SECURITY_en.md,以及circular_pad_grad/identity/pad系列/reflection_pad3d_grad、examples四个示例、ge控制流算子(merge/switch/ref系列/temporary_variable)、segsum、aclStft、aclRfft1D、hans_encode/tests等译稿。 本批为后续批量英文文档提交做前置:本批文件合入master后,其余译稿中的仓内链接(均指向master已有文件或本批文件)即可生效,避免链接失效拦截。 ## 关联的Issue 无 ## 测试 文档类变更,无需算子测试;已通过链接有效性校验(第一批内全部相对链接仅指向master已有文件或本批新增文件),并逐篇完成翻译规范自查与语义审查。 ## 文档更新 新增23个英文译稿文件(*_en.md),不修改任何现有文件。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!7085 | 11 days ago |
Identity
English | 简体中文
Product Support Status
| Product | Supported |
|---|---|
| Ascend 950PR&950DT products | √ |
| Atlas A3 products | √ |
| Atlas A2 products | √ |
| Atlas 200I/500 A2 inference products | √ |
| Atlas inference products | √ |
| Atlas training products | √ |
Function Description
- Operator function: returns a tensor
ythat has the same shape and content as the input tensorx.
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| x | Input | Input tensor. | ALL | ND |
| y | Output | Tensor that has the same shape and content as the input tensor x. |
Same as x |
ND |
Constraint Description
- The shape, data type, and element content of
xandyremain consistent. - For supported data types, refer to the IR definitions in
identity_proto.h.
Invocation Description
| Invocation Method | Invocation Sample | Description |
|---|---|---|
| Graph-mode invocation | test_geir_identity, test_geir_identity_v2 | Invokes the Identity operator by building a graph through the operator IR. |