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

Add FFT-based specification for Poseidon MDS layer on x86 targets #886

Merged
merged 2 commits into from
Mar 16, 2023

Conversation

Nashtare
Copy link
Collaborator

This PR overrides the default MDS layer implementation of Poseidon on x86 targets to perform an FFT-based matrix-vector multiplication, similarly to what is done on aarch64 targets. Given that the x86_64-specific methods for Poseidon are all disabled, this can yield a significant speed-up on such targets, compared to the naive mds_row_shf implementation.

On Ubuntu 22.04, Intel® Core™ i7-9750H CPU @ 2.60GHz × 12, I am getting a 30% speed-up when running the hashing benchmark.

@Nashtare
Copy link
Collaborator Author

I've also added a custom from_noncanonical_u96() implementation for Goldilocks, as mentioned in #869.

@nbgl nbgl self-assigned this Mar 16, 2023
@Nashtare
Copy link
Collaborator Author

@nbgl I saw you assigned yourself to it, so I just rebased it with latest main.

@nbgl
Copy link
Contributor

nbgl commented Mar 16, 2023

Perfect! It looks good.

Thank you for the contribution :)

@nbgl nbgl merged commit 2d7d2ac into 0xPolygonZero:main Mar 16, 2023
@Nashtare Nashtare deleted the poseidon-native branch March 16, 2023 19:29
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

Successfully merging this pull request may close these issues.

2 participants