Skip to content
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

Large batch sizes with SupraSeal #320

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Large batch sizes with SupraSeal #320

wants to merge 3 commits into from

Conversation

vmx
Copy link

@vmx vmx commented Dec 14, 2023

When using proof batch sizes > 10, things will take a lot of memory. There's now a memory optimized code path which is only enabled for SupraSeal as it takes advantage of the shape of the Filecoin circuits. It may not be as efficient with other circuits.

This PR doesn't change the current PoRep behaviour, it is a different code path only if the proofs size is >10, which is the case for e.g. non-interactive PoRep. With these changes, non-interactive PoRep, which has about 12.6x times the proofs to do compared to the interactive PoRep, runs only about 8x slower, while not taking more memory.

vmx added 3 commits December 14, 2023 15:18
This is the first step of make more code share between the native
and the SupraSeal implementation possible.
Refactor things similar to the SupraSeal code.
SupraSeal is so efficient as it leverages the fact that the Filecoin
circuits have a specific shape. This can also be used for a more
memory efficient representation during synthesis.

This makes the synthesis less memory intensive and thus makes it
possible to synthesize more circuits in parallel. The prover still
needs the normal representation, hence is still memory intensive.
We run a batch size of 5 instead of 10, which even reduces that memory
footprint a lot which justified the additional computation costs.

Those changes enables proving a large number of proofs pretty
efficiently, which makes it suitable for Filecoins non-interactive
PoRep.

All those optimization are only for the SupraSeal code path as they
are kind of Filecoin specific.
@vmx
Copy link
Author

vmx commented Dec 15, 2023

Sorry I accidentally pushed a change, but I reverted back to what it was.

@vmx vmx marked this pull request as draft December 18, 2023 11:39
@vmx
Copy link
Author

vmx commented Dec 18, 2023

I've converted it to draft, as it needs more work. The CPU usage is not ideal, sometimes the Rayon thread pool is used by the synthesis, which then blocks the representation conversion. Ideally the Synthesis runs whenever the GPU is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant