-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Update deprecated Python 3.8 typing #13971
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Harry Mellor <[email protected]>
👋 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 🚀 |
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 think this is not necessary. we should keep the compatibility if it does not hurt.
for example, if someone still uses a fork of vllm, and he sticks to python 3.8, this PR will make their rebase and update very painful.
Python 3.8 is effectively not supported anymore (even without this PR) as we now directly subscript builtins like |
I think it's fine to use new type annotation like |
We can selectively enforce this rule via https://docs.astral.sh/ruff/settings/#lint_per-file-ignores Perhaps we can start by applying this to V1 code? |
Signed-off-by: Harry Mellor <[email protected]>
I'm fine with applying it to new code, but I think changing thousands of lines as in this PR is not necessary. |
I don't think there is any harm in using the modern syntax throughout vLLM. I'm in favour of updating everything because then the whole repo is consistent and little consistencies like these add up to make the library more maintainable. |
Also, PyTorch has dropped Python 3.8 and we already use the modern syntax in some places. So as @DarkLight1337 said, we already do not support Python 3.8. |
For what is worth torch still appears to be using the old |
If one cares about a thousand git blame noise for type hint update, how about adding a |
I imagine the effort required to make that change in PyTorch would be too large. In vLLM it wasn't too bad (and I've already done the work).
@youkaichao what do you think of @cjackal's suggestion? |
I think there is no need to ignore the git blame, since the number of lines changed is honestly not that much compared to the total number of lines in the file. I would only consider this for formatting changes. |
I'm not talking about git-blame , I'm talking about people merge and rebase upstream in their fork. changing type annotation gives no significant benefit in my opinion, but will make some users' life worse since they have more merge conflicts. |
I think we can limit this to new code (v1), private code (tests), and constantly evolving code (examples, entrypoints). As we start the full V1 integration and code removal process, eventually all the code will be new in 1.0.0 |
This reverts commit 836352c. Signed-off-by: Harry Mellor <[email protected]>
Signed-off-by: Harry Mellor <[email protected]>
How's this? I have reverted everything inside
|
This pull request has merge conflicts that must be resolved before it can be |
This sounds good to me. Let's merge this over the weekend to avoid conflicts. |
Signed-off-by: Harry Mellor <[email protected]>
The main change is in
pyproject.toml
, the rest is just fixing the pre-commit errors that creates.The following two rules have been enabled:
They have been enabled:
vllm/
directoryvllm/v1
andvllm/entrypoints
vllm/*.py