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

Add circuitinfo CLI tool to count circuit constraints. #1325

Merged
merged 2 commits into from
Oct 23, 2020

Conversation

porcuquine
Copy link
Collaborator

@porcuquine porcuquine commented Oct 23, 2020

@nicola asked how many constraints are in one (presumably 32 GiB) Winning PoSt.

This PR adds a CLI tool, circuitinfo which counts constraints, public inputs, and partitions (as appropriate) for any circuit and sector size. Usage can be deduced from the example below. Available circuit types are --winning, --window, and --porep. Each desired type must be specified individually.

The example output below also contains the answer to the question at hand.

In the future, and as needed, this tool could be enhanced to provide other information about 'realistic' circuits.

Usage and all the relevant output for v28 circuits.

(base) ➜  rust-fil-proofs git:(feat/count-circuit-constraints) ✗ time cargo run --release --bin circuitinfo -- --winning --window --porep
    Finished release [optimized] target(s) in 0.22s
     Running `target/release/circuitinfo --winning --window --porep`
✔ Select the sizes for which constraints should be counted [use space key to select] ·  32 GiB,  64 GiB
Getting circuit info for sector size: 32 GiB
32 GiB Winning PoSt constraints: 370590, public inputs: 133, partitions: 1
32 GiB Window PoSt constraints (per partition): 125279217, public inputs (per partition): 25840, partitions: <depends on input size>
32 GiB PoRep constraints: 130278541, public inputs: 328, partitions: 10
Getting circuit info for sector size: 64 GiB
64 GiB Winning PoSt constraints: 391314, public inputs: 133, partitions: 1
64 GiB Window PoSt constraints (per partition): 129887900, public inputs (per partition): 25301, partitions: <depends on input size>
64 GiB PoRep constraints: 131185849, public inputs: 328, partitions: 10
cargo run --release --bin circuitinfo -- --winning --window --porep  828.92s user 0.78s system 99% cpu 13:52.19 total

@porcuquine porcuquine force-pushed the feat/count-circuit-constraints branch 4 times, most recently from 2dc632e to 69cd7b5 Compare October 23, 2020 08:01
@porcuquine porcuquine force-pushed the feat/count-circuit-constraints branch from 69cd7b5 to e33c9f1 Compare October 23, 2020 08:22
@porcuquine porcuquine merged commit c9f40ad into master Oct 23, 2020
@porcuquine porcuquine deleted the feat/count-circuit-constraints branch October 23, 2020 17:04
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