feat: Add CPU scaling benchmark script for remote execution#16918
Merged
johnathan79717 merged 3 commits intomerge-train/barretenbergfrom Sep 11, 2025
Merged
feat: Add CPU scaling benchmark script for remote execution#16918johnathan79717 merged 3 commits intomerge-train/barretenbergfrom
johnathan79717 merged 3 commits intomerge-train/barretenbergfrom
Conversation
Adds bench_cpu_scaling_remote.sh script that: - Runs benchmarks with different HARDWARE_CONCURRENCY values - Uses benchmark_remote.sh for proper remote execution with locking - Extracts timing data from hierarchical BB_BENCH output - Calculates speedup and parallel efficiency metrics - Generates visual ASCII charts and CSV results - Shows real-time output during benchmark execution
…timing extraction Changes: - Use --bench_out flag to generate JSON output from bb - Extract timing data from JSON file instead of parsing hierarchical output - Retrieve JSON file from remote after benchmark execution - Add fallback to hierarchical output if JSON extraction fails - Show JSON content for debugging when extraction fails This provides more reliable and accurate timing extraction as JSON format is more stable and easier to parse than the hierarchical text output.
Move the benchmark script to barretenberg/cpp/scripts/ to keep it with other benchmark and utility scripts in the project.
ludamad
approved these changes
Sep 10, 2025
ludamad
approved these changes
Sep 10, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Sep 11, 2025
BEGIN_COMMIT_OVERRIDE fix: Origin Tags edgecase (#16921) chore: cycle group cleanup #2 (#16876) chore: civc tidy 3 (#16671) refactor(bb): optimize batch_mul_with_endomorphism (#16905) feat: check op queue wires are zero past minicircuit in Translator (#16858) feat: Add CPU scaling benchmark script for remote execution (#16918) fix: Add free witness tag to field constructor (#16827) fix(bb): darwin build (#16957) END_COMMIT_OVERRIDE
Umarb97
pushed a commit
to Umarb97/aztec-packages
that referenced
this pull request
Sep 16, 2025
…tocol#16918) ## Summary Adds a new benchmarking script `bench_cpu_scaling_remote.sh` that measures CPU scaling performance of BB_BENCH entries on remote EC2 instances. ## Features - **Remote execution**: Uses `benchmark_remote.sh` infrastructure with proper locking mechanism - **CPU scaling analysis**: Runs benchmarks with different `HARDWARE_CONCURRENCY` values (1, 2, 4, 8, etc.) - **JSON output**: Uses `--bench_out` flag to generate JSON output for accurate timing extraction - **Performance metrics**: Calculates speedup and parallel efficiency for each CPU count - **Real-time output**: Shows benchmark progress during execution with `tee` for transparency ## Implementation Details - Automatically appends `--bench_out` flag to commands to generate JSON output - Retrieves JSON files from remote machine after each benchmark run - Extracts timing data from JSON format for more reliable parsing - Shows JSON content for debugging when extraction encounters issues ## Usage ```bash # Set required environment variables export BB_SSH_KEY='-i /path/to/key.pem' export BB_SSH_INSTANCE='user@ec2-instance.amazonaws.com' export BB_SSH_CPP_PATH='/path/to/barretenberg/cpp' # Run CPU scaling benchmark ./bench_cpu_scaling_remote.sh "ClientIvcProve" "./bb prove --scheme client_ivc --output_path /tmp --ivc_inputs_path ~/input.msgpack" "1,2,4,8" # Note: --bench_out flag is automatically added to the command ``` ## Example Output ``` ClientIVC::prove CPU Scaling Results: - 1 CPU: 27.96s (baseline) - 2 CPUs: 15.77s (1.77x speedup, 88.5% efficiency) - 4 CPUs: 9.23s (3.03x speedup, 75.8% efficiency) - 8 CPUs: 5.85s (4.78x speedup, 59.8% efficiency) ```
mralj
pushed a commit
that referenced
this pull request
Oct 13, 2025
## Summary Adds a new benchmarking script `bench_cpu_scaling_remote.sh` that measures CPU scaling performance of BB_BENCH entries on remote EC2 instances. ## Features - **Remote execution**: Uses `benchmark_remote.sh` infrastructure with proper locking mechanism - **CPU scaling analysis**: Runs benchmarks with different `HARDWARE_CONCURRENCY` values (1, 2, 4, 8, etc.) - **JSON output**: Uses `--bench_out` flag to generate JSON output for accurate timing extraction - **Performance metrics**: Calculates speedup and parallel efficiency for each CPU count - **Real-time output**: Shows benchmark progress during execution with `tee` for transparency ## Implementation Details - Automatically appends `--bench_out` flag to commands to generate JSON output - Retrieves JSON files from remote machine after each benchmark run - Extracts timing data from JSON format for more reliable parsing - Shows JSON content for debugging when extraction encounters issues ## Usage ```bash # Set required environment variables export BB_SSH_KEY='-i /path/to/key.pem' export BB_SSH_INSTANCE='user@ec2-instance.amazonaws.com' export BB_SSH_CPP_PATH='/path/to/barretenberg/cpp' # Run CPU scaling benchmark ./bench_cpu_scaling_remote.sh "ClientIvcProve" "./bb prove --scheme client_ivc --output_path /tmp --ivc_inputs_path ~/input.msgpack" "1,2,4,8" # Note: --bench_out flag is automatically added to the command ``` ## Example Output ``` ClientIVC::prove CPU Scaling Results: - 1 CPU: 27.96s (baseline) - 2 CPUs: 15.77s (1.77x speedup, 88.5% efficiency) - 4 CPUs: 9.23s (3.03x speedup, 75.8% efficiency) - 8 CPUs: 5.85s (4.78x speedup, 59.8% efficiency) ```
ludamad
pushed a commit
that referenced
this pull request
Dec 16, 2025
## Summary Adds a new benchmarking script `bench_cpu_scaling_remote.sh` that measures CPU scaling performance of BB_BENCH entries on remote EC2 instances. ## Features - **Remote execution**: Uses `benchmark_remote.sh` infrastructure with proper locking mechanism - **CPU scaling analysis**: Runs benchmarks with different `HARDWARE_CONCURRENCY` values (1, 2, 4, 8, etc.) - **JSON output**: Uses `--bench_out` flag to generate JSON output for accurate timing extraction - **Performance metrics**: Calculates speedup and parallel efficiency for each CPU count - **Real-time output**: Shows benchmark progress during execution with `tee` for transparency ## Implementation Details - Automatically appends `--bench_out` flag to commands to generate JSON output - Retrieves JSON files from remote machine after each benchmark run - Extracts timing data from JSON format for more reliable parsing - Shows JSON content for debugging when extraction encounters issues ## Usage ```bash # Set required environment variables export BB_SSH_KEY='-i /path/to/key.pem' export BB_SSH_INSTANCE='user@ec2-instance.amazonaws.com' export BB_SSH_CPP_PATH='/path/to/barretenberg/cpp' # Run CPU scaling benchmark ./bench_cpu_scaling_remote.sh "ClientIvcProve" "./bb prove --scheme client_ivc --output_path /tmp --ivc_inputs_path ~/input.msgpack" "1,2,4,8" # Note: --bench_out flag is automatically added to the command ``` ## Example Output ``` ClientIVC::prove CPU Scaling Results: - 1 CPU: 27.96s (baseline) - 2 CPUs: 15.77s (1.77x speedup, 88.5% efficiency) - 4 CPUs: 9.23s (3.03x speedup, 75.8% efficiency) - 8 CPUs: 5.85s (4.78x speedup, 59.8% efficiency) ```
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new benchmarking script
bench_cpu_scaling_remote.shthat measures CPU scaling performance of BB_BENCH entries on remote EC2 instances.Features
benchmark_remote.shinfrastructure with proper locking mechanismHARDWARE_CONCURRENCYvalues (1, 2, 4, 8, etc.)--bench_outflag to generate JSON output for accurate timing extractionteefor transparencyImplementation Details
--bench_outflag to commands to generate JSON outputUsage
Example Output