-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
[BugFix][Typing] Fix Imprecise Type Annotations #15208
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
|
👋 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 🚀 |
vllm/v1/engine/core_client.py
Outdated
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.
ctx must be set, or line-235 will fail because ctx is 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.
I checked the codebase. The BackgroundResources is only used by
vllm/vllm/v1/engine/core_client.py
Line 293 in e3f813c
| self.resources = BackgroundResources(ctx=sync_ctx) |
So it is ok to remove the defaults.
njhill
left a comment
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.
Thanks for the fixes @WrRan
vllm/v1/engine/core_client.py
Outdated
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.
I'm not sure this comment is necessary. Our pre-commit checks will catch 3.9 incompatibilities.
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.
Did we land code non-compatible with python 3.9 first, then turned on pre-commit checks? Just curious.
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.
@houseroad I don't think so - the code here is compatible with 3.9. The comment was a hypothetical explanation about why we can't add TypeAlias here yet.
|
@WrRan you need to sign-off your commits, see https://github.com/vllm-project/vllm/pull/15208/checks?check_run_id=39103177991. And while you're updating perhaps remove that comment per my suggestion? |
houseroad
left a comment
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.
Looks good.
Got and ready. |
1fdf30d to
28b5c34
Compare
|
Got. And now commit history is clear. Happy. 😄 @njhill |
vllm/v1/serial_utils.py
Outdated
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.
@njhill Have a look. Any includes None, so Optional is unnecessary.
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.
Do we have a stricter bound for this? fwiw Any is equivalent as not adding type, as it doesn't give any contextual usage of the parameter (but for the sake of passing mypy)
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.
I would prefer to keep the Optional here since None has a different meaning to any other value
vllm/v1/engine/core_client.py
Outdated
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.
because this is a dataclass, you can gated the default value under dataclasses.field
ctx: zmq.Context = dataclasses.field(default=None)Same for L216 and L217
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.
or you can apply the change to L216 and L217 instead of ctx, given that it seems ctx must not be 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.
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.
touche.
aarnphm
left a comment
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.
LGTM. can you rename the title according to https://docs.vllm.ai/en/latest/contributing/overview.html#pr-title-and-classification
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.
@WrRan could you revert that other optional change per my new comment.
Otherwise the changes look good to me, you just need to fix the DCO thing before we can merge it. Thanks again
vllm/v1/serial_utils.py
Outdated
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.
I would prefer to keep the Optional here since None has a different meaning to any other value
Signed-off-by: Wang Ran (汪然) <wrran@outlook.com>
|
@njhill Got, and reverted. And I have known what is Another question: vllm/vllm/v1/engine/__init__.py Lines 110 to 119 in cfbb8c9
The Additionally, I have been carefully reading (or more accurately, learning) vllm v1. The current architecture is elegant. THANKS FOR YOUR WORKS AND OPEN-SOURCE SPIRIT. ❤️ ❤️ ❤️ |
|
@aarnphm Got, and I will name PR accordingly. |
Signed-off-by: Wang Ran (汪然) <wrran@outlook.com>
Signed-off-by: Wang Ran (汪然) <wrran@outlook.com> Signed-off-by: Louis Ulmer <ulmerlouis@gmail.com>
Signed-off-by: Wang Ran (汪然) <wrran@outlook.com>
Signed-off-by: Wang Ran (汪然) <wrran@outlook.com>
Signed-off-by: Wang Ran (汪然) <wrran@outlook.com> Signed-off-by: Mu Huai <tianbowen.tbw@antgroup.com>


as title said.