Skip to content

[KVCache] Storage cache supports c8 model#6298

Merged
juncaipeng merged 6 commits intoPaddlePaddle:developfrom
juncaipeng:support_c8_0
Feb 6, 2026
Merged

[KVCache] Storage cache supports c8 model#6298
juncaipeng merged 6 commits intoPaddlePaddle:developfrom
juncaipeng:support_c8_0

Conversation

@juncaipeng
Copy link
Collaborator

@juncaipeng juncaipeng commented Feb 2, 2026

Motivation

全局cache池化支持c8模型

Modifications

Cache读写模块

Usage or Command

xxx

Accuracy Tests

xxx

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 Feb 2, 2026

Thanks for your contribution!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

此 PR 为存储缓存添加了对 c8 模型的支持,主要是通过实现 block_wise_fp8 量化缓存的 scale 数据的读写功能。

Changes:

  • 扩展 mooncake_store 的 query 方法以支持可选的 scale keys 参数
  • 在 CacheTransferManager 中添加 cache scale 支持,包括 scale buffer 的初始化和管理
  • 更新 CUDA kernel 中的 cache_block_stride 计算以支持不同维度的缓存布局

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
fastdeploy/cache_manager/transfer_factory/mooncake_store/mooncake_store.py 添加 k_scale_keys 和 v_scale_keys 参数到 query 方法,支持检查 scale 数据的存在性
fastdeploy/cache_manager/cache_transfer_manager.py 实现 block_wise_fp8 的完整支持,包括 scale buffer 初始化、读写操作中的 scale 数据处理
custom_ops/gpu_ops/swap_cache_layout.cu 重构 cache_block_stride 计算以支持不同形状的缓存布局(包括 scale 布局)

@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2026

Codecov Report

❌ Patch coverage is 8.18182% with 101 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@39dc4b0). Learn more about missing BASE report.

Files with missing lines Patch % Lines
fastdeploy/cache_manager/cache_transfer_manager.py 8.42% 84 Missing and 3 partials ⚠️
.../transfer_factory/mooncake_store/mooncake_store.py 6.66% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #6298   +/-   ##
==========================================
  Coverage           ?   67.02%           
==========================================
  Files              ?      387           
  Lines              ?    51493           
  Branches           ?     8030           
==========================================
  Hits               ?    34513           
  Misses             ?    14508           
  Partials           ?     2472           
Flag Coverage Δ
GPU 67.02% <8.18%> (?)

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 11 comments.

Copy link
Collaborator

@EmmonsCurse EmmonsCurse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~后续辛苦补充 cache_transfer_manager.py 相关单测~

@juncaipeng juncaipeng merged commit d6b3c72 into PaddlePaddle:develop Feb 6, 2026
41 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants