[PD] Support KV transfer with mooncake (#4880)
Signed-off-by: Shangming Cai <caishangming@linux.alibaba.com> Co-authored-by: Shangming Cai <caishangming@linux.alibaba.com> Co-authored-by: Xuchun Shang <xuchun.shang@linux.alibaba.com> Co-authored-by: shangmingc <csmthu@gmail.com>
This commit is contained in:
@@ -24,11 +24,13 @@ import logging
|
||||
from dataclasses import dataclass
|
||||
from typing import TYPE_CHECKING, List, Optional, Tuple
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
from torch.distributed import ProcessGroup
|
||||
|
||||
from sglang.srt.disaggregation.conn import KVArgs, KVManager, KVPoll, KVReceiver
|
||||
from sglang.srt.disaggregation.utils import (
|
||||
DisaggregationMode,
|
||||
ReqToMetadataIdxAllocator,
|
||||
poll_and_all_reduce,
|
||||
)
|
||||
@@ -115,7 +117,7 @@ class DecodePreallocQueue:
|
||||
metadata_buffer[0].nbytes for metadata_buffer in self.metadata_buffers
|
||||
]
|
||||
kv_args.ib_device = "mock-ib-device"
|
||||
kv_manager = KVManager(kv_args)
|
||||
kv_manager = KVManager(kv_args, DisaggregationMode("decode"))
|
||||
return kv_manager
|
||||
|
||||
def add(self, req: Req) -> None:
|
||||
@@ -186,6 +188,7 @@ class DecodePreallocQueue:
|
||||
]
|
||||
.cpu()
|
||||
.numpy()
|
||||
.astype(np.int64)
|
||||
)
|
||||
|
||||
decode_req.metadata_buffer_index = (
|
||||
|
||||
Reference in New Issue
Block a user