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

dev::cost: Estimate prover work for a given circuit #753

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

therealyingtong
Copy link
Collaborator

@therealyingtong therealyingtong commented Mar 20, 2023

Closes #749. Computes prover cost in terms of the number of:

  • FFTs over the 2^k domain,
  • extended FFTs over 2^extended_k domain, and
  • MSMs of length 2^k.

What other prover operations are significant? (e.g. polynomial evaluations)

@therealyingtong therealyingtong changed the title dev::cost: Estimate prover work for a given circuit dev::cost: Estimate prover work for a given circuit Mar 21, 2023
Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

PR needs a rebase.

halo2_proofs/src/dev/cost.rs Outdated Show resolved Hide resolved
Comment on lines +604 to +611
// Number of FFTs in the 2^k domain
ffts: usize,
// Number of FFTs in the 2^extended_k domain
extended_ffts: usize,
// Number of multi-scalar multiplications of length 2^k
msms: usize,
Copy link
Contributor

Choose a reason for hiding this comment

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

We should also account for the cost of the transcript operations, which can be sizeable.

I don't know if the above is sufficiently granular to get a useable estimate of prover costs. OTOH, it may be sufficiently high-level that people can reliably just plug in their own estimates for the cost of each of these things, and get a reasonable result.

Your PR also reminded me that I started implementing verifier time cost estimation almost a year ago, but haven't had time to finish it. I was trying to base my estimates on the number of additions and multiplications, but deriving equations for them was rather laborious. I've opened #754 with my draft changes for comparison.

We should test both approaches against several different circuits to check how far off their estimates are.

@str4d str4d added the A-dev-tooling Area: Developer tooling label Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dev-tooling Area: Developer tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cost.rs for proving time?
2 participants