File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
vllm/distributed/device_communicators Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -191,8 +191,20 @@ def capture(self):
191191
192192 def _get_ipc_meta (self , inp : torch .Tensor ):
193193 data = inp .untyped_storage ()._share_cuda_ ()
194+ handle = data [1 ]
195+ # https://github.com/pytorch/pytorch/pull/130890 changes
196+ # the binary format of the ipc handle
197+ # it starts from pytorch 2.5
198+ if len (handle ) > 64 :
199+ assert len (handle ) == 66
200+ # only support SHAREABLE_HANDLE_VERSION = 1
201+ assert int (handle [0 ]) == 1
202+ # only support SHAREABLE_CUDA_MALLOC = 'c'
203+ assert handle [1 ] == ord ("c" )
204+ handle = handle [2 :]
205+ # TODO: support expandable segment
194206 shard_data = (
195- data [ 1 ] , # ipc handle to base ptr
207+ handle , # ipc handle to base ptr
196208 data [3 ], # offset of base ptr
197209 )
198210 return self ._gather_ipc_meta (shard_data )
You can’t perform that action at this time.
0 commit comments