-
Notifications
You must be signed in to change notification settings - Fork 237
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
Optimized Pippenger #60
Comments
Yeah, this is definitely a good thing to investigate; it would provide an immediate speed up to many downstream SNARK applications |
Here is an implementation of the matter-labs team https://github.com/matter-labs/eip1962/blob/master/src/multiexp.rs, and the algo described here https://github.com/matter-labs/eip1962/blob/master/documentation/Algorithms_for_EIP1962.pdf (Algorithm 12) |
It looks identical to bellman/zexe. Are you sure it uses the described trick? Dusk PLONK uses zexe implementation, so i doubt a rust implementation already exists, only Aztec's in C++, see also |
Did not check it, @swasilyev, since it was a new implementation I wanted just to share it, in case is valuable. |
At least for the Edwards curves I'd think https://github.com/dalek-cryptography/curve25519-dalek/blob/master/src/backend/serial/scalar_mul/pippenger.rs comes close (see dalek-cryptography/curve25519-dalek#249 and dalek-cryptography/curve25519-dalek#259) |
From what I understand, the impl in PLONK has some different components in the MSM, namely it directly computes with affine elements, and then does a batch inversion. I think the fork in o1-labs/Zexe has a partial impl of this, so it could be a good idea to try and upstream that |
This affine based MSM with a radix sort of the bucket index followed by a vectorised addition tree is available in celo-org/zexe#4 |
Btw, ~2.2x is because 1.6-1.7x is due to adox/adcx. The other 1.4x is explained by the batch affine addition tree. Which we have achieved. |
Results for 2^20 pippenger on 8-core Ryzen 4800H w/ 8MB L3 and 4.1GHz sustained all core boost, with SMT on: The fat to be trimmed is not a Zexe issue, but lies in the radix sort used from an external library, which takes around 90ms compared to barretenberg's < 48ms. Once we trim the radix sort to be more cache friendly for multicore, hopefully we can close the gap. |
I assume that Zexe variable base multiexp is inherited from bellman. In section "New advances in multi-scalar-multiplication over elliptic curves" of this document by Aztec team it is shown that there is a 2x improvement.
The text was updated successfully, but these errors were encountered: