You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be nice to add this estimation into the code. Maybe it can be a halo2_backend function that receives a ConstraintSystemMid and returns the estimated memory? This way different backends can report different memory estimations.
Another point of discussion is that it would be great to figure out the new memory estimation formula from #274
The text was updated successfully, but these errors were encountered:
Recently @han0110 did an analysis of peak memory estimation for halo2 proving, with a script implementation that takes a
ConstraintSystem
and estimates the peak memory of the prover. I ported that script to the zkevm-circuits and it can be seen here: https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/3bbc757a20d9d9f7759db47c096d5395361bee74/zkevm-circuits/src/bin/stats/halo2_stats.rs#L232Recently I ran some benchmarks with this test circuit in https://github.com/privacy-scaling-explorations/halo2/blob/1650a0b07fbbfeebab71f5650ccb62ccd20de0ff/halo2_proofs/tests/frontend_backend_split.rs to measure the peak memory and verify how accurate the estimation is, and I'm happy to report that the estimation is very accurate!
These are the characteristics of the circuit (where
wf
is theWIDTH_FACTOR
and can be parametrized):These are the results for
k = 10,12,14,16,18
andwf = 1,2,3,4,5,6
(memory values in MiB):The estimation is ~98% of the measured peak memory.
You can reproduce these tests from this branch https://github.com/privacy-scaling-explorations/halo2/tree/test/bench-mem-peak using this script https://github.com/privacy-scaling-explorations/halo2/blob/test/bench-mem-peak/halo2_proofs/bench.sh
Discussion
I think it would be nice to add this estimation into the code. Maybe it can be a
halo2_backend
function that receives aConstraintSystemMid
and returns the estimated memory? This way different backends can report different memory estimations.Another point of discussion is that it would be great to figure out the new memory estimation formula from #274
The text was updated successfully, but these errors were encountered: