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.PayloadSerde — TypePayloadSerdeInterface to implement for creating a new compression scheme for the payload.
Fed.Serde.serialize_payload — Methodserialize_payload(payload_serde::PayloadSerde, weights::Vector{Float32})Serialize weights by applying the transformation defined by the payload_serde.
This method is an interface to implement when creating a new PayloadSerde.
Fed.Serde.deserialize_payload — Methoddeserialize_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.
This method is an interface to implement when creating a new PayloadSerde.
VanillaPayloadSerde
Fed.Serde.VanillaPayloadSerde — TypeVanillaPayloadSerde() <: PayloadSerdeBasic serialization where no compression is applied. This PayloadSerde is only a wrapper around the data serialization in order to match the interface to implement.
Fed.Serde.serialize_payload — Methodserialize_payload(::VanillaPayloadSerde, weights)Serialize weights with the VanillaPayloadSerde where only basic serialization is applied.
Fed.Serde.deserialize_payload — Methoddeserialize_payload(::VanillaPayloadSerde, data, from)Deserialize data with the VanillaPayloadSerde where only basic deserialization is applied.
QuantizedPayloadSerde
Fed.Serde.QuantizedPayloadSerde — TypeQuantizedPayloadSerde{T <: Unsigned}() <: PayloadSerdeApply 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.
Fed.Serde.QPayload — TypeQPayload{T <: Unsigned}(data, minval, maxval)Payload generated by the quantization compression scheme. minval and maxval are metadata fields required to efficiently quantize and dequantize.
Fed.Serde.serialize_payload — Methodserialize_payload(payload_serde::PayloadSerde, weights::Vector{Float32})Serialize weights by applying the transformation defined by the payload_serde.
This method is an interface to implement when creating a new PayloadSerde.
serialize_payload(::QuantizedPayloadSerde, weights)Serialize weights with the QuantizedPayloadSerde where quantization is applied before serialization.
Fed.Serde.deserialize_payload — Methoddeserialize_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.
This method is an interface to implement when creating a new PayloadSerde.
deserialize_payload(::QuantizedPayloadSerde, data, from)Deserializes data with the QuantizedPayloadSerde where dequantization is applied after deserialization.
QDiffPayloadSerde
Fed.Serde.QDiffPayloadSerde — TypeQDiffPayloadSerde{T <: Unsigned}(chunksize::Int, is_client::Bool) <: PayloadSerdeApply 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.
Fed.Serde.QDiffPayload — TypeQDiffPayload{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.
Fed.Serde.serialize_payload — Methodserialize_payload(payload_serde::PayloadSerde, weights::Vector{Float32})Serialize weights by applying the transformation defined by the payload_serde.
This method is an interface to implement when creating a new PayloadSerde.
serialize_payload(::QDiffPayloadSerde, weights)Serialize weights with the QuantizedDedupPayloadSerde where quantization and diff-deduplication of values are applied before serialization.
Fed.Serde.deserialize_payload — Methoddeserialize_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.
This method is an interface to implement when creating a new PayloadSerde.
deserialize_payload(::QuantizedDedupPayloadSerde, data, from)Deserialize data with the QuantizedDedupPayloadSerde where regeneration of deduplicated values and dequantizatoin are applied after deserialization.
GDPayloadSerde
Fed.Serde.GDPayloadSerde — TypeGDPayloadSerde(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.
Fed.Serde.GDPayload — TypeGDPayload(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.
Fed.Serde.serialize_payload — Methodserialize_payload(payload_serde::PayloadSerde, weights::Vector{Float32})Serialize weights by applying the transformation defined by the payload_serde.
This method is an interface to implement when creating a new PayloadSerde.
serialize_payload(::GDPayloadSerde, weights)Serialize weights with the GDPayloadSerde where quantization and generalized deduplication are applied before serialization.
Fed.Serde.deserialize_payload — Methoddeserialize_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.
This method is an interface to implement when creating a new PayloadSerde.
deserialize_payload(GDPayloadSerde, data, from)Deserialize data with the GDPayloadSerde where generalized deduplication and dequantization are applied before deserialization.