Skip to content

[Optimization] Decode attention support#5767

Open
lizhenyun01 wants to merge 14 commits intoPaddlePaddle:developfrom
lizhenyun01:decode_attention
Open

[Optimization] Decode attention support#5767
lizhenyun01 wants to merge 14 commits intoPaddlePaddle:developfrom
lizhenyun01:decode_attention

Conversation

@lizhenyun01
Copy link
Collaborator

@lizhenyun01 lizhenyun01 commented Dec 25, 2025

Motivation

  • attention优化及重构第一部分:
    • attention重构,合并投机解码/非投机解码分支,消除冗余逻辑
    • 拆分decoder_write_cache_with_rope为单独算子,便于维护
    • 新增decode attention backend,当前只支持PD分离下D节点
    • 优化decode attention C8kernel性能,优化后在group_size=14下单步投机场景性能提升5%-113%


  • TODO:
    • ROPE,write_cache重构及投机解码等分支融合
    • C16 C4支持
    • 单测完善
    • backend逐步替换append_attention

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

@paddle-bot
Copy link

paddle-bot bot commented Dec 25, 2025

Thanks for your contribution!

heavengate pushed a commit that referenced this pull request Jan 9, 2026
* [Optimizer] Support decode attention static c8 op

* [Feature] Support decode attention backend

* code style fix
@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 35.21127% with 92 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@fb37423). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ayers/attention/decode_append_attention_backend.py 21.90% 81 Missing and 1 partial ⚠️
fastdeploy/platforms/cuda.py 0.00% 2 Missing and 1 partial ⚠️
fastdeploy/spec_decode/mtp.py 0.00% 1 Missing and 1 partial ⚠️
fastdeploy/worker/gpu_model_runner.py 0.00% 1 Missing and 1 partial ⚠️
...cutor/layers/attention/ops/config_for_attention.py 85.71% 0 Missing and 1 partial ⚠️
...or/layers/attention/ops/decode_append_attention.py 88.88% 0 Missing and 1 partial ⚠️
...ers/attention/ops/decoder_write_cache_with_rope.py 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #5767   +/-   ##
==========================================
  Coverage           ?   66.55%           
==========================================
  Files              ?      389           
  Lines              ?    51364           
  Branches           ?     8005           
==========================================
  Hits               ?    34186           
  Misses             ?    14720           
  Partials           ?     2458           
Flag Coverage Δ
GPU 66.55% <35.21%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants