Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
6ef09b08
Unverified
Commit
6ef09b08
authored
May 01, 2024
by
youkaichao
Committed by
GitHub
May 01, 2024
Browse files
[Core][Distributed] fix pynccl del error (#4508)
parent
3a922c1e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
vllm/distributed/device_communicators/pynccl.py
vllm/distributed/device_communicators/pynccl.py
+4
-8
No files found.
vllm/distributed/device_communicators/pynccl.py
View file @
6ef09b08
...
@@ -200,6 +200,10 @@ _c_ncclAllReduce.argtypes = [
...
@@ -200,6 +200,10 @@ _c_ncclAllReduce.argtypes = [
ncclDataType_t
,
ctypes
.
c_void_p
,
ctypes
.
c_void_p
ncclDataType_t
,
ctypes
.
c_void_p
,
ctypes
.
c_void_p
]
]
# be cautious! this is a collective call, it will block until all
# processes in the communicator have called this function.
# because Python object destruction can happen in random order,
# it is better not to call it at all.
# equivalent to c declaration:
# equivalent to c declaration:
# ncclResult_t ncclCommDestroy(ncclComm_t comm);
# ncclResult_t ncclCommDestroy(ncclComm_t comm);
_c_ncclCommDestroy
=
nccl
.
ncclCommDestroy
_c_ncclCommDestroy
=
nccl
.
ncclCommDestroy
...
@@ -278,11 +282,3 @@ class NCCLCommunicator:
...
@@ -278,11 +282,3 @@ class NCCLCommunicator:
ncclDataTypeEnum
.
from_torch
(
tensor
.
dtype
),
ncclDataTypeEnum
.
from_torch
(
tensor
.
dtype
),
ncclRedOpTypeEnum
.
from_torch
(
op
),
self
.
comm
,
ncclRedOpTypeEnum
.
from_torch
(
op
),
self
.
comm
,
ctypes
.
c_void_p
(
stream
.
cuda_stream
)))
ctypes
.
c_void_p
(
stream
.
cuda_stream
)))
def
__del__
(
self
):
# `dist` module might have been already destroyed
if
hasattr
(
dist
,
'destroy_process_group'
):
dist
.
destroy_process_group
()
# function might have been already destroyed
if
_c_ncclCommDestroy
is
not
None
:
_c_ncclCommDestroy
(
self
.
comm
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment