Skip to content

Commit d19522a

Browse files
committed
fix
1 parent 7bc99ef commit d19522a

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

lightllm/distributed/custom_all_gather.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333

3434
if light_ops is not None:
3535
light_ops.meta_size()
36-
custom_ar = True
37-
else:
38-
custom_ar = False
3936

4037
logger = init_logger(__name__)
4138

@@ -65,7 +62,7 @@ def __init__(self, group: ProcessGroup, device: Union[int, str, torch.device], m
6562
self._IS_CAPTURING = False
6663
self.disabled = True
6764

68-
if not custom_ar:
65+
if light_ops is None:
6966
# disable because of missing custom allgather library
7067
# e.g. in a non-cuda environment
7168
return

lightllm/distributed/custom_all_reduce.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
# Use sgl custom allreduce
4242
ops = sgl_allreduce_ops
4343

44-
ops.meta_size()
45-
custom_ar = True
44+
if ops is not None:
45+
ops.meta_size()
4646

4747

4848
def is_weak_contiguous(inp: torch.Tensor):
@@ -70,7 +70,7 @@ def __init__(self, group: ProcessGroup, device: Union[int, str, torch.device], m
7070
self._IS_CAPTURING = False
7171
self.disabled = True
7272

73-
if not custom_ar:
73+
if ops is None:
7474
# disable because of missing custom allreduce library
7575
# e.g. in a non-cuda environment
7676
return

0 commit comments

Comments
 (0)