Skip to content

[bugfix](cp) align max_context_chunk to cp_virtual_block_size#5780

Closed
pisceskkk wants to merge 2 commits intovllm-project:releases/v0.13.0from
pisceskkk:bugfix_cp
Closed

[bugfix](cp) align max_context_chunk to cp_virtual_block_size#5780
pisceskkk wants to merge 2 commits intovllm-project:releases/v0.13.0from
pisceskkk:bugfix_cp

Conversation

@pisceskkk
Copy link
Copy Markdown
Contributor

What this PR does / why we need it?

In the chunked prefill scenario, CP needs to align the max_context_chunk to the cp_virtual_block_size, but the current implementation only aligns it to the block_size. For PD-disaggregation, cp_kv_cache_interleave_size is typically set equal to block_size, in which case cp_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

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a bug in chunked prefill scenarios with context parallelism, where max_context_chunk was misaligned. The fix correctly adjusts self.block_size to be the least common multiple of its original value and cp_virtual_block_size. This ensures max_context_chunk is properly aligned to cp_virtual_block_size, preventing potential assertion errors. The change is logically sound and correctly placed within the context-parallel metadata builder.

leo-pony and others added 2 commits January 12, 2026 09:00
…als document (vllm-project#5756)

### What this PR does / why we need it?
Align multi-node nightly test paramter with tutorials documents.

### Does this PR introduce _any_ user-facing change?
NA

### How was this patch tested?
Test locally and nighly e2e multi-node test cases.

- vLLM version: v0.13.0
- vLLM main:
vllm-project/vllm@2f4e654

---------

Signed-off-by: leo-pony <nengjunma@outlook.com>
Signed-off-by: QiuChunshuo <qiuchunshuo@huawei.com>
@pisceskkk pisceskkk closed this Jan 12, 2026
@pisceskkk pisceskkk deleted the bugfix_cp branch January 13, 2026 03:48
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