Pull Request已成功合入, 合并人@ascend-robot
(感谢 wenjiali_sh 的贡献)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 |
|---|---|---|
| repo-Ascend/MindIE-SD | ✅ guowenna1, 蓝王力 (2/2) | ✅ guowenna1 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
wenjiali_sh, thanks for your pull request. All authors of the commits have signed the CLA. 👍


变更摘要
本次 PR 新增了 fused_infer_attention_score(融合推理注意力机制)算子的 C++ ACLNN API 实现文件及其算子图模式(op_graph)降级回退逻辑。主要包括 V4 和 V5 两个版本的入口点实现、内部公共辅助头文件,以及基于 V5 接口的图模式回退核心代码,用于将 FIA 算子迁移至 MindIE 平台。
主要改动
-
新增
aclnn_fused_infer_attention_score_v4入口点:提供aclnnFusedInferAttentionScoreV4GetMaxWorkspaceSize、aclnnFusedInferAttentionScoreV4GetWorkspaceSize和aclnnFusedInferAttentionScoreV4三个接口,并对 Ascend950(DAV_3510)平台显式返回不支持错误;通过FakeArray处理可选的aclIntArray类型输入,最终委托给aclnnInnerEagleFusedInferAttentionScore*内部函数执行。 -
新增
aclnn_fused_infer_attention_score_v5入口点:提供aclnnEagleFusedInferAttentionScoreV5GetMaxWorkspaceSize、aclnnEagleFusedInferAttentionScoreV5GetWorkspaceSize和aclnnEagleFusedInferAttentionScoreV5三个接口,相比 V4 新增qStartIdxOptional、kvStartIdxOptional、pseType参数,并引入CheckTensorContiguous对 key/value 等张量的连续性进行校验,通过弱符号NnopbaseSupportTensorV2判断 opbase 版本以决定是否容忍非连续张量。 -
新增
fused_infer_attention_score_inner.h公共辅助头文件:声明TensorPreProcess、PrefixTensorPreProcess、FakeArray、FusedInferAttentionScoreProcessSoftmaxLse、CheckKVContiguous等跨版本共用的工具函数,以及弱符号NnopbaseSupportTensorV2,供 V4/V5 入口点复用。 -
新增
fallback_fused_infer_attention_score.cpp图模式回退逻辑:实现FusedInferHostExecuteFunc函数,从OpExecuteContext中提取 29 个输入张量和 15 个属性参数,处理actualSeqLengths等可选序列信息,并对sparseMode在 [10, 14] 区间做特殊转换(减 10 并将innerPrecise置 0),最终通过EXEC_OPAPI_CMD宏调用aclnnEagleFusedInferAttentionScoreV5完成降级计算,并使用IMPL_OP(EagleFusedInferAttentionScore)注册算子。


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


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


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


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


Which issue(s) this PR fixes or accomplishes
Fix part of #ISSUE 198
Purpose
新增用于 fused_infer_attention_score(融合推理注意力机制)的 C++ ACLNN 算子 API 实现文件,以及算子图模式(op_graph)下的降级回退核心逻辑。
本次新增的文件包括:
Test Plan
Test Report
[请在此处粘贴本地编译通过的日志文本或 build_ops.sh 成功执行的终端截图]