Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1.5x - 1.7x speedup on EltwiseFMAModAVX512IFMA using a few tricks also used in the NTT:
Switch to IFMA 52-bit mullo when computing
vq_times_mod
. The speedup is likely due to better pipelining on the same portUse the negative modulus,
neg_p
. This helps computeq := a * b - q * p
via two steps:tmp = a * b; q = fma(tmp, q, neg_p)
rather than the previous three steps:tmp = a*b; tmp2 = q*p; q = tmp - tmp2
(see line 2 of Algorithm 4 in https://arxiv.org/pdf/2012.01968.pdf for background)Additionally, for the case when the addition argument
arg3 != nullptr
, merging the two modular reductions led to a slight speedup.On ICX with clang-12, I see