Payloads

Abstraction for the (de)serialization and (de)compression processes. This gives good capabilities of extensions as implementing the abstraction does not require any other changes in the library to use the new scheme.

The implemented PayloadSerde are presented below, but first, let's describe the abstraction to implement.

Fed.Serde.serialize_payloadMethod
serialize_payload(payload_serde::PayloadSerde, weights::Vector{Float32})

Serialize weights by applying the transformation defined by the payload_serde.

Info

This method is an interface to implement when creating a new PayloadSerde.

source
Fed.Serde.deserialize_payloadMethod
deserialize_payload(payload_serde::PayloadSerde, data::Vector{UInt8}, from::String)

Deserialize data by applying the inverse transformation of the serialization process. from is the URL from which the data are coming, which may be an empty string if unused by the payload_serde.

Info

This method is an interface to implement when creating a new PayloadSerde.

source

VanillaPayloadSerde

Fed.Serde.VanillaPayloadSerdeType
VanillaPayloadSerde() <: PayloadSerde

Basic serialization where no compression is applied. This PayloadSerde is only a wrapper around the data serialization in order to match the interface to implement.

source
Fed.Serde.serialize_payloadMethod
serialize_payload(::VanillaPayloadSerde, weights)

Serialize weights with the VanillaPayloadSerde where only basic serialization is applied.

source
Fed.Serde.deserialize_payloadMethod
deserialize_payload(::VanillaPayloadSerde, data, from)

Deserialize data with the VanillaPayloadSerde where only basic deserialization is applied.

source

QuantizedPayloadSerde

Fed.Serde.QuantizedPayloadSerdeType
QuantizedPayloadSerde{T <: Unsigned}() <: PayloadSerde

Apply quantization to the weights before serialization in order to reduce the payload size. This process is lossy, thus a loss of information is to be expected after the deserialization.

source
Fed.Serde.QPayloadType
QPayload{T <: Unsigned}(data, minval, maxval)

Payload generated by the quantization compression scheme. minval and maxval are metadata fields required to efficiently quantize and dequantize.

source
Fed.Serde.serialize_payloadMethod
serialize_payload(payload_serde::PayloadSerde, weights::Vector{Float32})

Serialize weights by applying the transformation defined by the payload_serde.

Info

This method is an interface to implement when creating a new PayloadSerde.

source
serialize_payload(::QuantizedPayloadSerde, weights)

Serialize weights with the QuantizedPayloadSerde where quantization is applied before serialization.

source
Fed.Serde.deserialize_payloadMethod
deserialize_payload(payload_serde::PayloadSerde, data::Vector{UInt8}, from::String)

Deserialize data by applying the inverse transformation of the serialization process. from is the URL from which the data are coming, which may be an empty string if unused by the payload_serde.

Info

This method is an interface to implement when creating a new PayloadSerde.

source
deserialize_payload(::QuantizedPayloadSerde, data, from)

Deserializes data with the QuantizedPayloadSerde where dequantization is applied after deserialization.

source

QDiffPayloadSerde

Fed.Serde.QDiffPayloadSerdeType
QDiffPayloadSerde{T <: Unsigned}(chunksize::Int, is_client::Bool) <: PayloadSerde

Apply both quantization and diff-deduplication to the weights before serialization in order to compress the payload. Quantization is a lossy process, thus a loss of information is to be expected after deserialization.

source
Fed.Serde.QDiffPayloadType
QDiffPayload{T <: Unsigned}(data, minval, maxval)

Payload generated by the quantization compression scheme. Data are structured in a different way than QPayload in order to diff-deduplicate the client-side payloads by chunks.

source
Fed.Serde.serialize_payloadMethod
serialize_payload(payload_serde::PayloadSerde, weights::Vector{Float32})

Serialize weights by applying the transformation defined by the payload_serde.

Info

This method is an interface to implement when creating a new PayloadSerde.

source
serialize_payload(::QDiffPayloadSerde, weights)

Serialize weights with the QuantizedDedupPayloadSerde where quantization and diff-deduplication of values are applied before serialization.

source
Fed.Serde.deserialize_payloadMethod
deserialize_payload(payload_serde::PayloadSerde, data::Vector{UInt8}, from::String)

Deserialize data by applying the inverse transformation of the serialization process. from is the URL from which the data are coming, which may be an empty string if unused by the payload_serde.

Info

This method is an interface to implement when creating a new PayloadSerde.

source
deserialize_payload(::QuantizedDedupPayloadSerde, data, from)

Deserialize data with the QuantizedDedupPayloadSerde where regeneration of deduplicated values and dequantizatoin are applied after deserialization.

source

GDPayloadSerde

Fed.Serde.GDPayloadSerdeType
GDPayloadSerde(chunksize, fingerprint, msbsize, store_host, store_port, is_client)

Apply both quantization and GD to the weights before serialization in order to compress the payload. Quantization is a lossy process, thus a loss of information is to be expected after deserialization. Depending on the chosen fingerprint, collisions can occur, also leading to a loss of information.

source
Fed.Serde.GDPayloadType
GDPayload(data, minval, maxval)

Payload generated by the GD compression. Since the GD compression scheme is built on top of quantization, the same metadata are presnts, while the structure of the data is under the form of a small GDFile.

source
Fed.Serde.serialize_payloadMethod
serialize_payload(payload_serde::PayloadSerde, weights::Vector{Float32})

Serialize weights by applying the transformation defined by the payload_serde.

Info

This method is an interface to implement when creating a new PayloadSerde.

source
serialize_payload(::GDPayloadSerde, weights)

Serialize weights with the GDPayloadSerde where quantization and generalized deduplication are applied before serialization.

source
Fed.Serde.deserialize_payloadMethod
deserialize_payload(payload_serde::PayloadSerde, data::Vector{UInt8}, from::String)

Deserialize data by applying the inverse transformation of the serialization process. from is the URL from which the data are coming, which may be an empty string if unused by the payload_serde.

Info

This method is an interface to implement when creating a new PayloadSerde.

source
deserialize_payload(GDPayloadSerde, data, from)

Deserialize data with the GDPayloadSerde where generalized deduplication and dequantization are applied before deserialization.

source