Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Reduce halo2 calls to Circuit::synthesize #1495

Open
ed255 opened this issue Jun 26, 2023 · 3 comments
Open

Reduce halo2 calls to Circuit::synthesize #1495

ed255 opened this issue Jun 26, 2023 · 3 comments
Assignees

Comments

@ed255
Copy link
Member

ed255 commented Jun 26, 2023

After a debugging session I noticed that the layouter.assign_region method of a Circuit is being called 6 times.
My guess is the following:

  • One iteration per phase (we have 3 phases implemented) by a Circuit::synthesize call
  • On each phase, the layouter may do multiple phases, by calling layouter.assign_region each time.

While debugging I was observing 2 assign_region calls per each phase, but the circuit was using the SimpleFloorPlanner, which is supposed to do only 1 pass, so maybe my guess is wrong. Nevertheless the layouter.assign_region methods were called 6 times, which seems a lot.

I wonder if we could find a way to reduce this, specially considering that our circuits are single region, and that we can easily predict the number of rows they'll take before calling assign_region.

@ed255 ed255 changed the title Reduce halo2 calls to synthesize Reduce halo2 calls to Circuit::synthesize Jun 26, 2023
@hero78119 hero78119 self-assigned this Jun 27, 2023
@ed255
Copy link
Member Author

ed255 commented Jun 27, 2023

@kunxian-xia
Copy link
Contributor

kunxian-xia commented Jun 27, 2023

@ed255 You can check the work that we did at Scroll. We're currently working on splitting the original large region into hundreds of "sub"-regions and then synthesize them in parallel. scroll-tech#552

@kunxian-xia
Copy link
Contributor

For example, we are able to reduce the synthesis time of state circuit of degree 20 from 170s to about 7s.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants