已合并
迁入 MXFP8 attention prologue 算子 #108
迁入 MXFP8 attention prologue 算子 #108
已合并
杨亚杰创建于 29 天前
杨亚杰
29 天前

PR功能描述 / 为什么需要这个合入:

新增 MXFP8 attention prologue 融合算子,在一个 kernel 中完成 QA/KV 投影、RMSNorm、QR 动态量化、QB 投影、尾部 RoPE 和 KV cache 原地更新,支持 decode/prefill 场景。

同步迁入独立 CPU golden、FP64 精度复核与用例运行工具,新增 4 个 pytest 冒烟用例并接入 CI,补充算子说明、导航和更新日志,便于统一维护与回归验证。

该PR关联的issue

暂无关联 issue。

希望检视人员了解:

算子实现与源仓库保持一致,本次为仓库迁移与测试接入。
测试目录保留必要代码,验证报告及运行产物已移出代码仓库。
本次验证覆盖 4 个正向用例,未进行全量回归和性能复测;文档中的历史性能数据已注明来源。

改动类型 / Change Type

Bug 修复 / Bug Fix
新功能 / New Feature
性能优化 / Performance
代码重构 / Refactoring
文档更新 / Documentation
测试相关 / Test
其它 / Other

测试信息 / Testing

在 Ascend950PR_9599 上显式限制为 32 Cube / 64 Vector,通过仓库 CI 入口完成验证:

bash scripts/ci/run_tests.sh --ops=attn_prologue --mode=npu

场景 用例 结果
━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━ ━━━━━━
Decode B=1,S=1,T=1 PASS
───────── ───────────────────── ──────
Decode B=12,S=6,T=72 PASS
───────── ───────────────────── ──────
Prefill B=1,S=1024,T=1024 PASS
───────── ───────────────────── ──────
Prefill B=1,S=2048,T=2048 PASS

共 4 passed,0 failed,0 skipped。完整输出对照 CPU golden,并进行 FP64 值域复核:

最大 Q 超差比例为 0.009741%,低于 0.1% 门限。
Q 非有限值、QR/KV 硬失配及未命中 cache 改写均为 0。
Python 语法、git diff --check、pytest 收集和 CI 变更映射检查通过。
单元测试通过 / UT passed
集成测试通过 / ST passed
人工验证通过 / Manual verified

检查清单 / Checklist

代码符合规范 / Code follows style guide
测试添加并通过 / Tests added and passed
文档已更新 / Docs updated if needed
无硬编码敏感信息 / No secrets hardcoded
提交信息符合规范 / Commit message follows convention

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 杨亚杰 的贡献)
杨杨亚杰
29 天前 创建了 pull request,commit f6f065de
CANN-robot
CANN-robot成员
29 天前 评论:

Hi @yangyajie, welcome to submitting your first PR to cannbot-dsl!

PR Merge Steps

1. CLA Signing

If the current PR label includes cann-cla/yes, it means you have signed the CLA and can proceed to the next step. If the label includes cann-cla/no, please sign the CLA first. If you have any questions, please refer to the FAQ.

2. CI Check

Please comment /compile to trigger the CI pipeline check. If the CI run is successful, the PR will be tagged with ci-pipeline-passed and you can proceed to the next step. If the CI run fails, the PR will be tagged with ci-pipeline-failed, please check the CI logs to fix the issues in the PR. If you have any questions, please refer to the FAQ.

3. Code Review

After CI passes, please refer to the PR Approval Progress and proactively @ the committers in the table to review the code. After approval, committers will comment /lgtm and /approve. Once the lgtm and approved labels are successfully added, the PR will be merged automatically.

likedislike
CANN-robotCANN-robot成员
29 天前 添加了label:ai-co-authored
CANN-robotCANN-robot成员
29 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
29 天前 评论:

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
repo-cann/cannbot-dsl ✅ yang-jiwei, liujun2025 (2/2) ✅ yang-jiwei, liujun2025 (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
此处折叠了155条消息 查看更多
yang-jiwei成员
29 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
29 天前 添加了label:approved
liujun2025成员
29 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
29 天前 添加了label:lgtm
CANN-robotCANN-robot成员
29 天前 合入了pull request