From 8097ad8de88676405737d4d6730a06339425e0c9 Mon Sep 17 00:00:00 2001 From: Savio <72797635+Savio-Sou@users.noreply.github.com> Date: Wed, 5 Jun 2024 22:54:28 +0800 Subject: [PATCH 1/3] chore(readme): Add local benchmarking steps --- noir/README.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/noir/README.md b/noir/README.md index c604644e712c..3e3cfbc4ac31 100644 --- a/noir/README.md +++ b/noir/README.md @@ -3,18 +3,40 @@ We subrepo noir into the folder `noir-repo`. This folder contains dockerfiles and scripts for performing our custom build of noir for the monorepo. -# Syncing with the main Noir repository +## Syncing with the main Noir repository In order to keep aztec-packages in step with the main Noir repository we need to periodically sync between them. Syncing from aztec-packages into noir currently attempts to revert any changes in Noir since the last sync so it's recommended to always sync from Noir first to ensure that aztec-packages is up-to-date. -## Syncing from Noir to aztec-packages. +### Syncing from Noir to aztec-packages. To start the sync run [this action](https://github.com/AztecProtocol/aztec-packages/actions/workflows/pull-noir.yml) manually (click the "Run Workflow" button in the top right). aztec-bot will then open a new PR which does the initial sync, this will have merge conflicts with master which will need to be resolved. -## Syncing from aztec-packages to Noir. +### Syncing from aztec-packages to Noir. When syncing from aztec-packages to Noir it's important to check that the latest release of `bb` uses the same ACIR serialization format as the current master commit. This is because Noir uses a released version of barretenberg rather than being developed in sync with it, it's then not possible to sync if there's been serialization changes since the last release. To start the sync run [this action](https://github.com/AztecProtocol/aztec-packages/actions/workflows/mirror-noir-subrepo.yml) manually (click the "Run Workflow" button in the top right). aztec-bot will then open a new PR in the `noir-lang/noir` repository which does the initial sync, this will have merge conflicts with master which will need to be resolved. + +## Benchmarking + +This repository supports benchmarking of Barretenberg's proving speeds on Noir programs. + +### Benchmarking locally + +To gather proving speeds benchmark on your local machine: + +1. [Install Docker](https://docs.docker.com/get-docker/) +2. [Install Earthly](https://earthly.dev/get-earthly) +3. `git clone https://github.com/AztecProtocol/aztec-packages.git` +4. (If you are on macOS:) + 1. `brew install coreutils` + 2. Edit the `cp --parents…` line in [*aztec-packages/noir/Earthfile*](https://github.com/AztecProtocol/aztec-packages/blob/deb972d3f13a92d34a6f91074b072fb66d247f64/noir/Earthfile) to `gcp --parents…` +5. `earthly ./noir+bench-acir-bb` + +**Note:** It is recommended to increase or maximize your Docker instance's memory limit, as some of the pre-benchmark compilations are very memory intensive (e.g. an 8GB memory limit is insufficient and is expected to cause OOM errors). + +### Adding benchmarks + +TODO From 3235a627585fef5e3d2cf1c1e2518345ec37f2f1 Mon Sep 17 00:00:00 2001 From: Savio <72797635+Savio-Sou@users.noreply.github.com> Date: Thu, 6 Jun 2024 05:20:19 +0800 Subject: [PATCH 2/3] Add steps for adding / modifying benchmarks --- noir/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/noir/README.md b/noir/README.md index 3e3cfbc4ac31..e3167613a667 100644 --- a/noir/README.md +++ b/noir/README.md @@ -37,6 +37,10 @@ To gather proving speeds benchmark on your local machine: **Note:** It is recommended to increase or maximize your Docker instance's memory limit, as some of the pre-benchmark compilations are very memory intensive (e.g. an 8GB memory limit is insufficient and is expected to cause OOM errors). -### Adding benchmarks +### Adding / updating benchmarks -TODO +Benchmarking programs are located in [*noir/noir-repo/test_programs/benchmarks*](https://github.com/AztecProtocol/aztec-packages/tree/131af8806a453b851403b0eb7cba855bc2c0cc43/noir/noir-repo/test_programs/benchmarks). Follow the naming scheme of folders and packages (in Nargo.toml) beginning with *bench_...* and add or update programs in the directory directly. + +To benchmark locally after modifications: +1. `git commit ...` +2. `earthly ./noir+bench-acir-bb` From ec45ea7a3bb92901407b0b96da506d739c803fc4 Mon Sep 17 00:00:00 2001 From: Savio <72797635+Savio-Sou@users.noreply.github.com> Date: Thu, 6 Jun 2024 22:12:01 +0800 Subject: [PATCH 3/3] Point links to master --- noir/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/noir/README.md b/noir/README.md index e3167613a667..beaaafeac586 100644 --- a/noir/README.md +++ b/noir/README.md @@ -32,14 +32,14 @@ To gather proving speeds benchmark on your local machine: 3. `git clone https://github.com/AztecProtocol/aztec-packages.git` 4. (If you are on macOS:) 1. `brew install coreutils` - 2. Edit the `cp --parents…` line in [*aztec-packages/noir/Earthfile*](https://github.com/AztecProtocol/aztec-packages/blob/deb972d3f13a92d34a6f91074b072fb66d247f64/noir/Earthfile) to `gcp --parents…` + 2. Edit the `cp --parents…` line in [*aztec-packages/noir/Earthfile*](https://github.com/AztecProtocol/aztec-packages/blob/master/noir/Earthfile) to `gcp --parents…` 5. `earthly ./noir+bench-acir-bb` **Note:** It is recommended to increase or maximize your Docker instance's memory limit, as some of the pre-benchmark compilations are very memory intensive (e.g. an 8GB memory limit is insufficient and is expected to cause OOM errors). ### Adding / updating benchmarks -Benchmarking programs are located in [*noir/noir-repo/test_programs/benchmarks*](https://github.com/AztecProtocol/aztec-packages/tree/131af8806a453b851403b0eb7cba855bc2c0cc43/noir/noir-repo/test_programs/benchmarks). Follow the naming scheme of folders and packages (in Nargo.toml) beginning with *bench_...* and add or update programs in the directory directly. +Benchmarking programs are located in [*noir/noir-repo/test_programs/benchmarks*](https://github.com/AztecProtocol/aztec-packages/tree/master/noir/noir-repo/test_programs/benchmarks). Follow the naming scheme of folders and packages (in Nargo.toml) beginning with *bench_...* and add or update programs in the directory directly. To benchmark locally after modifications: 1. `git commit ...`