Skip to content

bench: Add MVP design and implementation outline#197

Merged
mooori merged 3 commits into
near:mooori/bench_mvpfrom
mooori:bm-mvp
Jan 29, 2024
Merged

bench: Add MVP design and implementation outline#197
mooori merged 3 commits into
near:mooori/bench_mvpfrom
mooori:bm-mvp

Conversation

@mooori
Copy link
Copy Markdown

@mooori mooori commented Jan 26, 2024

Adds a document describing the benchmarking MVP design and giving an overview of how to implement it.

This is rather a temporary document which is not intended to be merged into master and hence the writing and structure are more on the level of a draft.

Reviews are requested to find out if:

  • Is this the right thing to build as MVP?
  • Does the plan for the implementation make sense?

Any other feedback is welcome as well.

This PR is opened against the mooori/bench-mvp branch. My plan would be to have that as temporary branch where the MVP is built.

Related to #182. After building and using the MVP we should be in a better position to finalize the design of the benchmarking infrastructure.

Comment thread cranelift/zkasm_data/benchmarks/MVP.md

Before program termination, the data structure is logged.

#### Variant 2: `zkevm-proverjs` helpers cannot maintain state
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Histograms allow to get a quick overview of which instructions and labels are executed how often. The histograms will be generated as SVG files using the [`svg` crate](https://crates.io/crates/svg). Having visualizations as SVGs provides a number of advantages:

- No dependencies required as SVG files can be viewed in a web browser.
- They can be embedded in Github comments, markdown files and other documents.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Another requirement here would be to make it easy to experiment with different visualizations. Looking through the API of SVG crate, it is quite low-level. So we would need to build tools on top to do even simple visualizations like histograms.

A simpler alternative might be to take a dedicated visualization library e.g. Seaborn/Matplotlib in Python and use the high-level API to build the visualizations we want. For example, snippet for histogram is very short: https://seaborn.pydata.org/examples/faceted_histogram.html
To make this graph easy to view on GitHub, you can save it as "png" right from Seaborn: https://www.statology.org/save-seaborn-plot/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Also, in case you are not very familiar with Seaborn/Matplotlib, llms are very effective in writing code using this libraries (=

Copy link
Copy Markdown

@aborg-dev aborg-dev left a comment

Choose a reason for hiding this comment

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

Looks good to me! Left 2 suggestions

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.

3 participants