Skip to content
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

Poseidon is slower than that in plonky2 #269

Open
dreamATD opened this issue Sep 23, 2024 · 3 comments
Open

Poseidon is slower than that in plonky2 #269

dreamATD opened this issue Sep 23, 2024 · 3 comments

Comments

@dreamATD
Copy link
Collaborator

dreamATD commented Sep 23, 2024

Initial look at the benchmarks is a bit mystifying: broke down the parts of the permutation bench into full rounds and partial rounds, and both of these are slower in the Ceno port. Further benchmarked the parts of a full round -- the round constant update, the monomial S-box, and the MDS matrix transform -- and strangely, at this level the performance difference vanished.

Probably would be worth applying some more in-depth analysis tools to the respective Poseidon::full_rounds functions to see what is going on. If I have time soon I might give it a look, but I don't have a ton of background in this level of optimization if there's anyone else who already knows the right tools.

Originally posted by @bgillesp in #180 (comment)

@matthiasgoergens
Copy link
Collaborator

Btw, are we using Poseidon version 1 or 2?

@bgillesp
Copy link
Collaborator

bgillesp commented Oct 4, 2024

Looks like version 1 from what I can tell... The port was directly from the Plonky2 codebase, and their implementation starts with the following comment:

//! Implementation of the Poseidon hash function, as described in
//! <https://eprint.iacr.org/2019/458.pdf>

To make sure, is https://eprint.iacr.org/2023/323 the version 2 you're referring to?

@matthiasgoergens
Copy link
Collaborator

matthiasgoergens commented Nov 29, 2024

Yes, I think that's the one. https://github.com/0xmozak/mozak-vm also has an implementation with plony2 Goldilocks.

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

No branches or pull requests

3 participants