Skip to content

vllm_omni.distributed.omni_connectors.utils.serialization

OmniSerializer module-attribute

OmniSerializer = OmniSerde()

OmniMsgpackDecoder

This implementation is adapted from vLLM’s MsgpackDecoder. However, zero-copy support has not been implemented yet.

Automatically reconstructs torch.Tensor, numpy.ndarray, PIL.Image, RequestOutput and CompletionOutput from their dict representations. TODO: Enable zero-copy support.

decoder instance-attribute

decoder = Decoder()

decode

decode(data: bytes | bytearray | memoryview) -> Any

Decode bytes to object.

OmniMsgpackEncoder

This implementation is adapted from vLLM’s MsgpackEncoder. However, zero-copy support has not been implemented yet. Handles torch.Tensor, numpy.ndarray, PIL.Image, RequestOutput and CompletionOutput by converting them to serializable dict representations. TODO: Enable zero-copy support.

encoder instance-attribute

encoder = Encoder(enc_hook=_enc_hook)

encode

encode(obj: Any) -> bytes

Encode an object to bytes.

OmniSerde

Serialization/deserialization handler for Omni IPC.

decoder instance-attribute

decoder = OmniMsgpackDecoder()

encoder instance-attribute

encoder = OmniMsgpackEncoder()

deserialize

deserialize(data: bytes | bytearray | memoryview) -> Any

Deserialize bytes to an object.

serialize

serialize(obj: Any) -> bytes

Serialize an object to bytes.