-
Notifications
You must be signed in to change notification settings - Fork 284
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
chore: parallelise inverse polynomial construction for lookup relations #10413
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,8 +206,8 @@ template <IsUltraFlavor Flavor> void OinkProver<Flavor>::execute_log_derivative_ | |
|
||
{ | ||
PROFILE_THIS_NAME("COMMIT::lookup_inverses"); | ||
witness_commitments.lookup_inverses = | ||
proving_key->proving_key.commitment_key->commit(proving_key->proving_key.polynomials.lookup_inverses); | ||
witness_commitments.lookup_inverses = proving_key->proving_key.commitment_key->commit_sparse( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are they really (going to be) sparse in practice? |
||
proving_key->proving_key.polynomials.lookup_inverses); | ||
} | ||
transcript->send_to_verifier(domain_separator + commitment_labels.lookup_inverses, | ||
witness_commitments.lookup_inverses); | ||
|
Oops, something went wrong.
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.
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.
Just a comment because I see a lot of microoptimisation going on: have you guys profiled where the time is going?
IIRC when I did some profiling for the AVM (which luckily does not use this relation, since we already parallelize) a lot of time was spent in
get_row
which (according to some comments) "was only meant for debugging"If this is still true, you'd benefit far more if you could save which rows need an inverse, and only act on those (therefore O(needs_inverse) vs O(rows)). I think this is true for the AVM (where the cost of get_row is really big) and I have some ideas on how to implement this. However, for general bb, the problem is that the whole proving system is stateless in terms of relations. That is, everything uses
Relation::method
, and notrelation_instance.method
.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.
I actually looked into the issue here AztecProtocol/barretenberg#940 and we indeed only use
get_row
for those that need an inverse (achieved by checkingq_lookup
andlookup_read_target
polynomial). I'm optimising with the scope of reducing the impact of using a larger trace structure when keeping the same circuit content (so introducing more sparsity in the trace). I did indeed profiledget_row
and the time spent doing it is not getting worse because we avoid calling it when not needed. We still are spending around 3.5s callingget_row
but as Luke noted in the issue moving to a different pattern requires more involved work and we want to eliminate the existing low hanging fruits first.