-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[Misc] Misc code cleanup/simplification #23304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Minor code cleanup done while working on other items. Signed-off-by: Nick Hill <[email protected]>
generator = None | ||
|
||
if pooling_params: | ||
assert (task := pooling_params.task) is not None, ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is inadvisable since assertions can be disabled, they shouldn't contain actual program logic.
There was a problem hiding this 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 introduces several code cleanups and simplifications across different files. The changes generally improve readability and efficiency, such as removing redundant parentheses, using more Pythonic checks for empty collections, and refactoring variable usage to avoid repeated lookups. However, I've identified a critical issue in vllm/v1/worker/gpu_model_runner.py
where a refactoring error seems to have introduced a type mismatch in a function call, which will likely lead to a runtime error. Please see the specific comment for details.
👋 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 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 🚀 |
Signed-off-by: Nick Hill <[email protected]>
# Conflicts: # vllm/v1/worker/gpu_model_runner.py
Signed-off-by: Nick Hill <[email protected]> Signed-off-by: Duncan Moss <[email protected]>
Signed-off-by: Nick Hill <[email protected]> Signed-off-by: root <[email protected]>
Signed-off-by: Nick Hill <[email protected]>
Signed-off-by: Nick Hill <[email protected]> Signed-off-by: Xiao Yu <[email protected]>
Signed-off-by: Nick Hill <[email protected]>
Signed-off-by: Nick Hill <[email protected]>
Signed-off-by: Nick Hill <[email protected]>
Signed-off-by: Nick Hill <[email protected]>
Minor code cleanup and efficiency improvements noticed while working on other items.