Skip to content

Conversation

@heheda12345
Copy link
Collaborator

@heheda12345 heheda12345 commented Feb 27, 2025

This pr cleans up the BlockTable class by:

  1. removing max_model_len which is not used in this class
  2. removing start argument in append_row and get this value from self.num_blocks_per_row
  3. moving block_id to the first argument of append_row and add_row.

2 & 3 are preparations of hybrid memory allocator (#11382). For hybrid models, different layers will have different BlockTable instances, and I want to broadcast the operations on BlockTable to all these BlockTable instances with exact the same arguments except different block_id, so I need (2) as the start can be different and (3) to support passing different block_id values.

Split from #13296

Signed-off-by: Chen Zhang <zhangch99@outlook.com>
@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added the v1 label Feb 27, 2025
Copy link
Collaborator

@comaniac comaniac left a comment

Choose a reason for hiding this comment

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

LGTM

if not block_ids:
return
num_blocks = len(block_ids)
start = self.num_blocks_per_row[row_idx]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not very familiar with this. Does this always equal to len(req_state.block_ids) - len(req_data.new_block_ids) if not 0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think so, and added some tests for the checking block_table is the same as req_state.block_ids

Signed-off-by: Chen Zhang <zhangch99@outlook.com>
@comaniac comaniac added the ready ONLY add when PR is ready to merge/full CI is needed label Feb 28, 2025
@comaniac comaniac enabled auto-merge (squash) February 28, 2025 17:39
@comaniac comaniac merged commit e7bd944 into vllm-project:main Feb 28, 2025
47 checks passed
Akshat-Tripathi pushed a commit to krai/vllm that referenced this pull request Mar 3, 2025
Signed-off-by: Chen Zhang <zhangch99@outlook.com>
lulmer pushed a commit to lulmer/vllm that referenced this pull request Apr 7, 2025
Signed-off-by: Chen Zhang <zhangch99@outlook.com>
Signed-off-by: Louis Ulmer <ulmerlouis@gmail.com>
shreyankg pushed a commit to shreyankg/vllm that referenced this pull request May 3, 2025
Signed-off-by: Chen Zhang <zhangch99@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants