diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index 62f0dbcd93eff..5780f09a646cb 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -32,20 +32,22 @@ jobs: pip install types-setuptools - name: Mypy run: | + mypy tests --config-file pyproject.toml + mypy vllm/*.py --config-file pyproject.toml mypy vllm/attention --config-file pyproject.toml mypy vllm/core --config-file pyproject.toml mypy vllm/distributed --config-file pyproject.toml + mypy vllm/engine --config-file pyproject.toml mypy vllm/entrypoints --config-file pyproject.toml mypy vllm/executor --config-file pyproject.toml + mypy vllm/inputs --config-file pyproject.toml + mypy vllm/logging --config-file pyproject.toml + mypy vllm/lora --config-file pyproject.toml + mypy vllm/model_executor --config-file pyproject.toml mypy vllm/multimodal --config-file pyproject.toml - mypy vllm/usage --config-file pyproject.toml - mypy vllm/*.py --config-file pyproject.toml + mypy vllm/platforms --config-file pyproject.toml + mypy vllm/spec_decode --config-file pyproject.toml mypy vllm/transformers_utils --config-file pyproject.toml - mypy vllm/engine --config-file pyproject.toml + mypy vllm/usage --config-file pyproject.toml mypy vllm/worker --config-file pyproject.toml - mypy vllm/spec_decode --config-file pyproject.toml - mypy vllm/model_executor --config-file pyproject.toml - mypy vllm/lora --config-file pyproject.toml - mypy vllm/logging --config-file pyproject.toml - mypy tests --config-file pyproject.toml diff --git a/format.sh b/format.sh index 5edc868f9f70c..5ad6d6f2938bb 100755 --- a/format.sh +++ b/format.sh @@ -96,23 +96,23 @@ echo 'vLLM yapf: Done' # Run mypy echo 'vLLM mypy:' +mypy tests --config-file pyproject.toml +mypy vllm/*.py --config-file pyproject.toml mypy vllm/attention --config-file pyproject.toml mypy vllm/core --config-file pyproject.toml mypy vllm/distributed --config-file pyproject.toml +mypy vllm/engine --config-file pyproject.toml mypy vllm/entrypoints --config-file pyproject.toml mypy vllm/executor --config-file pyproject.toml +mypy vllm/logging --config-file pyproject.toml +mypy vllm/lora --config-file pyproject.toml +mypy vllm/model_executor --config-file pyproject.toml mypy vllm/multimodal --config-file pyproject.toml -mypy vllm/usage --config-file pyproject.toml -mypy vllm/*.py --config-file pyproject.toml +mypy vllm/prompt_adapter --config-file pyproject.toml +mypy vllm/spec_decode --config-file pyproject.toml mypy vllm/transformers_utils --config-file pyproject.toml -mypy vllm/engine --config-file pyproject.toml +mypy vllm/usage --config-file pyproject.toml mypy vllm/worker --config-file pyproject.toml -mypy vllm/spec_decode --config-file pyproject.toml -mypy vllm/model_executor --config-file pyproject.toml -mypy vllm/lora --config-file pyproject.toml -mypy vllm/logging --config-file pyproject.toml -mypy vllm/prompt_adapter --config-file pyproject.toml -mypy tests --config-file pyproject.toml # If git diff returns a file that is in the skip list, the file may be checked anyway: diff --git a/vllm/platforms/cuda.py b/vllm/platforms/cuda.py index 2d482010cf760..02ba227460e3f 100644 --- a/vllm/platforms/cuda.py +++ b/vllm/platforms/cuda.py @@ -34,11 +34,10 @@ def get_physical_device_capability(device_id: int = 0) -> Tuple[int, int]: def device_id_to_physical_device_id(device_id: int) -> int: if "CUDA_VISIBLE_DEVICES" in os.environ: device_ids = os.environ["CUDA_VISIBLE_DEVICES"].split(",") - device_ids = [int(device_id) for device_id in device_ids] physical_device_id = device_ids[device_id] + return int(physical_device_id) else: - physical_device_id = device_id - return physical_device_id + return device_id class CudaPlatform(Platform):