-
Notifications
You must be signed in to change notification settings - Fork 56
Streaming Prover, reduce memory overhead of prover #3
Comments
After some testing it seems the disk load of the proving key is nearly instant, however when using the standard Part of the problem is the I think if this could be sped up then the prove / verify time would be reduced significantly, and more importantly in relation to the number of circuits. How can it take 1 minute (after loading all the data from disk) to parse 2.5m lines? With a larger number of circuits this will take even longer... |
So:
None of the classes above have any other variables other than those noted. So, assuming tight packing, an If these assumptions are true, then it should be possible to dump the proving key in a way which can be Need to investigate the density of the |
With the LongsightF gadget this seems like less of a priority as the serialised circuit is quite small compared to the full SHA256 merkle tree proof gadget. |
See:
There are optimisations which can be made which reduce the necessary amount of in-memory data required for the proving key.
mmap
'd and let the kernel figure it out.Load each one at a time, rather than all of them.
Either way, need to create a benchmark for
prove
which tracks the peak memory usage.Any changes should avoid modifying
libsnark
directly, we still want to use it as a submodule.With the
mmap
approach, if the offsets & sizes of sections for A, B, C, K and H are known ahead of time, thenmadvise
can be used depending on the access pattern. If it's purely sequential thenMADV_SEQUENTIAL
can be used, however if it's at random then doing a pre-emptive sequential read into memory will offer a performance improvement.Either way - disk reads vs memory usage trade-off again.
The text was updated successfully, but these errors were encountered: