-
Notifications
You must be signed in to change notification settings - Fork 15
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
Remove use of Sage, reimplement field and polynomial operations #445
Conversation
22 is definitely too slow :) Another option is to just implement NTT? We only use it in FLP anyway. |
Divided differences brings the time down to 10s. These are the remaining ideas I have for algorithmic speedups:
I'll do the extended Euclidean algorithm next, as that is easy to do, and we'll see how far that gets us.
|
Test suite runtime is now 6.7s in CI and 4.1s locally for me. I think this is about as good as we can get it without a lot more complexity. |
4 seconds is doable. Have you tried generating the test vectors? Hopefully that's quick, too. My main concern about landing this is the runtime of PINE's (https://github.com/junyechen1996/draft-chen-cfrg-vdaf-pine/) unit tests, which at the moment take about 10 seconds. Let's prototype this in that repo before land this. |
Test vector generation just takes 0.6s for me. FWIW, here are the slowest tests. We could probably also speed things up by tweaking the dimensions they use, but I think that would be best handled separately.
|
I hacked this together here: junyechen1996/draft-chen-cfrg-vdaf-pine@bfe25cd As expected, the unit tests take longer, about twice as long (now 12 seconds). Test vector generation also takes about twice as long, now 120 seconds. Note that we generate test vectors for higher dimensional data for PINE than we do for Prio3. I still think we should take this change, given how much more portable it makes the reference code, but let's check with @junyechen1996 to make sure this isn't a deal breaker. |
For PINE's sake, there's one other algorithmic improvement we may want to consider other than those listed above: multiplying polynomials using NTT instead of the straightforward quadratic algorithm. This only matters when multiplying large polynomials. |
Right, as we do in libprio already. How much would we have to change the spec? I wouldn't want to have to change too much to accommodate this. In particular, I wouldn't want to make the spec less clear. |
@junyechen1996 is cool with this change. I'll review tomorrow. |
Neither |
Got it. Let's keep it that way: if anyone tells us we need to list this, then we can do so. As far as optimizing |
@@ -14,8 +14,6 @@ draft-patton-cfrg-vdaf.xml | |||
lib | |||
report.xml | |||
venv/ | |||
sagelib | |||
*.sage.py |
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.
Man, remember when we we're just had a bunch of .sage
files? That was truly terrible. Thank you so much for your hard work on the software engineering for this spec.
This is a first attempt at #431. It works, and it's slower, which is to be expected, but currently it's a lot slower. Unit tests take 22 seconds instead of 2 seconds. I think I may take a second pass at polynomial interpolation, using the method of divided differences, and see if that improves the speed somewhat.