Skip to content

Commit 9d9081e

Browse files
ilmarkovilmarkov
authored andcommitted
Update symm mem constants and funcs
Signed-off-by: ilmarkov <imarkov@redhat.com>
1 parent b05ed25 commit 9d9081e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

vllm/distributed/device_communicators/custom_all_reduce.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ def is_weak_contiguous(inp: torch.Tensor):
4949
class CustomAllreduce:
5050

5151
_SUPPORTED_WORLD_SIZES = [2, 4, 6, 8]
52-
MB = 1024 * 1024
52+
MiB = 1024 * 1024
5353
# Max sizes for each world size in case symmetric memory is available
5454
_MAX_SIZES = {
55-
2: MB, # 1 MB
56-
4: MB, # 1 MB
57-
6: MB // 2, # 512 KB
58-
8: MB // 2, # 512 KB
55+
2: 2 * MiB, # 1 MB
56+
4: 2 * MiB, # 1 MB
57+
6: MiB, # 512 KB
58+
8: MiB // 2, # 512 KB
5959
}
6060

6161
# max_size: max supported allreduce size

vllm/distributed/device_communicators/symm_mem.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919

2020

2121
class SymmMemCommunicator:
22-
MB = 1024 * 1024
22+
MiB = 1024 * 1024
2323
# Max sizes for each world size
2424
_MAX_SIZES = {
25-
2: 8 * MB,
26-
4: 32 * MB,
27-
6: 64 * MB,
28-
8: 256 * MB,
25+
2: 8 * MiB,
26+
4: 32 * MiB,
27+
6: 128 * MiB,
28+
8: 128 * MiB,
2929
}
3030

3131
def __init__(self, group: ProcessGroup, device: Union[int, str,

0 commit comments

Comments
 (0)