Skip to content

Conversation

@yannicks1
Copy link
Collaborator

@yannicks1 yannicks1 commented Jul 25, 2025

[CB] Refactoring/Cleaning up prepare_prompt/decode

As prefills for batch size > 1 have been de-prioritized, this PR cleans up the code considerable and makes it more readable. Code readability becomes increasingly important with the upcoming optimization for homogeneous tkv (e.g. #262 )

@github-actions
Copy link

👋 Hi! Thank you for contributing to vLLM support on Spyre.
Just a reminder: Make sure that your code passes all the linting checks, otherwise your PR won't be able to be merged. To do so, first install the linting requirements, then run format.sh and commit the changes. This can be done with uv directly:

uv sync --frozen --group lint --active --inexact

Or this can be done with pip:

uv pip compile --group lint > requirements-lint.txt
pip install -r requirements-lint.txt
bash format.sh

Now you are good to go 🚀

# current decode batch (Spyre constraint)
left_padding = self.tkv - prompt_len

# Reserve the maximal number of blocks used to serve current sequence
Copy link
Collaborator

@sducouedic sducouedic Jul 25, 2025

Choose a reason for hiding this comment

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

maybe? I was confused by "maximal" and "current"

Suggested change
# Reserve the maximal number of blocks used to serve current sequence
# Reserve the number of blocks required to serve this new sequence

Copy link
Collaborator

@sducouedic sducouedic left a comment

Choose a reason for hiding this comment

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

LGTM

Was so nice to read!

Signed-off-by: Yannick Schnider <[email protected]>
@yannicks1 yannicks1 enabled auto-merge (squash) July 25, 2025 16:08
@github-actions github-actions bot added the ready label Jul 25, 2025
@yannicks1 yannicks1 merged commit bbfae07 into main Jul 25, 2025
15 of 19 checks passed
@yannicks1 yannicks1 deleted the ysc-cleanup-prepare-prefill branch July 25, 2025 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants