barretenberg icon indicating copy to clipboard operation
barretenberg copied to clipboard

Polynomial allocation benchmark jump in AztecIvc

Open ledwards2225 opened this issue 6 months ago • 0 comments

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 avatar Aug 14 '24 16:08 ledwards2225