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

Preallocate witness before synthesis #143

Merged
merged 1 commit into from
Nov 28, 2023
Merged

Preallocate witness before synthesis #143

merged 1 commit into from
Nov 28, 2023

Conversation

winston-h-zhang
Copy link
Member

Addresses #137 and replaces #138.

This PR uses the new API in WitnessCS to preallocate the witness buffers before calling synthesize. This ensures that we do not unnecessarily grow and reallocate these large witness buffers, which adds overhead.

@winston-h-zhang
Copy link
Member Author

Benchmarks

Table of Contents

Benchmark Results

LEM Fibonacci Prove Fresh - rc = 100

new-witness-cs/fib all-ops/fib
num-100 6.37 s 6.30 s
num-200 13.06 s 12.76 s
adthrpt 224.2 247.7

LEM Fibonacci Prove Fresh - rc = 600

new-witness-cs/fib all-ops/fib
num-100 4.41 s 4.43 s
num-200 10.43 s 10.27 s
adthrpt 299.0 308.2

LEM Fibonacci Prove Load - rc = 100

new-witness-cs/fib all-ops/fib
num-100 6.24 s 6.22 s
num-200 12.71 s 12.66 s
adthrpt 247.3 248.4

LEM Fibonacci Prove Load - rc = 600

new-witness-cs/fib all-ops/fib
num-100 5.00 s 4.72 s
num-200 11.49 s 10.74 s
adthrpt 277.4 299.0

Made with criterion-table

@winston-h-zhang
Copy link
Member Author

winston-h-zhang commented Nov 28, 2023

I've pasted benchmarks comparing this PR to #118. After #139 and the changes in this PR, we're still missing some performance. So the rest of the gap can reasonably be attributed to the remaining large-vector allocations (edit: #144) that #118 removes.

Copy link
Member

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

Excellent overall, thanks a lot!

@winston-h-zhang winston-h-zhang added this pull request to the merge queue Nov 28, 2023
Merged via the queue into dev with commit 8057e85 Nov 28, 2023
3 checks passed
@winston-h-zhang winston-h-zhang deleted the new-witness-cs branch November 28, 2023 22:02
huitseeker pushed a commit to huitseeker/arecibo that referenced this pull request Jan 22, 2024
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