已合并
feat: migrate aicpu opdef json payloads to cpp defs #4390
zhaowenrui创建于 4月28日
feat: migrate aicpu opdef json payloads to cpp defs #4390
已合并
zhaowenrui创建于 4月28日
zhaowenrui
zhaowenrui
4月28日

描述

当前部分 AICPU 算子的 opdef 仍以 JSON 形式维护,构建时需要额外收集 JSON 文件,算子定义入口和维护方式不统一,不利于后续持续迁移和统一管理。

本次 PR 做了什么:

  1. 将 Elu、Assert、Identity、GatherV2、ReverseSequence、ScatterElements、TensorScatterUpdate、Where 等 AICPU 算子的 opdef 从 JSON 迁移为 C++ 定义文件。
  2. 新增 common/inc/aicpu/aicpu_op_def.h,补充 AICPU opdef 的公共声明。
  3. 调整相关 CMakeLists.txt 以及 cmake/opbuild.cmakecmake/symbol.cmake,支持 *_aicpu_def.cpp 的统一收集和构建。
  4. 新增 scripts/kernel/binary_script/aicpu_parser_ini_to_json.py,补齐相关脚本能力。

关联的Issue

测试

  1. 已核对 PR 对应提交为 08453e64840072937d255e0ad154825266439ba4
  2. 已重新执行 cmake -S /home/jiumao/open/ops-nn -B /home/jiumao/open/ops-nn/build_custom,完成 build_custom 配置刷新。
  3. 已执行 cmake --build /home/jiumao/open/ops-nn/build_custom --target gen_aicpu_json_from_opdef -j8,重新生成 build_custom/autogen/aicpu_kernel.inibuild_custom/aicpu_opdef_kernel.jsonbuild_custom/cust_aicpu_kernel.json
  4. 已手动执行 python3 scripts/kernel/binary_script/aicpu_parser_ini_to_json.py build_custom/autogen/aicpu_kernel.ini /tmp/ops_nn_aicpu_verify.json,输出 Compile op info cfg successfully.
  5. 已执行 python3 -m unittest tests/scripts/parser_ini_guard/test_aicpu_parser_ini_to_json.py6/6 用例通过。
  6. 已完成 before/after JSON 对比,8 个算子的金标准字段全部保留,无字段缺失。
  7. 已完成 I/O normalized vs canndev 校验,Elu、Assert、Identity、GatherV2、ReverseSequence、ScatterElements、TensorScatterUpdate、Where 与 canndev 基线一致。
  8. 本次按 skill 仅验证 custom 路径;未修改 parser_ini.py,因此 AICore before/after 回归按口径豁免。

文档更新

类型标签

  • Bug修复
  • 新特性
  • 性能优化
  • 文档更新
  • 其他,请描述:
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhaowenrui 的贡献)
zhaowenruizhaowenrui
4月28日 创建了 pull request,commit cfebd3b4
CANN-robot
CANN-robot成员
4月28日 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here
You can get sig-info at here


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
activation 陈琦, 范其瑞 (2/2) 陈琦 (1/1)
cmake 范其瑞, 陈琦 (2/2) 陈琦 (1/1)
common 陈琦, 范其瑞 (2/2) 陈琦 (1/1)
control 范其瑞, 陈琦 (2/2) 陈琦 (1/1)
index 陈琦, 范其瑞 (2/2) 陈琦 (1/1)
scripts 范其瑞, 陈琦 (2/2) 陈琦 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

zhaowenrui666, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robot成员
4月28日 添加了label:cann-cla/yes
CANN-robotCANN-robot成员
4月28日 将chenfeng61,FelixTang7,crystalhu,yangyang016,fanqirui,zhou-qilong,zhajianqing123,chenqi317,liu-wei,liubo75,tangweiwei2,zhangyuxiang0119,liujie12345678,Chen_HaoWen,wangyongguang,zhang-wu设为评审人
CANN-robotCANN-robot成员
4月28日 将chenfeng61,FelixTang7,crystalhu,yangyang016,fanqirui,zhou-qilong,zhajianqing123,chenqi317,liu-wei,liubo75,tangweiwei2,zhangyuxiang0119,liujie12345678,Chen_HaoWen,wangyongguang,zhang-wu设为审查人
此处折叠了161条消息 查看更多
chenqi317成员
5月18日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
5月18日 添加了label:lgtmapproved
CANN-robot
CANN-robot成员
5月18日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: 陈琦.
Reviewers who wrote a comment of /lgtm are: 陈琦, 范其瑞.

likedislike
CANN-robotCANN-robot成员
5月18日 关闭了关联的issue
CANN-robotCANN-robot成员
5月18日 合入了pull request