Skip to content

perf,memory: fft without precompute#472

Merged
gbotrel merged 18 commits intomasterfrom
feat/fftnoprecompute
Dec 21, 2023
Merged

perf,memory: fft without precompute#472
gbotrel merged 18 commits intomasterfrom
feat/fftnoprecompute

Conversation

@gbotrel
Copy link
Copy Markdown
Collaborator

@gbotrel gbotrel commented Dec 14, 2023

In short, this PR allows for fft.NewDomain() to have an option fft.WithoutPrecompute() which initializes the domain without precomputing (all) twiddles & coset tables.

For large domains, this save a huge amount of memory at the cost of 20-30% CPU perf downgrade.

To simplify code, it modifies existing inner DIF and DIT fft methods to take a precomputed twiddle table and a starting stage; so twiddles can still be precomputed but we skip the first stages (each stage we skip we save domain.Cardinality / stage*2 memory).

@github-actions
Copy link
Copy Markdown

📦 github.com/consensys/gnark-crypto/ecc/bls12-377/fr/fft
TestBitReverse 0s

📦 github.com/consensys/gnark-crypto/ecc/bls12-377/fr/fri
TestFRI 0s

@github-actions
Copy link
Copy Markdown

📦 github.com/consensys/gnark-crypto/ecc/bls12-377/fr/fft
TestBitReverse 0s

📦 github.com/consensys/gnark-crypto/ecc/bls12-377/fr/fri
TestFRI 0s

Copy link
Copy Markdown
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conditional accept - I do not have enough knowledge about FFTs and twiddles to understand if done correctly. But making the computation optional seems correct.

If not urgent then I would ask @ThomasPiellard to confirm.

@gbotrel gbotrel merged commit 5d5eded into master Dec 21, 2023
@gbotrel gbotrel deleted the feat/fftnoprecompute branch December 21, 2023 17:19
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