[0.13.0][cherry-pick][bugfix](cp) align max_context_chunk to cp_virtual_block_size#5782
Merged
wangxiyuan merged 1 commit intovllm-project:releases/v0.13.0from Jan 12, 2026
Merged
Conversation
Signed-off-by: QiuChunshuo <qiuchunshuo@huawei.com>
Contributor
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. |
Contributor
There was a problem hiding this comment.
Code Review
This pull request correctly fixes a bug in the chunked prefill scenario with context parallelism by ensuring max_context_chunk is properly aligned. The approach of updating self.block_size to be the least common multiple of its original value and cp_virtual_block_size is sound. I've added one suggestion to improve robustness by adding an assertion to prevent a potential division-by-zero error in case of a misconfiguration. Overall, this is a good fix.
yiz-liu
approved these changes
Jan 12, 2026
15b7cc2
into
vllm-project:releases/v0.13.0
21 of 22 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it?
In the chunked prefill scenario, CP needs to align the
max_context_chunkto thecp_virtual_block_size, but the current implementation only aligns it to theblock_size. For PD-disaggregation,cp_kv_cache_interleave_sizeis typically set equal toblock_size, in which casecp_virtual_block_size=block_size * dcp_size * pcp_size. Under specific conditions, this can lead to misalignment of certain chunks, subsequently triggering assertion check errors.ref. #5767
Does this PR introduce any user-facing change?
No