Introduction
In this article we will present a method for fast implementation of Erasure Coding primitives based on Galois Field arithmetic. The Jerasure library manual (pdf) is a good introduction to the erasure coding method considered in this article.For or purpose it suffices to say we have r partial stripes. Each striple is constituted by k w-bit data words and we want to compute the m w-bit parity words to complete each striple.
Each parity word is computed as a dot-product of the data striple multiplied by a constant vectors whose values depends on the index of the parity word we want to compute (those index ranges from
0 to m−1). The vector elements and dot-product results are in GF(2w).
Multiplication by a constant through vector by matrix multiplication
We will consider the primitive operation on a w-bit data word D, which must be multiplied by a w-bit constant C to get a w-bit parity word P: D×C=P
The methode, due to Mastrovito (detailed in [5]), expands a multiplication by a constant and the modulo reduction into a multiplication by a bit matrix as follows:
(dataword)×(C.X0[g]C.X1[g]⋮C.Xk−1[g])=(parityword)
The multiplicand matrix is built by expanding C.Xi[g] for each row i of the matrix.
The matrix multiplication will accumulate the multiplication di×Xi[g] to build the final result:
P=D×C[g]=(⊕w−1i=0di×Xi)×C[g]=(⊕w−1i=0di.C×Xi)[g]=⊕w−1i=0di.(C×Xi[g])
×(c0,0c0,1…c0,w−1c1,0c1,1…c1,w−1⋮⋮ck−1,0ck−1,1…cw−1,w−1)(d0d1…dw−1)(p0p1…pw−1)
Multiplication parallelization
We have seen how to use vector by matrix multiplication to compute the multiplication of a data word to get part of a parity word (we still have to accumulate those parts to get the actual parity word). We can extend the left hand side vector to a full matrix and implements multiple multiplications by the same expanded constant C, realizing a Single Instruction Multiple Data (SIMD) operation.With a single operation implementing a multiplication between w×w matrices we implement w parallel multiplication by a constant C.
Erasure code operation
The macro operation for to compute erasure coding parity is a matrix multiplication where the right hand side matrix element are constant in GF(2w). This operation is decomposed into vector by constant vector multiplications, themselves decomposed into multiplication by constants and xor accumulations.
References:
- [1] Screaming Fast Galois Field Arithmetic Using Intel SIMD Instructions (pdf)
- [2] Improving the coding speed of erasure codes with polynomial ring transforms (pdf)
- [3] A New Architecture for a Parallel Finite Field Multiplier with Low Complexity Based on Composite Fields, C. Paar (pdf)
- [4] Jerasure library manual (pdf)
- [5] Fast and Secure Finite Field Multipliers (pdf) by Pamula and Tisserand (contains description of Mastrovito's method)
No comments:
Post a Comment