8000 feat!: drop main trace earlier for lower peak memory by jonathanpwang · Pull Request #71 · openvm-org/stark-backend · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat!: drop main trace earlier for lower peak memory #71

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

Merged
merged 2 commits into from
Apr 30, 2025

Conversation

jonathanpwang
Copy link
Contributor
@jonathanpwang jonathanpwang commented Apr 30, 2025

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 extra Option 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

@jonathanpwang jonathanpwang requested a review from gaxiom April 30, 2025 07:03
Copy link
Contributor
@gaxiom gaxiom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

It will help to control PcsData at any moment which is nice.

@jonathanpwang jonathanpwang merged commit 6e5a658 into main Apr 30, 2025
3 checks passed
@jonathanpwang jonathanpwang deleted the feat/early-drop branch April 30, 2025 16:11
leonardoalt pushed a commit to powdr-labs/stark-backend that referenced this pull request Jun 3, 2025
* perf: cpu `TraceCommitter` should reserve capacity for LDE (openvm-org#68)

* perf: avoid needless clones in permutation trace commit (openvm-org#69)

* perf: `transmute_to_base` to avoid needless clones

* chore: add note about p3 PR

* chore: add debug asserts for safety

* feat!: drop main trace earlier for lower peak memory (openvm-org#71)

* feat: drop main trace earlier for lower peak memory

* fix: trace_metrics

* chore: log quotient poly cells (openvm-org#72)

* feat: reserve capacity for perm & quotient LDE; avoid copy for quotient split (openvm-org#73)

* chore: log quotient poly cells

* feat: perm trace reserve extra capacity

* feat: quotient no-resize and no-copy

* fix: small trace heights

* fix: misunderstanding of vertical striding

* chore: clarify comment

* chore: bump workspace version to `1.0.1` (openvm-org#74)

* release: v1.1.0 (openvm-org#76)

* feat: update security parameters (openvm-org#20)

* chore: update status in readme (openvm-org#21)

closes INT-4015

* fix: account for poles in log up security calculation (openvm-org#22)

* chore: update readme

* fix(plonky3): update plonky3 commit for security fix

---------

Co-authored-by: Zach Langley <zblangley@gmail.com>

* perf: optimize `compute_quotient_values` (openvm-org#75)

* chore: rename keccak example to keccakf

* feat: add example to bench compute_quotient and readme

* chore: add bench script

* chore: update profile script to use perf on linux

* feat: `parallelize_chunks`

* feat: allocate once per thread

* feat: share alpha_powers and avoid `Vec::push`

* chore: bump workspace version

* feat: Export metrics to Prometheus server (openvm-org#70)

* Add metrics exporter

* Add tracing context

* Fix tokio

* Revert "Fix tokio"

This reverts commit fdd16a8.

* Install crypto provider

* Increase interval length

* Feature gate

* Small fixes

* chore: remove unused modules (openvm-org#77)

---------

Co-authored-by: Jonathan Wang <31040440+jonathanpwang@users.noreply.github.com>
Co-authored-by: Zach Langley <zblangley@gmail.com>
Co-authored-by: Manh Dinh <manh9203@gmail.com>
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.

2 participants
0