|
| 1 | +name: Run benchmarks |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: ['main'] |
| 5 | + paths-ignore: |
| 6 | + - 'README.md' |
| 7 | + |
| 8 | +env: |
| 9 | + CARGO_TERM_COLOR: always |
| 10 | + |
| 11 | +jobs: |
| 12 | + benchmark-tests: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + defaults: |
| 15 | + run: |
| 16 | + working-directory: bench |
| 17 | + steps: |
| 18 | + - name: Update |
| 19 | + run: sudo apt-get update |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + - uses: software-mansion/setup-scarb@v1 |
| 22 | + with: |
| 23 | + scarb-version: '2.4.2' |
| 24 | + - uses: actions/setup-python@v4 |
| 25 | + with: |
| 26 | + python-version: '3.9' |
| 27 | + - uses: actions-rs/toolchain@v1 |
| 28 | + with: |
| 29 | + toolchain: nightly-2024-01-16 |
| 30 | + override: true |
| 31 | + components: rustfmt, clippy |
| 32 | + - uses: baptiste0928/cargo-install@v1 |
| 33 | + with: |
| 34 | + crate: cargo-nextest |
| 35 | + locked: true |
| 36 | + - name: Cargo clean |
| 37 | + run: cargo clean |
| 38 | + - name: Delete Cargo.lock |
| 39 | + run: rm -f Cargo.lock |
| 40 | + - name: Install Risc0 toolchain |
| 41 | + run: | |
| 42 | + cargo install cargo-binstall |
| 43 | + yes | cargo binstall cargo-risczero |
| 44 | + cargo risczero install |
| 45 | + - name: Install Rust jupyter kernel |
| 46 | + run: | |
| 47 | + cargo install evcxr_jupyter |
| 48 | + evcxr_jupyter --install |
| 49 | + - name: Install GNU Time |
| 50 | + run: sudo apt-get update && sudo apt-get install -y time |
| 51 | + - name: Install jq |
| 52 | + run: sudo apt-get update && sudo apt-get install -y jq |
| 53 | + - name: Download and Install EZKL Binary |
| 54 | + run: | |
| 55 | + curl -L -o ezkl.tar.gz https://github.com/zkonduit/ezkl/releases/download/v7.1.4/build-artifacts.ezkl-linux-gnu.tar.gz |
| 56 | + tar -xzf ezkl.tar.gz |
| 57 | + sudo mv ezkl /usr/local/bin/ # Move the binary to a directory in your PATH |
| 58 | + - name: Setup Virtual Env |
| 59 | + run: python -m venv .env; source .env/bin/activate; |
| 60 | + - name: Run linear regression benchmarks across all frameworks |
| 61 | + run: source .env/bin/activate; cargo nextest run benchmarking_tests::tests::run_benchmarks_::tests_0 --test-threads 1 |
| 62 | + - name: Run randsom forest benchmarks across all frameworks |
| 63 | + run: source .env/bin/activate; cargo nextest run benchmarking_tests::tests::run_benchmarks_::tests_1 --test-threads 1 |
| 64 | + - name: Run svm classification benchmarks across all frameworks |
| 65 | + run: source .env/bin/activate; cargo nextest run benchmarking_tests::tests::run_benchmarks_::tests_2 --test-threads 1 |
| 66 | + - name: Run tree ensemble regression benchmarks across all frameworks |
| 67 | + run: source .env/bin/activate; cargo nextest run benchmarking_tests::tests::run_benchmarks_::tests_3 --test-threads 1 |
| 68 | + - name: Pretty Print benchmarks.json |
| 69 | + run: jq '.' benchmarks.json # Pretty print the benchmarks.json file |
0 commit comments