Skip to content

Conversation

@zeroRains
Copy link
Contributor

pcard-71500

TP4启动ERNIE4.5-0.3B模型时,卡在了等待kv_cache_manager启动的阶段。

主要原因:cache_config.model_cfg.num_key_value_heads的大小为2,tensor_parallel_size为4,在进行kv_cache切分的时候导致了最后算出的切分结果为0,最后初始化kv_cache的size为[gpu_block, 0, block_size, head_dim]初始化kv_cache失败。

解决方案:初始化KV Cache时,在计算好kv_num_head之后,对其和1取最大值,即kv_num_head = max(1, kv_num_head)

@paddle-bot
Copy link

paddle-bot bot commented Aug 29, 2025

Thanks for your contribution!

@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@f677c03). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff            @@
##             develop   #3717   +/-   ##
=========================================
  Coverage           ?   0.00%           
=========================================
  Files              ?       1           
  Lines              ?       1           
  Branches           ?       0           
=========================================
  Hits               ?       0           
  Misses             ?       1           
  Partials           ?       0           
Flag Coverage Δ
diff 0.00% <ø> (?)

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
Collaborator

@gongshaotian gongshaotian left a comment

Choose a reason for hiding this comment

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

LGTM

@Jiang-Jia-Jun Jiang-Jia-Jun merged commit f206474 into PaddlePaddle:develop Aug 30, 2025
14 of 17 checks passed
@zeroRains zeroRains deleted the kv_cache branch August 30, 2025 07:23
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.

4 participants