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
1ab6f6b4
Unverified
Commit
1ab6f6b4
authored
Oct 29, 2024
by
youkaichao
Committed by
GitHub
Oct 29, 2024
Browse files
[core][distributed] fix custom allreduce in pytorch 2.5 (#9815)
Signed-off-by:
youkaichao
<
youkaichao@gmail.com
>
parent
bc73e982
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
vllm/distributed/device_communicators/custom_all_reduce.py
vllm/distributed/device_communicators/custom_all_reduce.py
+13
-1
No files found.
vllm/distributed/device_communicators/custom_all_reduce.py
View file @
1ab6f6b4
...
...
@@ -191,8 +191,20 @@ class CustomAllreduce:
def
_get_ipc_meta
(
self
,
inp
:
torch
.
Tensor
):
data
=
inp
.
untyped_storage
().
_share_cuda_
()
handle
=
data
[
1
]
# https://github.com/pytorch/pytorch/pull/130890 changes
# the binary format of the ipc handle
# it starts from pytorch 2.5
if
len
(
handle
)
>
64
:
assert
len
(
handle
)
==
66
# only support SHAREABLE_HANDLE_VERSION = 1
assert
int
(
handle
[
0
])
==
1
# only support SHAREABLE_CUDA_MALLOC = 'c'
assert
handle
[
1
]
==
ord
(
"c"
)
handle
=
handle
[
2
:]
# TODO: support expandable segment
shard_data
=
(
data
[
1
]
,
# ipc handle to base ptr
handle
,
# ipc handle to base ptr
data
[
3
],
# offset of base ptr
)
return
self
.
_gather_ipc_meta
(
shard_data
)
...
...
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