Bench #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Bench | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| config_path: | |
| description: "Path to Configuration File" | |
| required: true | |
| default: "secpar_20_height_1_p_6.params.toml" | |
| data_id: | |
| description: "Data ID (e.g. 53)" | |
| required: true | |
| default: "0" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| bench: | |
| timeout-minutes: 5760 #4days | |
| runs-on: machina-benchmark | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: clippy | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install build deps | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake libgmp-dev libasound2-dev | |
| - name: Check for OpenFHE | |
| id: openfhe-check | |
| run: | | |
| if ldconfig -p | grep -q 'libOpenFHE'; then | |
| echo "installed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "installed=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Checkout OpenFHE | |
| if: steps.openfhe-check.outputs.installed == 'false' | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: MachinaIO/openfhe-development | |
| ref: main | |
| path: openfhe | |
| - name: Build & install OpenFHE | |
| if: steps.openfhe-check.outputs.installed == 'false' | |
| run: | | |
| cd openfhe | |
| mkdir -p build && cd build | |
| cmake .. | |
| make -j"$(nproc)" | |
| sudo make install | |
| echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/openfhe.conf | |
| sudo ldconfig | |
| - name: Verify OpenFHE install | |
| run: ls -lah /usr/local/lib | grep OpenFHE | |
| - name: Install abe | |
| run: cargo install --path abe | |
| - name: Verify abe | |
| run: which abe | |
| - name: Run benchmarks (stream + log) | |
| env: | |
| LD_LIBRARY_PATH: /usr/local/lib | |
| RUST_LOG: info | |
| RUST_BACKTRACE: 1 | |
| run: | | |
| mkdir -p logs | |
| LOGFILE=logs/data_${{ github.event.inputs.data_id }}.log | |
| { | |
| abe bench-run-offline \ | |
| --config abe/run_configs/${{ github.event.inputs.config_path }} \ | |
| --data-dir data_${{ github.event.inputs.data_id }} && | |
| abe bench-run-online \ | |
| --config abe/run_configs/${{ github.event.inputs.config_path }} \ | |
| --data-dir data_${{ github.event.inputs.data_id }} | |
| } 2>&1 | tee -a "$LOGFILE" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - name: Upload benchmark logs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bench-logs | |
| path: logs/*.log | |
| - name: Run memory profiling | |
| run: | | |
| LOG=logs/data_${{ github.event.inputs.data_id }}.log | |
| uv run scripts/memory_profile.py --log-file "$LOG" | |
| - name: Upload memory analysis | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: memory-analysis | |
| path: logs/combined_memory_analysis_*.txt | |
| - name: Clean up logs | |
| if: always() | |
| run: rm -rf logs | |
| - name: Clean up data | |
| if: always() | |
| run: rm -rf data_${{ github.event.inputs.data_id }} | |