Skip to content

Commit 65fea63

Browse files
committed
Fix device capability
Signed-off-by: ilmarkov <markovilya197@gmail.com>
1 parent 4950fad commit 65fea63

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

vllm/distributed/device_communicators/all_reduce_utils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import vllm.envs as envs
1919
from vllm.distributed.device_communicators.cuda_wrapper import CudaRTLibrary
2020
from vllm.logger import init_logger
21-
from vllm.platforms import DeviceCapability
2221
from vllm.utils import (cuda_device_count_stateless,
2322
update_environment_variables)
2423

@@ -29,13 +28,13 @@
2928
# Max size for each world size in case symmetric memory is available
3029
# For different SM architectures
3130
CUSTOM_ALL_REDUCE_MAX_SIZES = {
32-
DeviceCapability(9, 0): {
31+
"9.0": {
3332
2: 64 * MiB, # 64 MB
3433
4: 32 * MiB, # 32 MB
3534
6: MiB // 2, # 512 KB
3635
8: MiB // 4, # 256 KB
3736
},
38-
DeviceCapability(10, 0): {
37+
"10.0": {
3938
2: 2 * MiB, # 2 MB
4039
4: 2 * MiB, # 2 MB
4140
6: 2 * MiB, # 2 MB
@@ -44,13 +43,13 @@
4443
}
4544

4645
SYMM_MEM_ALL_REDUCE_MAX_SIZES = {
47-
DeviceCapability(9, 0): {
46+
"9.0": {
4847
2: 64 * MiB, # 64 MB
4948
4: 32 * MiB, # 32 MB
5049
6: 64 * MiB, # 64 MB
5150
8: 64 * MiB, # 64 MB
5251
},
53-
DeviceCapability(10, 0): {
52+
"10.0": {
5453
2: 8 * MiB, # 8 MB
5554
4: 32 * MiB, # 32 MB
5655
6: 128 * MiB, # 128 MB

vllm/distributed/device_communicators/custom_all_reduce.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def __init__(self,
109109
# now `device` is a `torch.device` object
110110
assert isinstance(device, torch.device)
111111
self.device = device
112-
device_capability = current_platform.get_device_capability()
112+
device_capability = current_platform.get_device_capability(
113+
).as_version_str()
113114
if (current_platform.is_cuda() and envs.VLLM_ALLREDUCE_USE_SYMM_MEM
114115
and device_capability in CUSTOM_ALL_REDUCE_MAX_SIZES):
115116
max_size = min(

vllm/distributed/device_communicators/symm_mem.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def __init__(self, group: ProcessGroup, device: Union[int, str,
4343
self.device = device
4444
self.group = group
4545
self.world_size = dist.get_world_size(self.group)
46-
device_capability = current_platform.get_device_capability()
46+
device_capability = current_platform.get_device_capability(
47+
).as_version_str()
4748

4849
if device_capability not in SYMM_MEM_ALL_REDUCE_MAX_SIZES:
4950
logger.warning(

0 commit comments

Comments
 (0)