A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 16, 22:00 UTC
[CI/Build] Enable mypy typing for remaining folders (#6268)
Benjamin Muskalla committed
Jul 10, 2024 at 16:15 UTC
b422d4961a3052c5b4bcfc3747a1ad55acfe7eb8
3 files changed
+21
-20
.github/workflows/mypy.yaml
+10
-8
@@ -32,20 +32,22 @@ jobs:
32
pip install types-setuptools
33
- name: Mypy
34
run: |
35
+ mypy tests --config-file pyproject.toml
36
+ mypy vllm/*.py --config-file pyproject.toml
37
mypy vllm/attention --config-file pyproject.toml
38
mypy vllm/core --config-file pyproject.toml
39
mypy vllm/distributed --config-file pyproject.toml
40
+ mypy vllm/engine --config-file pyproject.toml
41
mypy vllm/entrypoints --config-file pyproject.toml
42
mypy vllm/executor --config-file pyproject.toml
43
+ mypy vllm/inputs --config-file pyproject.toml
44
+ mypy vllm/logging --config-file pyproject.toml
45
+ mypy vllm/lora --config-file pyproject.toml
46
+ mypy vllm/model_executor --config-file pyproject.toml
47
mypy vllm/multimodal --config-file pyproject.toml
41
- mypy vllm/usage --config-file pyproject.toml
42
- mypy vllm/*.py --config-file pyproject.toml
48
+ mypy vllm/platforms --config-file pyproject.toml
49
+ mypy vllm/spec_decode --config-file pyproject.toml
50
mypy vllm/transformers_utils --config-file pyproject.toml
44
- mypy vllm/engine --config-file pyproject.toml
51
+ mypy vllm/usage --config-file pyproject.toml
52
mypy vllm/worker --config-file pyproject.toml
46
- mypy vllm/spec_decode --config-file pyproject.toml
47
- mypy vllm/model_executor --config-file pyproject.toml
48
- mypy vllm/lora --config-file pyproject.toml
49
- mypy vllm/logging --config-file pyproject.toml
50
- mypy tests --config-file pyproject.toml
53
format.sh
+9
-9
@@ -96,23 +96,23 @@ echo 'vLLM yapf: Done'
96
97
# Run mypy
98
echo 'vLLM mypy:'
99
+mypy tests --config-file pyproject.toml
100
+mypy vllm/*.py --config-file pyproject.toml
101
mypy vllm/attention --config-file pyproject.toml
102
mypy vllm/core --config-file pyproject.toml
103
mypy vllm/distributed --config-file pyproject.toml
104
+mypy vllm/engine --config-file pyproject.toml
105
mypy vllm/entrypoints --config-file pyproject.toml
106
mypy vllm/executor --config-file pyproject.toml
107
+mypy vllm/logging --config-file pyproject.toml
108
+mypy vllm/lora --config-file pyproject.toml
109
+mypy vllm/model_executor --config-file pyproject.toml
110
mypy vllm/multimodal --config-file pyproject.toml
105
-mypy vllm/usage --config-file pyproject.toml
106
-mypy vllm/*.py --config-file pyproject.toml
111
+mypy vllm/prompt_adapter --config-file pyproject.toml
112
+mypy vllm/spec_decode --config-file pyproject.toml
113
mypy vllm/transformers_utils --config-file pyproject.toml
108
-mypy vllm/engine --config-file pyproject.toml
114
+mypy vllm/usage --config-file pyproject.toml
115
mypy vllm/worker --config-file pyproject.toml
110
-mypy vllm/spec_decode --config-file pyproject.toml
111
-mypy vllm/model_executor --config-file pyproject.toml
112
-mypy vllm/lora --config-file pyproject.toml
113
-mypy vllm/logging --config-file pyproject.toml
114
-mypy vllm/prompt_adapter --config-file pyproject.toml
115
-mypy tests --config-file pyproject.toml
116
117
118
# If git diff returns a file that is in the skip list, the file may be checked anyway:
vllm/platforms/cuda.py
+2
-3
@@ -34,11 +34,10 @@ def get_physical_device_capability(device_id: int = 0) -> Tuple[int, int]:
34
def device_id_to_physical_device_id(device_id: int) -> int:
35
if "CUDA_VISIBLE_DEVICES" in os.environ:
36
device_ids = os.environ["CUDA_VISIBLE_DEVICES"].split(",")
37
- device_ids = [int(device_id) for device_id in device_ids]
37
physical_device_id = device_ids[device_id]
38
+ return int(physical_device_id)
39
else:
40
- physical_device_id = device_id
41
- return physical_device_id
40
+ return device_id
41
42
43
class CudaPlatform(Platform):