Skip to content

Commit 10d5b5f

Browse files
committed
Add review comment
1 parent aac0c99 commit 10d5b5f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

python/sglang/srt/distributed/device_communicators/pynccl_allocator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import tempfile
22

33
import torch
4+
from packaging import version
45
from torch.cuda.memory import CUDAPluggableAllocator
56

67
from sglang.srt.distributed.parallel_state import GroupCoordinator
@@ -105,7 +106,9 @@ def __exit__(self, exc_type, exc_val, exc_tb):
105106
self._mem_pool_ctx.__exit__(exc_type, exc_val, exc_tb)
106107
for segment in get_nccl_mem_pool().snapshot():
107108
if segment["address"] not in _registered_base_addrs:
108-
if segment["stream"] == 0:
109+
if segment["stream"] == 0 and version.parse(
110+
torch.__version__
111+
) < version.parse("2.8.0"):
109112
# PyTorch version < 2.8.0 has a multi-thread MemPool bug
110113
# See https://github.com/pytorch/pytorch/issues/152861
111114
# Fixed at https://github.com/pytorch/pytorch/commit/f01e628e3b31852983ab30b25bf251f557ba9c0b

0 commit comments

Comments
 (0)