Pull Request已成功合入, 合并人@CANN-robot
(感谢 nextyale 的贡献)变更摘要
本 PR 主要为 SingleLayerLstmGrad 算子增加 Ascend 950(ascend950)芯片支持:新增针对 ascend950 的算子二进制配置文件,并在算子 AICore 配置与全局算子编译配置中注册 ascend950,覆盖 float32 与 float16 两种精度。
主要改动
- 新增
ascend950算子二进制配置:新增rnn/single_layer_lstm_grad/op_host/config/ascend950/single_layer_lstm_grad_binary.json,定义SingleLayerLstmGrad在ascend950上的SingleLayerLstmGrad_fp32与SingleLayerLstmGrad_fp16两套配置,包含输入(x、w、b、y、init_h、init_c、h、c、dy、dh、dc、i、j、f、o、tanhct、seq_length)、输出(dw、db、dx、dh_prev、dc_prev)及属性(direction、gate_order)定义。 - 算子 AICore 配置注册
ascend950:在single_layer_lstm_grad_def.cpp中新增this->AICore().AddConfig("ascend950"),使该算子具备 Ascend 950 芯片的配置入口。 - 全局编译配置扩展计算单元:在
scripts/kernel/binary_config/ascendc_config.json中将SingleLayerLstmGrad的compute_units由["ascend910b", "ascend910_93"]调整为包含ascend950的配置,使其纳入 Ascend 950 的算子编译范围。


代码审查
审查完成
我逐一审查了全部 4 个改动文件,结论如下:
| 文件 | 结论 |
|---|---|
rnn/single_layer_lstm_grad/op_host/config/ascend950/single_layer_lstm_grad_binary.json |
无问题。JSON 结构合法,键名(op_type/op_list/bin_filename/inputs/outputs/attrs/paramType 等)与既有 ascend910b/ascend910_93 配置完全一致,输入/输出顺序与 single_layer_lstm_grad_def.cpp 的算子定义一致,无拼写或 schema 错误。 |
rnn/single_layer_lstm_grad/op_host/single_layer_lstm_grad_def.cpp |
无问题。新增的 this->AICore().AddConfig("ascend950"); 与既有 ascend910b/ascend910_93 写法及全仓库 ascend950 命名约定一致。 |
rnn/single_layer_lstm_grad/op_kernel/CMakeLists.txt |
无问题。COMPUTE_UNITS 追加 ascend950 与算子注册、二进制配置保持一致,kernel 为通用源文件,不涉及按架构分源。 |
scripts/kernel/binary_config/ascendc_config.json |
发现 1 个问题(P1):compute_units 数组元素逗号误写在引号内,"ascend910_93, ascend950" 成为单个无效字符串,ascend950 未被正确注册、且相对旧配置丢失了独立的 ascend910_93 元素。 |
发现统计
- P0:0
- P1:1
- P2:0
- P3:0
总体风险判断
本次改动整体是标准的“新增算子在 ascend950 平台的支持”流程(新增二进制配置 + 注册 config + 追加 COMPUTE_UNITS),除 ascendc_config.json 中一处 compute_units 逗号误置外无其他问题。该逗号误置直接破坏了本次 PR 的核心目标(ascend950 未被正确注册),并可能连带丢失 ascend910_93 的注册,属于需要修复的功能性缺陷;修复方式明确(将逗号移出引号、拆为两个独立元素),风险可控。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 1 |
| 🟡 建议 | 0 |
⛔ 需要修改


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.
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 |
|---|---|---|
| */*/README.md | ✅ 汤平川, 吴瑶, 唐玮玮 (3/2) | ✅ 吴瑶 (1/1) |
| */*/docs/acl*.md | ✅ 吴瑶, 唐玮玮, 汤平川 (3/2) | ✅ 吴瑶 (1/1) |
| */*/op_host/*_def.cpp | ✅ 王永光, 唐玮玮, 汤平川 (3/2) | ✅ 王永光 (1/1) |
| rnn | ✅ 汤平川, 唐玮玮 (2/2) | ✅ 汤平川 (1/1) |
| scripts | ✅ 唐玮玮, 汤平川 (2/2) | ✅ 唐玮玮 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
nextyale, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/approve


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


描述
support lstm grad a5
测试
200泛化用例已通过
文档更新
类型标签