Skip to content

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

Merged
gbotrel merged 25 commits intomasterfrom
perf/v2_arm64
Dec 10, 2024
Merged

perf: adds (some) arm64 assembly for 4 and 6 words modulus#554
gbotrel merged 25 commits intomasterfrom
perf/v2_arm64

Conversation

@gbotrel
Copy link
Copy Markdown
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
Copy Markdown

cor commented Oct 25, 2024

This is fantastic! Thanks

@gbotrel gbotrel merged commit 35d2a69 into master Dec 10, 2024
@gbotrel gbotrel deleted the perf/v2_arm64 branch December 10, 2024 14:36
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.

3 participants