Skip to content

Conversation

@lamphamsy
Copy link
Contributor

@lamphamsy lamphamsy commented Jun 12, 2019

NB: the PR is split/extracted from the big one #282

The purpose is to eliminate as much as possible branches, particularly in essential operations s.t. modular operations.

Currently, we support vectorized operations of FNT in the cases:

  • FNT(257) using uint16_t and uint32_t
  • FNT(65537) using uint32_t

But the support of FNT(257) using uint32_t raises additional branches of checking the cardinal of the field. And its encoding/decoding speeds are obviously smaller than the two other cases: FNT(257) using uin16_t and FNT(65537) using uint32_t.

Hence, for FNT, we support only FNT(257) using uin16_t and FNT(65537) using uint32_t.

@lamphamsy lamphamsy added the WIP Work In Progress label Jun 12, 2019
@lamphamsy lamphamsy force-pushed the eh/simd_multi_levels branch 4 times, most recently from fcad024 to fae4de8 Compare June 13, 2019 10:24
@lamphamsy lamphamsy removed the WIP Work In Progress label Jun 13, 2019
Copy link
Contributor

@slaperche-scality slaperche-scality left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR, lot of simplifications.

It's really nice 🙂

}
}

// FIXME: for non-systematic FNT, `quadiron_fnt32_decode` will
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, it's cleaner to have a copy of _data/call quadiron_fnt32_decode on a copy instead of relying on the order of the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's better. A copy of encoded fragments will be used to avoid such cases.

Some global variables are no longer used as we support only FNT for
`w=T/2`, i.e.
- FNT(257) using uint16_t
- FNT(65537) using uint32_t

To clarify reader, we use const reference for VecType variable if
it's necessary.
The only support FNT with `w=T/2`, i.e.
- FNT(257) using uint16_t
- FNT(65537) using uint32_t
gives advantages:
- Operations are simplified by avoiding the argument cardinal.
- Some branches can be avoided.
In butterfly operations, there are three cases depending on the
coefficient `r`:
- r = 1
- r = q - 1
- 1 < r < q - 1
We use an enum class to clarify such cases.
according changes in modular arithmetics
@lamphamsy lamphamsy force-pushed the eh/simd_multi_levels branch 2 times, most recently from 388d6c0 to 09181fb Compare June 14, 2019 03:44
@lamphamsy
Copy link
Contributor Author

@slaperche-scality : it's updated. Thanks for your next reviews :)

- Reset metadata of decoded data: for non-systematic code, we
use first k parities to store decoded data. These metadata should be
reset.
- Remove an useless initialisation of data_vec for non-systematic codes.
Note that for non-systematic FNT, in encoding and decoding of QuadIron
C API, input data will be overwritten by output data:
- `quadiron_fnt32_encode` will store first `k` parities in the input
data buffers, and the next `m` parities in the  usual parity buffers.
- `quadiron_fnt32_decode` will overwrite input data pointers (that
stores actually encoded fragments) by decoded data.

In the test, coded fragments will be stored to use correct fragments.
They will be used to check reconstructed data.
@lamphamsy lamphamsy force-pushed the eh/simd_multi_levels branch from 856fe81 to 7147e6f Compare June 18, 2019 15:06
@lamphamsy lamphamsy merged commit 8c90b65 into master Jun 18, 2019
@lamphamsy lamphamsy deleted the eh/simd_multi_levels branch June 28, 2019 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants