-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mixed-radix NTT support all orderings #371
Conversation
41c5c9e
to
7c450d4
Compare
5c6da0c
to
3aecf8e
Compare
3aecf8e
to
c7637d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One issue I have with this PR is that it's possible to force old radix-2 algorithm with an ordering like NM
or MN
. It might seem like test_ntt_batch
checks correctness of it but it only compares batch and non-batch outputs of the same algorithm. While the outputs for radix-2 are consistent, they are not correct. Correct me if I'm wrong here. In terms of how to deal with NM
and MN
orderings in radix-2 NTT - I'm fine with a runtime error tbh cos it doesn't make a lot of sense.
About Rust NTT tests - they now take a pretty long time. One idea might be to put looping over the two algorithms as deeply as possible instead of at the very beginning of the test. This should reduce the CPU side work which is where the vast majority of test time goes into. Also it should make diffs much smaller and nicer to look at.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all in all looks fine, just wanted to ask - did you make sure that the changes to the reordering kernels didn't harm the performance of the simple cases (I don't think the should, but just to verify)
@DmytroTym @HadarIngonyama You are right that the batch test is only testing that batch computation is equivalent to a simple loop over the elements with btach=1 for each. User who want to specifically get R should specify R, not M and this is a stronger request. For radix-2 it's free but for mixed-radix alg it's more expensive and therefore if not required (like for poly multiplication) then M is good enough. Regarding rust tests, TBH I did not think about it too much and thought that most of the time is building but yes you are right I will try to nest the loop and avoid reallocation of arrays etc. The small downside of that is that in-place computations (when/if we add them) may fail or behave different then expected although since we randomize inputs it's maybe not really a problem. |
@HadarIngonyama do you mean that NN for example is not slower now? I did not verify since I did not think there should be any difference at all but I will verify just to be 100% sure. |
920f112
to
98682f7
Compare
98682f7
to
7b72282
Compare
## Contents of this release [FEAT]: support for multi-device execution: #356 [FEAT]: full support for new mixed-radix NTT: #367, #368 and #371 [FEAT]: examples for Poseidon hash and tree builder based on it (currently only on C++ side): #375 [PERF]: MSM performance upgrades & zero point handling: #372
No description provided.