Pull Request已成功合入, 合并人@CANN-robot
(感谢 Nice try 的贡献)变更摘要
本 PR 为 aclnnThnnFusedLstmCell 接口新增 ST(系统测试)用例:在 rnn/thnn_fused_lstm_cell/tests/st/aclnnThnnFusedLstmCell/ 目录下新增用例清单文件 all_aclnnThnnFusedLstmCell.json 与 CPU golden 执行插件 executor_aclnnThnnFusedLstmCell.py。执行插件通过 atk 框架注册 thnn_fused_lstm_cell_api,实现了 LSTM cell 的前向计算公式(gates = inputGates + hiddenGates + b_ih + b_hh,按 [i, f, g, o] 切分并分别施加 sigmoid/tanh,最终输出 hy、cy、storage),仅支持 CPU(golden)路径,低精度输入会先转 fp32 计算再转回原 dtype,与 NPU 内核 cast-in/fp32 计算/cast-out 的行为对齐,以保证混合容差比对的准确性。
主要改动
- 新增 ST 执行插件:在
executor_aclnnThnnFusedLstmCell.py中定义ThnnFusedLstmCellApi类,继承BaseApi并通过@register("thnn_fused_lstm_cell_api")注册,__call__方法实现 CPU golden 计算并返回(hy, cy, storage)三元组。 - 输入解析逻辑:静态方法
_extract_inputs按名称从kwargs优先、args兜底提取inputGates、hiddenGates、cx、inputBias、hiddenBias五个输入,解析失败时抛出ValueError。 - 偏置校验与数值精度处理:校验
inputBias与hiddenBias必须同存同缺(与 aclnn 入口 C++ 校验一致),并对低精度输入统一转torch.float32计算后回转原 dtype,且对非 CPU 设备抛出RuntimeError。 - 新增用例清单文件:添加
all_aclnnThnnFusedLstmCell.json作为 ST 用例清单配置(本补丁中无具体内容,仅新增空文件)。


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 |
|---|---|---|
| rnn | ✅ 汤平川, 钱泽洪 (2/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. 👍


/approve


描述
本 PR 为 thnn_fused_lstm_cell 算子新增 ST(系统测试)用例:基于 ATK 测试框架,新增 208 条 aclnnThnnFusedLstmCell 用例配置及对应的 CPU golden 执行插件。
改动内容
关联的Issue
测试
文档更新
无
类型标签
AI/Agent生成声明