30 lines
637 B
Python
30 lines
637 B
Python
|
|
from abc import ABC, abstractmethod
|
||
|
|
|
||
|
|
from vllm.config import ParallelConfig
|
||
|
|
|
||
|
|
|
||
|
|
class Backend(ABC):
|
||
|
|
|
||
|
|
def __init__(self, parallel_config: ParallelConfig):
|
||
|
|
pass
|
||
|
|
|
||
|
|
def set_device(self):
|
||
|
|
pass
|
||
|
|
|
||
|
|
def register_buffer(self, ptrs: list[int], lengths: list[int]):
|
||
|
|
pass
|
||
|
|
|
||
|
|
@abstractmethod
|
||
|
|
def exists(self, keys: list[str]) -> list[int]:
|
||
|
|
pass
|
||
|
|
|
||
|
|
@abstractmethod
|
||
|
|
def put(self, keys: list[str], addrs: list[list[int]],
|
||
|
|
sizes: list[list[int]]):
|
||
|
|
pass
|
||
|
|
|
||
|
|
@abstractmethod
|
||
|
|
def get(self, keys: list[str], addrs: list[list[int]],
|
||
|
|
sizes: list[list[int]]):
|
||
|
|
pass
|