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

perf: adds (some) arm64 assembly for 4 and 6 words modulus #554

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

gbotrel
Copy link
Collaborator

@gbotrel gbotrel commented Oct 21, 2024

Description

This PR refactors the code generation in field/ to allow some space for the various scenarios (generating only amd64, amd64 and arm64, none), depending on modulus size.

It adds element.Mul and element.Butterfly in arm64 assembly.

Context is to make the library and its direct users more cost efficient on arm machines.

How has this been benchmarked?

cherry picked, running on c8g.16xlarge;
bls12-377/fr

ElementMul-64                       25.6ns ± 0%  23.5ns ± 0%   -8.31%
ElementButterfly-64                 9.79ns ± 0%  5.32ns ± 0%  -45.69%

bls12-377/fp

ElementMul-64                       52.8ns ± 0%  44.8ns ± 0%  -15.10%
ElementButterfly-64                 12.4ns ± 0%   6.6ns ± 0%  -46.72%

bls12-377/fr/fft

FFT/fft_2**18bits-64                                    2.93ms ± 0%  2.03ms ± 0%  -30.83%  (p=0.029 n=4+4)
FFT/fft_2**18bits_(coset)-64                            3.31ms ± 0%  2.39ms ± 0%  -27.83%  (p=0.029 n=4+4)

bls12-377/fr/sis

15-20% improvements

bls12-377/

10-15% improvements on most ecc point operations

bw6-761/fp

BenchmarkElementMul-16     250           182           -27.18%

@gbotrel gbotrel requested a review from Tabaie October 22, 2024 20:31
@cor
Copy link

cor commented Oct 25, 2024

This is fantastic! Thanks

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