Skip to content

Conversation

Jialin
Copy link
Contributor

@Jialin Jialin commented Jul 22, 2025

Essential Elements of an Effective PR Description Checklist

  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Purpose

Address leftover comments in #21005

Test Plan

Only comments and asserts are changed, it should be safe as long as CI signals are clean.

Test Result

N/A

(Optional) Documentation Update

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 Jul 22, 2025
Copy link
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 refactors some comments and replaces if...raise error handling with assert statements. The comment cleanups improve readability.

However, one of the changes from raise ValueError to assert in popleft() is concerning. Using assert for checking if the queue is empty can be disabled in production environments, which would lead to more obscure errors later on. I've left a critical comment with a suggestion to revert this specific change to ensure robustness.

Comment on lines +249 to +252
assert (self.fake_free_list_head.next_free_block
is not self.fake_free_list_tail), "No free blocks available"
assert (self.fake_free_list_head.next_free_block is not None
), "fake_free_list_head.next_free_block should always exist"
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

Using assert to check for an empty queue is risky because assertions can be disabled in production (e.g., with python -O). This would suppress the error and likely lead to a more obscure crash later on. The original raise ValueError is a more robust way to handle this condition.

Additionally, this change removes the assertion assert self.num_free_blocks == 0, which was a valuable check to ensure the block count is synchronized with the free list's state. It's better to keep this for debugging purposes.

I recommend reverting this part of the change to maintain robustness and the helpful debugging assertion.

        if (self.fake_free_list_head.next_free_block
                is self.fake_free_list_tail
                or self.fake_free_list_head.next_free_block is None):
            assert self.num_free_blocks == 0, (
                f"num_free_blocks ({self.num_free_blocks}) is out of sync "
                "with the free list.")
            raise ValueError("No free blocks available")

@Jialin
Copy link
Contributor Author

Jialin commented Jul 23, 2025

Gentle nudge @njhill :)

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.

1 participant