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

Polynomial allocation benchmark jump in AztecIvc #1072

Open
ledwards2225 opened this issue Aug 14, 2024 · 0 comments
Open

Polynomial allocation benchmark jump in AztecIvc #1072

ledwards2225 opened this issue Aug 14, 2024 · 0 comments

Comments

@ledwards2225
Copy link
Collaborator

ledwards2225 commented Aug 14, 2024

For unknown reasons, this seemingly unrelated PR more than doubles the time it takes to allocate polynomials in the aztec_ivc_bench. Both master and branch are constructing polys of size $2^{19}$. (I confirmed this explicitly but its also evident from the fact that none of the other bench metrics increase). The client_ivc_bench was not affected. I can't explain this. It's possible it's simply an accounting error in the bench timings but I can't see how that could be either. I'm leaving this an open question for now since AztecIvc is not fully integrated outside of bberg, and this pattern of instantiating memory for all polynomials at once is about to change.

Before:

-----------------------------------------------------------------------------------------
Benchmark                               Time             CPU   Iterations UserCounters...
-----------------------------------------------------------------------------------------
AztecIVCBench/FullStructured/6      36402 ms        33426 ms            
DEBUG:ProverPolynomials()=12 DEBUG:ProverPolynomials()(t)=1.53276G 

function                                  ms     % sum
construct_circuits(t)                   4476    12.34%
ProverInstance(Circuit&)(t)             4606    12.69%
ProtogalaxyProver::fold_instances(t)   21726    59.88%
Decider::construct_proof(t)             1645     4.53%
ECCVMProver(CircuitBuilder&)(t)          235     0.65%
ECCVMProver::construct_proof(t)         2597     7.16%
TranslatorProver::construct_proof(t)     821     2.26%
Goblin::merge(t)                         180     0.50%

After:

-----------------------------------------------------------------------------------------
Benchmark                               Time             CPU   Iterations UserCounters...
-----------------------------------------------------------------------------------------
AztecIVCBench/FullStructured/6      38855 ms        36066 ms            1 
DEBUG:ProverPolynomials()=12 DEBUG:ProverPolynomials()(t)=3.68002G 

function                                  ms     % sum
construct_circuits(t)                   4474    11.61%
ProverInstance(Circuit&)(t)             6787    17.62%
ProtogalaxyProver::fold_instances(t)   21788    56.55%
Decider::construct_proof(t)             1655     4.30%
ECCVMProver(CircuitBuilder&)(t)          235     0.61%
ECCVMProver::construct_proof(t)         2585     6.71%
TranslatorProver::construct_proof(t)     824     2.14%
Goblin::merge(t)                         177     0.46%
ledwards2225 added a commit to AztecProtocol/aztec-packages that referenced this issue Aug 14, 2024
Introduces more in depth testing of the AztecIvc scheme, including tests
that mimic the benchmark setup as well as more in depth tests for the
inter-circuit databus consistency checks.

Other noteworthy components of this PR:
- Introduces utility class `PrivateFunctionExecutionMockCircuitProducer`
for consistently generating mock circuits (shared between the benchmark
and this new test suite). Subclass `MockDatabusProducer` incorporates
nontrivial databus interactions into these circuits for the first time.
- Removes the old `accumulate()` method on AztecIvc (which
simultaneously added recursive verifiers and performed prover work) in
favor of two methods that separate the logic but combine to the same
effect: `complete_kernel_circuit_logic()` and a new `accumulate()`
(which now only performs the prover work).

Confusing jump in benchmark explained in
[this](AztecProtocol/barretenberg#1072) issue:

```
-----------------------------------------------------------------------------------------
Benchmark                               Time             CPU   Iterations UserCounters...
-----------------------------------------------------------------------------------------
AztecIVCBench/FullStructured/6      38855 ms        36066 ms            1 Arithmetic::accumulate=4.03742M DEBUG:ProverPolynomials()=12 DEBUG:ProverPolynomials()(t)=3.68002G 

function                                  ms     % sum
construct_circuits(t)                   4474    11.61%
ProverInstance(Circuit&)(t)             6787    17.62%
ProtogalaxyProver::fold_instances(t)   21788    56.55%
Decider::construct_proof(t)             1655     4.30%
ECCVMProver(CircuitBuilder&)(t)          235     0.61%
ECCVMProver::construct_proof(t)         2585     6.71%
TranslatorProver::construct_proof(t)     824     2.14%
Goblin::merge(t)                         177     0.46%
```
AztecBot pushed a commit that referenced this issue Aug 15, 2024
Introduces more in depth testing of the AztecIvc scheme, including tests
that mimic the benchmark setup as well as more in depth tests for the
inter-circuit databus consistency checks.

Other noteworthy components of this PR:
- Introduces utility class `PrivateFunctionExecutionMockCircuitProducer`
for consistently generating mock circuits (shared between the benchmark
and this new test suite). Subclass `MockDatabusProducer` incorporates
nontrivial databus interactions into these circuits for the first time.
- Removes the old `accumulate()` method on AztecIvc (which
simultaneously added recursive verifiers and performed prover work) in
favor of two methods that separate the logic but combine to the same
effect: `complete_kernel_circuit_logic()` and a new `accumulate()`
(which now only performs the prover work).

Confusing jump in benchmark explained in
[this](#1072) issue:

```
-----------------------------------------------------------------------------------------
Benchmark                               Time             CPU   Iterations UserCounters...
-----------------------------------------------------------------------------------------
AztecIVCBench/FullStructured/6      38855 ms        36066 ms            1 Arithmetic::accumulate=4.03742M DEBUG:ProverPolynomials()=12 DEBUG:ProverPolynomials()(t)=3.68002G 

function                                  ms     % sum
construct_circuits(t)                   4474    11.61%
ProverInstance(Circuit&)(t)             6787    17.62%
ProtogalaxyProver::fold_instances(t)   21788    56.55%
Decider::construct_proof(t)             1655     4.30%
ECCVMProver(CircuitBuilder&)(t)          235     0.61%
ECCVMProver::construct_proof(t)         2585     6.71%
TranslatorProver::construct_proof(t)     824     2.14%
Goblin::merge(t)                         177     0.46%
```
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

No branches or pull requests

1 participant