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

Document the noir-profiler #6410

Open
Tracked by #7164
vezenovm opened this issue Oct 30, 2024 · 3 comments
Open
Tracked by #7164

Document the noir-profiler #6410

vezenovm opened this issue Oct 30, 2024 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request profiler The Noir profiler

Comments

@vezenovm
Copy link
Contributor

Problem

A few months ago we added a profiler under tooling/profiler. The profiler has been used almost exclusively internally. This profiler allows devs generate flamegraphs of the opcodes and backend constraints laid down by a given program. Just recently the profiler was expanded to also provide information on which part of the program is generated the most steps in the Brillig VM.

Happy Case

We should document the profiler inside the Noir repo and externally to allow developers to start to utilize this very useful tool.

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

Nice-to-have

Blocker Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@vezenovm vezenovm added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 30, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Oct 30, 2024
@vezenovm vezenovm self-assigned this Oct 30, 2024
@Savio-Sou Savio-Sou added the profiler The Noir profiler label Nov 25, 2024
@Savio-Sou
Copy link
Collaborator

Savio-Sou commented Dec 6, 2024

Does the profiler also analyze execution / witness generation?

@Savio-Sou
Copy link
Collaborator

From HashCloak's noir-mpc-ml project report, if useful as a documentation starter:

You can find the profiler tool here. These are the steps we took to make it work:

  1. Git clone the Noir repo
  2. Checkout the tag of the nargo version you intend to use. Make sure the installed bb version aligns with it.
  3. Set PATH_TO_ARTIFACT to where the json of your compiled circuit is located, for example target/test.json.
  4. Set PATH_TO_OUTPUT to where the svg file will be saved, for example /output.
  5. Set PATH_TO_BB to where bb is installed.
  6. Obtain gates flamegraph:
cargo run --package noir_profiler --bin noir-profiler  gates-flamegraph --artifact-path PATH_TO_ARTIFACT --output PATH_TO_OUTPUT --backend-path PATH_TO_BB
  1. Obtain opcodes flamegraph
cargo run --package noir_profiler --bin noir-profiler  opcodes-flamegraph --artifact-path PATH_TO_ARTIFACT --output PATH_TO_OUTPUT

@vezenovm
Copy link
Contributor Author

Does the profiler also analyze execution / witness generation?

It will analyze the number of Brillig opcodes executed but only when the main is force compiled to Brillig. It does not analyze ACVM witness generation and Brillig execution within an ACIR program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request profiler The Noir profiler
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants