-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[mypy] Enable mypy type checking for vllm/core
#7229
Conversation
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, please make sure to run full CI as it is required to merge (or just use auto-merge). To run full CI, you can do one of these:
🚀 |
ea9ecaa
to
2e78fec
Compare
so for the mypy stuff, I think the failure is because it's not picking up the changes in the ci config files? the yapf formatting stuff I have no idea, it looks like a bunch of stuff in the repo doesn't adhere to that. I added the formatting changes just for vllm/core, but that doesn't seem to have satisfied it. |
|
vllm/core
Right, but when I run them locally with just I'll take a look at the suggested changes. Thanks for the review! |
c89c730
to
8ce0ee0
Compare
f936cac
to
6ab603f
Compare
73c6eea
to
1fc1edc
Compare
Think this is good to go now? |
8353df4
to
b683f87
Compare
b683f87
to
c88355d
Compare
c88355d
to
4001e30
Compare
|
||
block_table: BlockTable = BlockTable() | ||
assert seq 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.
I don't think this is required? Since num_prompt_blocks = 0
if seq is None
anyway
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.
The issue is seq is optional and directly referenced on lines 328-330:
block = self.gpu_allocator.allocate(
seq.hash_of_block(logical_idx),
seq.num_hashed_tokens_of_block(logical_idx))
It's not technically possible to get there if seq is none but mypy is still complaining because it doesn't care about the check in _get_seq_num_required_blocks(seq). Do you have a more straightforward suggestion?
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 see, thanks for the explanation.
@DarkLight1337 this one good with you to merge now? |
Yeah, let's merge this |
Signed-off-by: Alvant <alvasian@yandex.ru>
Partially address #3680
Hopefully I did this right.