barretenberg icon indicating copy to clipboard operation
barretenberg copied to clipboard

Perform precomputation for z_perm commitment to reduce memory peak

Open ledwards2225 opened this issue 4 months ago • 0 comments

The method commit_structured_with_nonzero_complement involves making a full copy of the srs points corresponding to the complement of the "active" region of the execution trace. These points are then summed into as many accumulators as there are blocks in the trace. This calculation only requires knowledge of the trace block utilization which is known after circuit finalization. It may be advantageous to move this precomputation to somewhere prior to the construction of the "point table" in the commitment key, which contains circuit_size * 2 many points (the raw SRS points plus the corresponding endomorphism points). This doesn't effect the efficiency or memory usage of the algorithm itself but it may effect peak memory if we don't need to store both the point table and the copied data in memory simultaneously.

ledwards2225 avatar Oct 10 '24 20:10 ledwards2225