demo: prover execution improvements#2002
Draft
Mirko-von-Leipzig wants to merge 3 commits intomainfrom
Draft
Conversation
Comment on lines
+38
to
+39
| [profile.test.package."*"] | ||
| opt-level = 3 |
Collaborator
Author
There was a problem hiding this comment.
This can be much more specific, I just haven't bothered bisecting.
Collaborator
Author
|
I've also had the thought that maybe the maybefuture could be an issue. Since futures are state machines they're actually generics in disguise |
Collaborator
Author
|
I've since opened #2004 which works around the runtime execution problem for now. I do think this is also the cause of the slow compile times. The generics in question come all the way from the foundational The further back we can push |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PoC PR includes patches of the protocol crates which prevent generics from leaking into the node when proving.
This is of import because currently running a single proof test takes over a minute due to any proofs taking forever e.g. 1min+ on an M5, 6min+ on CI.
This occurs despite setting all dependencies to
opt-level=3because the generics involved only get set in the final binary. This means they use the optimisation level of the final binary and therefore are unoptimised.A dissatisfactory work around is to run CI with
--release + debuginfo. However this doesn't scale as any upstream of protocol would experience this. Much better would be if we could specify that a particular dependency should be optimised e.g. miden-crypto so that account grinding is faster.Test bench
I ran
as my bench. Before it took ~1 minute, after 1.7s, matching the same with
--release.What
This patches prover and tx crates to remove generics and prevent inlining. No attempt at minimsation was done - its possible that only some deltas are actually required.
Patches were AI driven.
Notably, even p3 generics were still present at the final compilation step.
I hope this is a starting point.
Results
Compile times
Note that this should also improve compile times since generics get pushed further back into deps. There is room for improvement I think.