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

feat!: fflonk #38

Merged
merged 2 commits into from
Oct 31, 2024
Merged

feat!: fflonk #38

merged 2 commits into from
Oct 31, 2024

Conversation

robik75
Copy link
Member

@robik75 robik75 commented Oct 24, 2024

This is a re-do of #28.

What ❔

This PR implements all the functionality necessary to prove the fflonk compression chain on a GPU, taking the scheduler proof as input and producing a compression proof for the fflonk wrapper.
A new method for generating the GpuSetup and VerificationKey structures using a GPU is also implemented.

The fflonk compression chain is made up of 5 circuit proofs, last proof in the chain is the compression proof for the wrapper and uses poseidon 2 over BN254 scalar field for commitment.

Proving of the whole chain can be tested with the run_proof_compression_by_schedule test.

Measurements of proving times on the L4 GPU:

compression circuit 1: 0.5 s
compression circuit 2: 2.2 s
compression circuit 3: 5.8 s
compression circuit 4: 22.7 s
compression for wrapper circuit: 192.1 s

End to end, including loading setup data from disk, producing witnesses etc., the chain can be proven in ~230 seconds.
The highest GPU memory requirement is 14.2 GB.

This PR changes shivini's proving API and the GpuSetup structure, dependent code will need to be adjusted and serialized gpu setup files will need to be recreated.
GpuSetup::from_setup_and_hints function was removed, the gpu_setup_and_vk_from_base_setup_vk_params_and_hints function was implemented as a replacement.

Why ❔

fflonk proofs are cheaper to verify on L1.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via cargo fmt and linted via cargo clippy.

@robik75 robik75 requested a review from saitima October 24, 2024 17:39
@robik75 robik75 self-assigned this Oct 24, 2024
@saitima saitima mentioned this pull request Oct 24, 2024
4 tasks
saitima
saitima previously approved these changes Oct 24, 2024
saitima
saitima previously approved these changes Oct 29, 2024
saitima
saitima previously approved these changes Oct 30, 2024
@robik75 robik75 merged commit 33ed62a into main Oct 31, 2024
13 checks passed
@robik75 robik75 deleted the rr/fflonk branch October 31, 2024 11:16
robik75 pushed a commit that referenced this pull request Oct 31, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.152.0](v0.151.1...v0.152.0)
(2024-10-31)


### ⚠ BREAKING CHANGES

* fflonk
([#38](#38))

### Features

* fflonk
([#38](#38))
([33ed62a](33ed62a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: zksync-era-bot <[email protected]>
saitima added a commit that referenced this pull request Oct 31, 2024
# What ❔

Implements fflonk protocol for the cuda.

## Why ❔


## Checklist


- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.

## Prerequisites
- [PR
matter-labs/zksync-crypto#11](matter-labs/zksync-crypto#11)
- [PR #38 ]

---------

Co-authored-by: Michael Carilli <[email protected]>
Co-authored-by: zksync-era-bot <[email protected]>
Co-authored-by: zksync-era-bot <[email protected]>
Co-authored-by: Robert Remen <[email protected]>
Co-authored-by: Daniyar Itegulov <[email protected]>
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