-
Notifications
You must be signed in to change notification settings - Fork 315
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
Streaming contribution and fast contribution i/o #1188
Conversation
b432487
to
2c1d520
Compare
2c1d520
to
7db5a31
Compare
Whoo, those are nice benchmarks. |
9be7d91
to
b1c789b
Compare
Just a few comments, mostly about logs. |
135dcbd
to
faba65f
Compare
@DrPeterVanNostrand I think I have addressed all of your comments in my latest commit. In some cases, the resolution was different than your suggestion, for reasons I have clarified in my responses above. |
filecoin-proofs/Cargo.toml
Outdated
phase2 = { package = "phase21", version = "0.6.0" } | ||
simplelog = "0.8.0" | ||
phase2 = { version = "0.7.0", package = "phase21" } | ||
simplelog = "0.7.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should accept the simplelog
version bump that's currently in master.
Everything looks good to me. Thank you for these changes! |
c8351f6
to
17211d1
Compare
17211d1
to
5477906
Compare
This PR adds streaming contribution to phase2 and makes it the default. This caps memory usage. The somewhat arbitrarily chosen batch size seems to keep memory usage around 20MB without a performance penalty.
This PR also add support for 'raw i/o'. This means that the read/write operations in the streaming hot path avoid expensive transformations in and out of montgomery space. This makes contribution ~10x faster.
The expected net result of this PR is that contribution to even our large circuits should be possible in reasonable time and without extremely beefy hardware. (Actual times and RAM usage will need to be measured on real hardware, of course.)
Summary of benchmarks for contribution:
Before (non-streaming non-raw) contribution time: 51.62s
Before mem: 53460992 bytes
After (streaming raw) contribution time: 5.26s
After mem: 19374080
Note: these benchmarks don't reflect realistic RAM reduction for large circuits, because the small circuit being used only requires ~50MB RAM. The benefits of streaming will rise for large circuits, which otherwise currently require 55GB RAM. NOTE: streaming is not yet tested on large params, so the claimed cap is a reasoned expectation which still needs verification.
After: