From 9374467be0f80d07de2669a80804750543da617a Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Fri, 13 Dec 2024 19:25:46 +0000 Subject: [PATCH 01/10] make adidtional external_repo_compilation_report_workspace_packages job to try and see whether this changes compilation time --- .github/workflows/reports.yml | 73 +++++++++++++++++++++++++++++ test_programs/compilation_report.sh | 11 ++++- 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 314a424327b..bc931c8981e 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -335,6 +335,79 @@ jobs: retention-days: 3 overwrite: true + external_repo_compilation_report_workspace_packages: + needs: [build-nargo] + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + include: + # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-contracts } + # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/parity-root } + # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner } + # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-tail } + # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-reset } + # TODO: Bring these back once they no longer time out + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits, package: rollup_base_public } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits, package: rollup_base_private } + + name: External repo compilation report - ${{ matrix.project.repo }}/${{ matrix.project.path }} + steps: + - name: Download nargo binary + uses: actions/download-artifact@v4 + with: + name: nargo + path: ./nargo + + - name: Set nargo on PATH + run: | + nargo_binary="${{ github.workspace }}/nargo/nargo" + chmod +x $nargo_binary + echo "$(dirname $nargo_binary)" >> $GITHUB_PATH + export PATH="$PATH:$(dirname $nargo_binary)" + nargo -V + + - uses: actions/checkout@v4 + with: + path: scripts + sparse-checkout: | + test_programs/compilation_report.sh + sparse-checkout-cone-mode: false + + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ matrix.project.repo }} + path: test-repo + ref: ${{ matrix.project.ref }} + + - name: Generate compilation report + working-directory: ./test-repo/${{ matrix.project.path }} + run: | + mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh + chmod +x ./compilation_report.sh + ./compilation_report.sh 1 ${{ matrix.project.package }} + + - name: Move compilation report + id: report + shell: bash + run: | + PACKAGE_NAME=${{ matrix.project.path }} + PACKAGE_NAME="$(basename $PACKAGE_NAME)${{ matrix.project.package }}" + echo $PACKAGE_NAME + mv ./test-repo/${{ matrix.project.path }}/compilation_report.json ./compilation_report_$PACKAGE_NAME.json + echo "compilation_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT + + - name: Upload compilation report + uses: actions/upload-artifact@v4 + with: + name: compilation_report_${{ steps.report.outputs.compilation_report_name }} + path: compilation_report_${{ steps.report.outputs.compilation_report_name }}.json + retention-days: 3 + overwrite: true + + upload_compilation_report: name: Upload compilation report needs: [generate_compilation_report, external_repo_compilation_report] diff --git a/test_programs/compilation_report.sh b/test_programs/compilation_report.sh index 13e74f0d7d2..cc2ed26fc05 100755 --- a/test_programs/compilation_report.sh +++ b/test_programs/compilation_report.sh @@ -29,12 +29,19 @@ for dir in ${tests_to_profile[@]}; do cd $base_path/$dir + # The default package to run is the supplied list hardcoded at the top of the script PACKAGE_NAME=$dir - if [ "$#" -ne 0 ]; then + # If a specific package name has been provided use that name + if [ "$#" -eq 2 ]; then + PACKAGE_NAME=$2 + # Otherwise default to the current directory as the package we want to run + elif [ "$#" -ne 0 ]; then PACKAGE_NAME=$(basename $current_dir) fi - COMPILE_TIME=$((time nargo compile --force --silence-warnings) 2>&1 | grep real | grep -oE '[0-9]+m[0-9]+.[0-9]+s') + echo $PACKAGE_NAME + + COMPILE_TIME=$((time nargo compile --force --silence-warnings --package $PACKAGE_NAME) 2>&1 | grep real | grep -oE '[0-9]+m[0-9]+.[0-9]+s') echo -e " {\n \"artifact_name\":\"$PACKAGE_NAME\",\n \"time\":\"$COMPILE_TIME\"" >> $current_dir/compilation_report.json if (($ITER == $NUM_ARTIFACTS)); then From 13d4cd28ee58356580525c738368f1e5907dcc53 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Fri, 13 Dec 2024 19:36:54 +0000 Subject: [PATCH 02/10] generate protocol circuits variants --- .github/workflows/reports.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index bc931c8981e..71850e1f551 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -382,9 +382,17 @@ jobs: path: test-repo ref: ${{ matrix.project.ref }} + - uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20.x' + - name: Generate compilation report working-directory: ./test-repo/${{ matrix.project.path }} run: | + chmod +x ./scripts/generate_variants.js + node ./scripts/generate_variants.js mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh chmod +x ./compilation_report.sh ./compilation_report.sh 1 ${{ matrix.project.package }} From 88a3a4f22fba75da5a5f765701725c8621f67f22 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Fri, 13 Dec 2024 19:41:25 +0000 Subject: [PATCH 03/10] check repo contents --- .github/workflows/reports.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 71850e1f551..709ab023251 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -391,6 +391,8 @@ jobs: - name: Generate compilation report working-directory: ./test-repo/${{ matrix.project.path }} run: | + ls . + ls ./scripts chmod +x ./scripts/generate_variants.js node ./scripts/generate_variants.js mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh From 2d4e3a08aab44a651ca9a3a02ef4b55f2f0cd53f Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Fri, 13 Dec 2024 19:45:25 +0000 Subject: [PATCH 04/10] switch node setup action --- .github/workflows/reports.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 709ab023251..eadec8edf5b 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -375,6 +375,12 @@ jobs: test_programs/compilation_report.sh sparse-checkout-cone-mode: false + - uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20.x' + - name: Checkout uses: actions/checkout@v4 with: @@ -382,12 +388,6 @@ jobs: path: test-repo ref: ${{ matrix.project.ref }} - - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '20.x' - - name: Generate compilation report working-directory: ./test-repo/${{ matrix.project.path }} run: | From 76769b92e518bd664d76747c1302820c2fe45f24 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Fri, 13 Dec 2024 19:50:35 +0000 Subject: [PATCH 05/10] yarn before calling script --- .github/workflows/reports.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index eadec8edf5b..0d4aad1e073 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -393,6 +393,7 @@ jobs: run: | ls . ls ./scripts + yarn chmod +x ./scripts/generate_variants.js node ./scripts/generate_variants.js mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh From 5bd63b98c502010b0d3aea5ba99d3fb7f8596153 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Fri, 13 Dec 2024 19:57:00 +0000 Subject: [PATCH 06/10] maybe just a yarn install wfrom lock file --- .github/workflows/reports.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 0d4aad1e073..eab737d17c2 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -393,7 +393,7 @@ jobs: run: | ls . ls ./scripts - yarn + yarn install chmod +x ./scripts/generate_variants.js node ./scripts/generate_variants.js mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh From a08047373b1e5721b56e7c5466ae8fcebd31d835 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Fri, 13 Dec 2024 20:03:57 +0000 Subject: [PATCH 07/10] use script for installing yarn dep --- .github/workflows/reports.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index eab737d17c2..704aebb96cd 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -388,12 +388,13 @@ jobs: path: test-repo ref: ${{ matrix.project.ref }} + - name: Install Yarn dependencies + working-directory: ./test-repo/${{ matrix.project.path }} + uses: ./.github/actions/setup + - name: Generate compilation report working-directory: ./test-repo/${{ matrix.project.path }} run: | - ls . - ls ./scripts - yarn install chmod +x ./scripts/generate_variants.js node ./scripts/generate_variants.js mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh From d1807edc13682ce700434ba97528b85085bde910 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Fri, 13 Dec 2024 20:13:28 +0000 Subject: [PATCH 08/10] add benchmark codegen flag to compilation report --- .github/workflows/reports.yml | 95 ++--------------------------- test_programs/compilation_report.sh | 2 +- 2 files changed, 6 insertions(+), 91 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 704aebb96cd..116015c07d7 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -272,14 +272,14 @@ jobs: fail-fast: false matrix: include: - - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-contracts } - - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/parity-root } - - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner } + # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-contracts } + # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/parity-root } + # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner } - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-tail } - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-reset } # TODO: Bring these back once they no longer time out - # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-private } - # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-public } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-private } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-public } name: External repo compilation report - ${{ matrix.project.repo }}/${{ matrix.project.path }} steps: @@ -335,91 +335,6 @@ jobs: retention-days: 3 overwrite: true - external_repo_compilation_report_workspace_packages: - needs: [build-nargo] - runs-on: ubuntu-latest - timeout-minutes: 15 - strategy: - fail-fast: false - matrix: - include: - # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-contracts } - # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/parity-root } - # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner } - # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-tail } - # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-reset } - # TODO: Bring these back once they no longer time out - - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits, package: rollup_base_public } - - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits, package: rollup_base_private } - - name: External repo compilation report - ${{ matrix.project.repo }}/${{ matrix.project.path }} - steps: - - name: Download nargo binary - uses: actions/download-artifact@v4 - with: - name: nargo - path: ./nargo - - - name: Set nargo on PATH - run: | - nargo_binary="${{ github.workspace }}/nargo/nargo" - chmod +x $nargo_binary - echo "$(dirname $nargo_binary)" >> $GITHUB_PATH - export PATH="$PATH:$(dirname $nargo_binary)" - nargo -V - - - uses: actions/checkout@v4 - with: - path: scripts - sparse-checkout: | - test_programs/compilation_report.sh - sparse-checkout-cone-mode: false - - - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '20.x' - - - name: Checkout - uses: actions/checkout@v4 - with: - repository: ${{ matrix.project.repo }} - path: test-repo - ref: ${{ matrix.project.ref }} - - - name: Install Yarn dependencies - working-directory: ./test-repo/${{ matrix.project.path }} - uses: ./.github/actions/setup - - - name: Generate compilation report - working-directory: ./test-repo/${{ matrix.project.path }} - run: | - chmod +x ./scripts/generate_variants.js - node ./scripts/generate_variants.js - mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh - chmod +x ./compilation_report.sh - ./compilation_report.sh 1 ${{ matrix.project.package }} - - - name: Move compilation report - id: report - shell: bash - run: | - PACKAGE_NAME=${{ matrix.project.path }} - PACKAGE_NAME="$(basename $PACKAGE_NAME)${{ matrix.project.package }}" - echo $PACKAGE_NAME - mv ./test-repo/${{ matrix.project.path }}/compilation_report.json ./compilation_report_$PACKAGE_NAME.json - echo "compilation_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT - - - name: Upload compilation report - uses: actions/upload-artifact@v4 - with: - name: compilation_report_${{ steps.report.outputs.compilation_report_name }} - path: compilation_report_${{ steps.report.outputs.compilation_report_name }}.json - retention-days: 3 - overwrite: true - - upload_compilation_report: name: Upload compilation report needs: [generate_compilation_report, external_repo_compilation_report] diff --git a/test_programs/compilation_report.sh b/test_programs/compilation_report.sh index cc2ed26fc05..a26488edf25 100755 --- a/test_programs/compilation_report.sh +++ b/test_programs/compilation_report.sh @@ -41,7 +41,7 @@ for dir in ${tests_to_profile[@]}; do echo $PACKAGE_NAME - COMPILE_TIME=$((time nargo compile --force --silence-warnings --package $PACKAGE_NAME) 2>&1 | grep real | grep -oE '[0-9]+m[0-9]+.[0-9]+s') + COMPILE_TIME=$((time nargo compile --force --silence-warnings --package $PACKAGE_NAME --benchmark-codegen) 2>&1 | grep real | grep -oE '[0-9]+m[0-9]+.[0-9]+s') echo -e " {\n \"artifact_name\":\"$PACKAGE_NAME\",\n \"time\":\"$COMPILE_TIME\"" >> $current_dir/compilation_report.json if (($ITER == $NUM_ARTIFACTS)); then From 19942834bd814128d6ffab526093674ab7d37d9f Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Fri, 13 Dec 2024 20:19:48 +0000 Subject: [PATCH 09/10] revert compilation_report changes and do not funnel benchmark codegen output into grep --- test_programs/compilation_report.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test_programs/compilation_report.sh b/test_programs/compilation_report.sh index a26488edf25..b5be74cac15 100755 --- a/test_programs/compilation_report.sh +++ b/test_programs/compilation_report.sh @@ -31,17 +31,17 @@ for dir in ${tests_to_profile[@]}; do # The default package to run is the supplied list hardcoded at the top of the script PACKAGE_NAME=$dir - # If a specific package name has been provided use that name - if [ "$#" -eq 2 ]; then - PACKAGE_NAME=$2 # Otherwise default to the current directory as the package we want to run - elif [ "$#" -ne 0 ]; then + if [ "$#" -ne 0 ]; then PACKAGE_NAME=$(basename $current_dir) fi echo $PACKAGE_NAME - COMPILE_TIME=$((time nargo compile --force --silence-warnings --package $PACKAGE_NAME --benchmark-codegen) 2>&1 | grep real | grep -oE '[0-9]+m[0-9]+.[0-9]+s') + # Compile again just for benchmarking purposes + time nargo compile --force --silence-warnings --benchmark-codegen + + COMPILE_TIME=$((time nargo compile --force --silence-warnings) 2>&1 | grep real | grep -oE '[0-9]+m[0-9]+.[0-9]+s') echo -e " {\n \"artifact_name\":\"$PACKAGE_NAME\",\n \"time\":\"$COMPILE_TIME\"" >> $current_dir/compilation_report.json if (($ITER == $NUM_ARTIFACTS)); then From f418a00fcf0aab0d8f95e7e04216690b7cbffab0 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Fri, 13 Dec 2024 20:41:19 +0000 Subject: [PATCH 10/10] bring back other commented ones --- .github/workflows/reports.yml | 7 +++---- test_programs/compilation_report.sh | 5 ----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 116015c07d7..0a03add8338 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -272,12 +272,11 @@ jobs: fail-fast: false matrix: include: - # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-contracts } - # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/parity-root } - # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-contracts } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/parity-root } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner } - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-tail } - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-reset } - # TODO: Bring these back once they no longer time out - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-private } - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-public } diff --git a/test_programs/compilation_report.sh b/test_programs/compilation_report.sh index b5be74cac15..d050e7c9c34 100755 --- a/test_programs/compilation_report.sh +++ b/test_programs/compilation_report.sh @@ -36,11 +36,6 @@ for dir in ${tests_to_profile[@]}; do PACKAGE_NAME=$(basename $current_dir) fi - echo $PACKAGE_NAME - - # Compile again just for benchmarking purposes - time nargo compile --force --silence-warnings --benchmark-codegen - COMPILE_TIME=$((time nargo compile --force --silence-warnings) 2>&1 | grep real | grep -oE '[0-9]+m[0-9]+.[0-9]+s') echo -e " {\n \"artifact_name\":\"$PACKAGE_NAME\",\n \"time\":\"$COMPILE_TIME\"" >> $current_dir/compilation_report.json