Skip to content

perf: gkr improvements #328

Merged
Tabaie merged 6 commits intoperf/gkrfrom
perf/gkrpool
Feb 10, 2023
Merged

perf: gkr improvements #328
Tabaie merged 6 commits intoperf/gkrfrom
perf/gkrpool

Conversation

@gbotrel
Copy link
Copy Markdown
Collaborator

@gbotrel gbotrel commented Feb 3, 2023

On my M1 laptop for bn254 gkr+mimc benchmarks (didn't test on the hpc machine, can you do it @Tabaie ? )

benchmark                 old ns/op       new ns/op       delta
BenchmarkGkrMimc19-10     14436017333     10378219291     -28.11%
BenchmarkGkrMimc17-10     3835612209      2801590584      -26.96%

benchmark                 old allocs     new allocs     delta
BenchmarkGkrMimc19-10     2822836        4238771        +50.16%
BenchmarkGkrMimc17-10     1852294        2145689        +15.84%

benchmark                 old bytes      new bytes      delta
BenchmarkGkrMimc19-10     4448614064     2635133856     -40.77%
BenchmarkGkrMimc17-10     1152920304     696349192      -39.60%

@gbotrel gbotrel added this to the v0.10.0 milestone Feb 3, 2023
@gbotrel gbotrel requested a review from Tabaie February 3, 2023 19:01
workers := utils.NewWorkerPool()
o.pool = &pool
o.workers = &workers
o.workers = workers
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this a must? In the gnark API, I was creating a pool of workers for the GKR solver first and then passing the same one to the prover instead of taking it down and setting it up again, hence the pointer.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

utils.NewWorkerPool returns a pointer 👍

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

(that being said, the pool is lightweight and it's OK to have 2 pools that are properly stopped using the "Stop" method between Solver and Prover; memory wise with stack / heap usage of the go routine of the pool that may actually work better (to be seen :))

@Tabaie Tabaie merged commit 045e689 into perf/gkr Feb 10, 2023
@gbotrel gbotrel deleted the perf/gkrpool branch August 21, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants