snarkify / sirius

A Plonkish folding framework for Incrementally Verifiable Computation (IVC).
MIT License
106 stars 15 forks source link

feat(example): impl time-profiling #246

Closed cyphersnake closed 1 month ago

cyphersnake commented 1 month ago

Motivation We need time-profiling in the form of ark_std

Overview

cargo poseidon-example | python .scripts/build_profiling.py
# for all 
cargo poseidon-example | python .scripts/build_profiling.py --min-busy 0s
cyphersnake commented 1 month ago

Example of output:

cargo poseidon-example | python .scripts/build_profiling.py
Start:  poseidon_example
··Start:  get_or_create_commitment_key
··End:    get_or_create_commitment_key.....................................3.07s
··Start:  get_or_create_commitment_key
··End:    get_or_create_commitment_key.....................................2.40s
··Start:  pp_new
····Start:  primary
······Start:  circuit_collect_plonk_struct
······End:    circuit_collect_plonk_struct.................................1.39s
····End:    primary........................................................1.39s
····Start:  secondary
····End:    secondary......................................................1.92s
····Start:  digest
······Start:  digest_to_bits
······End:    digest_to_bits..............................................53.50s
····End:    digest........................................................53.50s
··End:    pp_new..........................................................56.80s
··Start:  ivc_new
····Start:  primary
····End:    primary........................................................1.40s
··End:    ivc_new..........................................................2.33s
··Start:  ivc_fold_step
····Start:  primary
······Start:  prove
········Start:  commit_cross_terms
········End:    commit_cross_terms.........................................2.51s
······End:    prove........................................................2.58s
······Start:  prove
········Start:  commit_cross_terms
········End:    commit_cross_terms.........................................7.38s
······End:    prove........................................................7.49s
····End:    primary.......................................................11.50s
····Start:  secondary
····End:    secondary......................................................1.33s
··End:    ivc_fold_step...................................................12.80s
··Start:  ivc_vefify
··End:    ivc_vefify.......................................................4.44s
End:    poseidon_example..................................................81.90s
drouyang commented 1 month ago

Shall we add how to do runtime profiling in README?

cargo poseidon-example | python .scripts/build_profiling.py
# for all 
cargo poseidon-example | python .scripts/build_profiling.py --min-busy 0s
drouyang commented 1 month ago

Consider rename --min-busy to --min-runtime

cyphersnake commented 1 month ago

Shall we add how to do runtime profiling in README?

I wanted to, but I thought I should add a section about usage in general first, since we have a public project and the whole README is focused not on the team, but on the audience

drouyang commented 1 month ago

I wanted to, but I thought I should add a section about usage in general first since we have a public project and the whole README is focused not on the team, but on the audience

Makes sense. At the same time, it's good for external devs to know how to profile Sirius. Let's add profiling together with general usage later.

cyphersnake commented 1 month ago

I wanted to, but I thought I should add a section about usage in general first since we have a public project and the whole README is focused not on the team, but on the audience

Makes sense. At the same time, it's good for external devs to know how to profile Sirius. Let's add profiling together with general usage later.

https://github.com/snarkify/sirius/issues/247