Pull Request已成功合入, 合并人@CANN-robot
(感谢 Nice try 的贡献)变更摘要
该 PR 旨在移除 dynamic_rnn 系列算子面向 TensorFlow 框架的插件注册代码(源分支名为 revert-dynamic,属于回退性质改动),共删除 3 个源文件、244 行代码,无新增内容。删除后,BlockLSTM、DynamicRNN、DynamicRnn、DynamicRnnV2、DynamicRNNV2 等 TF 源算子将不再通过自定义算子插件映射到 GE 侧的 DynamicRNN/DynamicRNNV2 算子。
主要改动
- 删除
block_lstm_tf_plugin.cpp: 移除将 TFBlockLSTM算子注册映射为DynamicRNN(ImplyType::TVM)的插件,包括属性解析函数ParseParamsRNN(解析forget_bias、cell_clip、use_peephole)以及图构建函数ParseOpToGraphRNN(构建Cast、DynamicRNN子图并设置输入输出索引)。 - 删除
dynamic_rnn_tf_plugin.cpp: 移除 TF 原生DynamicRNN与DynamicRnn两个源算子类型的自定义算子注册,以及融合子图解析函数DynamicRNNParserParams(通过检测Transpose节点与lstm_cell/add/y常量节点恢复time_major、forget_bias属性并更新输入HWCN格式描述)。 - 删除
dynamic_rnnv2_tf_plugin.cpp: 移除DynamicRnnV2、DynamicRnnv2WithoutSeqlength、DynamicRnnv2WithSeqlength三个 TF 源算子到DynamicRNN/DynamicRNNV2的注册逻辑,其中ParseParamsDynamicRNN中设置is_misplaced属性的行为也随之移除。


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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| matmul | ✅ 陈琦, 汤平川 (2/2) | ✅ 陈琦 (1/1) |
| rnn | ✅ 汤平川, 陈兴宇, 陈琦 (3/2) | ✅ 陈兴宇, 汤平川 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
Nice_try, thanks for your pull request. All authors of the commits have signed the CLA. 👍


您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!


/lgtm
/approve


/lgtm
/approve


描述
改动原因
dynamic_rnn / dynamic_rnnv2 的 TensorFlow 框架插件此前迁移到本仓后,会引发部分用例 ATC 失败,
本次先行下线处理:删除通过 REGISTER_CUSTOM_OP 注册 TF 源算子映射的 3 个 *_tf_plugin.cpp(共 -244 行)。
同时修复 batch_mat_mul_v3 下 einsum TF 插件的注册:Einsum 算子具有变长(DYNAMIC_INPUT)输入,
原 AutoMappingByOpFn 静态映射无法承载动态输入个数,改用动态映射接口 ParseParamsFn + AutoMappingFnDynamic 完成映射。
改动方法
REGISTER_CUSTOM_OP("DynamicRNN").OriginOpType("BlockLSTM"),将 TF BlockLSTM 解析为 DynamicRNN(cell_type=BLOCKLSTM);
ParseParamsRNN 透传 forget_bias/cell_clip/use_peephole;ParseOpToGraphRNN 按输入索引重建子图并映射输出。
注册 TF DynamicRNN/DynamicRnn → DynamicRNN;FusionParseParamsFn(DynamicRNNParserParams)基于融合子图节点解析:
检测 Transpose 节点推断 time_major=false,从 Const 节点(lstm_cell/add/y)解析 forget_bias,输入 1 format 置 HWCN。
注册 TF DynamicRnnV2/DynamicRnnv2WithoutSeqlength/DynamicRnnv2WithSeqlength → DynamicRNN/DynamicRNNV2,设置 is_misplaced=true。
内部由 AutoMappingByOpFn(op_src, op) 改为 AutoMappingFnDynamic(op_src, op, value),value["in"]=("x","N");
依据代码:CANN Einsum 算子原型为 DYNAMIC_INPUT(x) + REQUIRED_ATTR(equation) + REQUIRED_ATTR(N)
(common/inc/op_graph/op_nn_proto_extend.h),映射表将 TF 源输入 "in" 映射到动态输入 "x" 并同步数量属性 "N",
与 index/concat_offset/framework/concat_offset_tf_plugin.cpp 处理动态输入/输出个数的用法一致。
构建侧无需改动:cmake/func.cmake 中 add_tf_plugin_sources() 通过 file(GLOB FRAMEWORK_DIR/*_tf_plugin.cpp)
自动收集编译,删除即不再参与构建;framework/CMakeLists.txt 仅调用 add_onnx_plugin_sources(),
保留的 ONNX 插件 npu_lstm_onnx_plugin.cpp、npu_lstm_cell_onnx_plugin.cpp 不受影响。
关联的Issue
https://gitcode.com/cann/ops-nn/issues/5619
测试
未新增测试用例。静态检查:仓库内无其他文件显式引用被删除的插件符号或文件名(git grep 验证),
tf_plugin 源文件由 CMake glob 自动收集,删除后无构建残留引用。
文档更新
无。
类型标签
AI/Agent生成声明