Skip to content

feat: use fft without precomputing twiddles in plonk prove#969

Merged
gbotrel merged 8 commits intofeat/smallerpkfrom
refactor/fftdomain
Dec 21, 2023
Merged

feat: use fft without precomputing twiddles in plonk prove#969
gbotrel merged 8 commits intofeat/smallerpkfrom
refactor/fftdomain

Conversation

@gbotrel
Copy link
Copy Markdown
Collaborator

@gbotrel gbotrel commented Dec 15, 2023

Motivation of the PR: running plonk.Prove w/ BW6 on 130M constraint was too memory greedy for most hardware.

This PR slows down the Prover by 10-15% but the Prover uses much (much) less memory.

Perf impact on prove before this PR:

=== RUN   TestBLS12InBW6MultiHashed
compile took 22.614055867s for nbProofs 100
nb constraints 28047074 average per proof 280470
setup took 1m58.639635033s
prove took 2m42.809254321s
verify took 10.179101ms
--- PASS: TestBLS12InBW6MultiHashed (680.05s)
PASS
ok      github.com/consensys/gnark/std/recursion/plonk  680.636s

After:

=== RUN   TestBLS12InBW6MultiHashed
compile took 23.149326392s for nbProofs 100
nb constraints 28047074 average per proof 280470
setup took 55.334003778s
prove took 3m9.001364241s
verify took 8.768578ms
--- PASS: TestBLS12InBW6MultiHashed (293.08s)
PASS
ok      github.com/consensys/gnark/std/recursion/plonk  293.693s

For this example, PlonK prove is 16% slower.

dependabot bot and others added 5 commits December 20, 2023 13:04
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.12.0 to 0.17.0.
- [Commits](golang/crypto@v0.12.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
perf(ecdsa): use GLV in JointScalarMulBase
* chore: update go.mod

* chore: follow native transcript

* chore: follow native transcript

* chore: go generate

* fix: do not pad challenge in fri

* chore: gnark-crypto update

* feat: pad challenge always to full field element

* fix: remove domain separation in test

* fix: report actual block size for compatibility

* chore: go mod update

* revert: remove domain separation

* chore: follow gnark-crypto options

* chore: go generate

* chore: remove constant package

* chore: go mod update

* refactor: remove constant/ generation
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.

All good. I would just update gnark-crypto dependency after merging Consensys/gnark-crypto#472 to point to master. Otherwise if we delete the corresponding branch on gnark-crypto side and go proxy cache is flushed we have tangling reference.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ gbotrel
✅ yelhousni
✅ ivokub
❌ dependabot[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@gbotrel gbotrel merged commit 5914b12 into feat/smallerpk Dec 21, 2023
@gbotrel gbotrel deleted the refactor/fftdomain branch December 21, 2023 17:34
gbotrel added a commit that referenced this pull request Dec 21, 2023
* refactor: step 1 make pk lighter

* perf: setup can use kzg lagrange too

* perf: less Clone in plonk Prove

* style: code cleaning

* style: clean deadcode

* fix: remove fft import from test

* feat: use fft without precomputing twiddles in plonk prove (#969)

* feat: update to latest gnark crypto fft stuff

* test: all test OK

* chore(deps): bump golang.org/x/crypto from 0.12.0 to 0.17.0 (#973)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.12.0 to 0.17.0.
- [Commits](golang/crypto@v0.12.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* perf(ecdsa): use GLV in JointScalarMulBase

* fix: swith points order in JointScalarMulBase

* chore: adapt changes from native Fiat-Shamir transcript (#974)

* chore: update go.mod

* chore: follow native transcript

* chore: follow native transcript

* chore: go generate

* fix: do not pad challenge in fri

* chore: gnark-crypto update

* feat: pad challenge always to full field element

* fix: remove domain separation in test

* fix: report actual block size for compatibility

* chore: go mod update

* revert: remove domain separation

* chore: follow gnark-crypto options

* chore: go generate

* chore: remove constant package

* chore: go mod update

* refactor: remove constant/ generation

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Youssef El Housni <youssef.housni21@gmail.com>
Co-authored-by: Youssef El Housni <youssef.elhousni@consensys.net>
Co-authored-by: Ivo Kubjas <ivo.kubjas@consensys.net>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Ivo Kubjas <ivo.kubjas@consensys.net>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Youssef El Housni <youssef.housni21@gmail.com>
Co-authored-by: Youssef El Housni <youssef.elhousni@consensys.net>
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.

4 participants