feat!: drop main trace earlier for lower peak memory #71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changed the traits slightly so that traces are passed without borrowing. The main reason is the realization that preprocessed and main traces are only used to generate the permutation trace, so they can be dropped immediately after this step (in
partially_prove
). Afterwards, only LDEs need to be used.There is some improvement in how the handling of preprocessed / cached trace is done: sometimes you may want to not drop these (so they really stay in memory) and sometimes you may want to drop it to lower peak memory. Maybe some
Shared**
type may make this clearer, but for now I just opted to use owned versions of everything because in practice we are using smart pointers (Arc
) around everything, so one can get around sharing with some cloning if necessary.Note that right now the preprocessed trace is never dropped, because the proving key holds onto a copy until
Opening
is called. We could get around this with some extraOption
usage, but since the size of preprocessed trace is currently small I'll leave it for later.https://github.com/axiom-crypto/openvm-reth-benchmark/actions/runs/14749714037/job/41404170207