Merged
feat(deepseek_v4): Add new fused LIFA operator for DeepSeek-v4 #744
yasakova_anastasiaAdd on Sep 25
feat(deepseek_v4): Add new fused LIFA operator for DeepSeek-v4 #744
Merged
Merged fromlifilim/pypto-gymfused_LIFAintocann/pypto-gymmaster
Pull Request has been successfully merged by CANN-robot.
(Thank you for yasakova_anastasia's contribution.)Sep 25 Created pull request, commit 94af7f9c
Sep 25 Added label: cann-cla/yes
CANN-robot
Sep 25 Comments:
Sep 25 Comments:
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/pypto-gym | ✅ li-shengxian3, liulufang_gitcode (2/2) | ✅ li-shengxian3, liulufang_gitcode (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
yasakova_anastasia, thanks for your pull request. All authors of the commits have signed the CLA. 👍


CANN-robot
Sep 25 Comments:
Sep 25 Comments:
Sep 25 Modify description of pull request
80 messages are collapsed here。 See more
7 hours ago Removed label: ci-pipeline-failed
7 hours ago Added label: ci-pipeline-running
7 hours ago Removed label: ci-pipeline-running
7 hours ago Added label: ci-pipeline-passed
7 hours ago Merged pull request
Was This PR authored or co-authored using generative AI tooling?
[x] No
[ ] Yes
__1. AI Agent :
__2. AI Model :
__3. Prompt :
What this PR does / why we need it:
Adds
QuantLightningIndexerFlashAttention, a PyPTO operator fusing the three sequential stages of the DeepSeek V4 lightning-attention decode path:q,q_scale,weights;topk_res;topk_res, sliding-window concat, softmax with attention sink, PV ->attention_out.Performance
Model-level decode, per-token latency:
Swapping three PyPTO operators for the fused one removes 6.08 ms per token (-15.7%) and closes the gap to the AscendC baseline from 29% to 16%. Dropped
into the AscendC stack, the fused operator matches the reference (1.01x).
HW: 4x Ascend910C
Which issue this PR fixes
Resolves #432
Special notes for your reviewer:
Change Type / 改动类型
Testing / 测试信息
Checklist / 检查清单