Skip to content

Conversation

@dsocek
Copy link
Contributor

@dsocek dsocek commented Oct 20, 2025

What does this PR do?

During engine warmup, the max decode block bucket size VLLM_DECODE_BLOCK_BUCKET_MAX is capped based on the available max_blocks. However, the minimum bucket size VLLM_DECODE_BLOCK_BUCKET_MIN was not similarly constrained, which could lead to a configuration where VLLM_DECODE_BLOCK_BUCKET_MIN > VLLM_DECODE_BLOCK_BUCKET_MAX (or even > max_blocks). This invalid state causes runtime error.

This PR ensures that VLLM_DECODE_BLOCK_BUCKET_MIN is automatically clamped to max_blocks (and not greater than VLLM_DECODE_BLOCK_BUCKET_MAX) during initialization, preventing invalid bucket size configurations.

@github-actions
Copy link

🚧 CI Blocked

The main CI workflow was not started for the following reason:

Your branch is behind the base branch. Please merge or rebase to get the latest changes.

@dsocek dsocek force-pushed the fix_dec_bucket_blk_min_adjustment branch from b04364f to 99bdd52 Compare October 20, 2025 20:21
@github-actions
Copy link

✅ CI Passed

All checks passed successfully against the following vllm commit:
1c691f4a714981bd90ce536cbd00041d3e0aa7bb

logger().info(
f'VLLM_DECODE_BLOCK_BUCKET_MIN={decode_block_bucket_cfg[0]} is higher than max_blocks={max_blocks}. Your configuration VLLM_DECODE_BLOCK_BUCKET_MIN={decode_block_bucket_cfg[0]} will be overwritten to VLLM_DECODE_BLOCK_BUCKET_MIN={max_blocks - decode_block_bucket_cfg[1]}'
)
decode_block_bucket_cfg[0] = max_blocks - decode_block_bucket_cfg[1]
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need also to check that this value is >0 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a clip

@dsocek dsocek force-pushed the fix_dec_bucket_blk_min_adjustment branch from 99bdd52 to af4e4fb Compare October 24, 2025 00:22
@github-actions
Copy link

🚧 CI Blocked

The main CI workflow was not started for the following reason:

Your branch is behind the base branch. Please merge or rebase to get the latest changes.

@dsocek dsocek force-pushed the fix_dec_bucket_blk_min_adjustment branch from af4e4fb to a40ba66 Compare October 24, 2025 14:51
@dsocek dsocek requested a review from mgonchar October 24, 2025 14:56
@dsocek
Copy link
Contributor Author

dsocek commented Oct 24, 2025

@xuechendi @iboiko-habana can you help review this PR? Its a fix that unblocks certain validations

f'VLLM_DECODE_BLOCK_BUCKET_MAX={decode_block_bucket_cfg[2]} is higher than max_blocks={max_blocks}. Your configuration VLLM_DECODE_BLOCK_BUCKET_MAX={decode_block_bucket_cfg[2]} will be overwritten to VLLM_DECODE_BLOCK_BUCKET_MAX={max_blocks}'
)
decode_block_bucket_cfg[2] = max_blocks
if decode_block_bucket_cfg[0] > max_blocks:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is it indented under if decode_block_bucket_cfg[2] > max_blocks:?

Copy link
Contributor Author

@dsocek dsocek Oct 30, 2025

Choose a reason for hiding this comment

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

It only need to run this conditional check if max has been potentially modified and set to max_blocks. If indented to outer scope, it can work too but would unnecessarily spend cycles.

)
decode_block_bucket_cfg[2] = max_blocks
if decode_block_bucket_cfg[0] > max_blocks:
decode_block_bucket_min = max(1, max_blocks - decode_block_bucket_cfg[1])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we subtracting step from max blocks? We don't we just change it to max blocks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately if min is set to max_blocks it causes error. Setting to 1 step before max resolves the issue.

@dsocek
Copy link
Contributor Author

dsocek commented Nov 5, 2025

@adobrzyn @xuechendi can you help review this PR? We keep on having to apply this patch over and over again :)

@dsocek dsocek requested a review from adobrzyn November 10, 2025 17:05
@dsocek
Copy link
Contributor Author

dsocek commented Nov 10, 2025

@kzawora-intel Hi Konrad, do you mind helping to review or assign a reviewer to this small patch? Thank you

Copilot AI review requested due to automatic review settings November 13, 2025 09:11
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions
Copy link

✅ CI Passed

All checks passed successfully against the following vllm commit:
2dacd5739409847e91299e7747a142e200fdff6c

@adobrzyn adobrzyn merged commit 271ce85 into vllm-project:main Nov 13, 2025
38 checks passed
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