[MyPy] Enable mypy for vllm/model_executor/layers/#40159
[MyPy] Enable mypy for vllm/model_executor/layers/#40159vllm-bot merged 7 commits intovllm-project:mainfrom
vllm/model_executor/layers/#40159Conversation
There was a problem hiding this comment.
Code Review
This pull request focuses on improving type safety and static analysis across the vllm/model_executor/layers directory, allowing it to be removed from the mypy ignore list. Key changes include adding explicit type hints, introducing assert statements to handle potentially null values, and standardizing the extraction of attn_metadata from the forward context to support speculative decoding. Additionally, the PR addresses platform-specific typing issues for XPU and refactors activation registries for better type compliance. I have no feedback to provide as there are no review comments.
Isotr0py
left a comment
There was a problem hiding this comment.
Overall look reasonable. Thanks for cleanup!
|
Seems tests are failing: https://buildkite.com/vllm/ci/builds/61969#019da16c-3ab1-4d5d-b149-199047fc74fd |
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
fba05eb to
d826226
Compare
Review comment: - vllm-project#40159 (comment) Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
@Isotr0py Thank you for the review and feedback. I fixed the issues with the tests. There are other issues with unit tests that seem to be flakiness with the gate at the moment. |
Part of #26533
$ pre-commit run -a --hook-stage manual mypy-3.10Before:
After:
Run mypy for Python 3.10.................................................Passed