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

A0-3858: Benchmark on-chain verifier (1/2) #1583

Merged
merged 14 commits into from
Jan 30, 2024
Merged

Conversation

pmikolajczyk41
Copy link
Member

@pmikolajczyk41 pmikolajczyk41 commented Jan 25, 2024

Description

We run benchmarks for the on-chain verifier.

Even though the actual verification happens in the aleph-runtime-interfaces crate, we have to put them in the chain extension library for two reasons:

  1. we already have benchmarking setup ready for the CE and it is CE, that is the only consumer of these metrics
  2. additionally, we need to measure verification key access

For now, we use only a single circuit. The follow-up PR will extend measurements for other layouts.

There was also a very nasty bug introduced in #1405 which turned off custom host functions from the benchmarking node. It has been fixed in this PR.

For the people who can read halo2 diagrams, a diagram of a circuit <5,3>:
image

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have made neccessary updates to the Infrastructure
  • I have made corresponding changes to the existing documentation
  • I have created new documentation

@pmikolajczyk41 pmikolajczyk41 added this pull request to the merge queue Jan 30, 2024
Merged via the queue into main with commit ea11e6e Jan 30, 2024
17 checks passed
@pmikolajczyk41 pmikolajczyk41 deleted the a0-3858-bench-veri branch January 30, 2024 10:24
github-merge-queue bot pushed a commit that referenced this pull request Feb 5, 2024
# Description

Follow-up to #1583:

1. Make `BenchCircuit` non-generic: it posed ridiculous problems when
trying to run proof generation for a matrix of parameters.
2. Run trusted setup for `k = 20` (it took ~2h on `12th Gen Intel® Core™
i7-12800H × 20` with `16GB` RAM)
3. Run actual benchmarks for a cartesian product of parameters:
  - number of instances from `[1, 2, 8, 16, 64, 128]`
- gate blowup from `[1, 8, 64, 512, 4096]` (maximum number of rows was
`128 · 4096 ~= 0.5M`

To avoid awful boilerplate with 30 repeated functions in the benchmark
suite, I wrote a semi-awful macro.

I added all the artifacts to VCS, but unfortunately I forgot to save
SRS... 🙈 in case we need to rerun benches, we have to
remember about it 😛

## Type of change

Please delete options that are not relevant.

- New feature (non-breaking change which adds functionality)

# Checklist:

- I have made neccessary updates to the Infrastructure
- I have made corresponding changes to the existing documentation
- I have created new documentation
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