diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index f693aafb2..d2056d5b9 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -27,13 +27,14 @@ on: default: '60Gi' required: false type: string - block_start: - description: 'The block number to start the range of blocks to prove' + block_range: + description: 'A comma separated values for the block range start and end to prove, in the following format "block_start,block_end". (Set to the same values to only prove 1 block)' required: true + default: '100,101' type: string - block_end: - description: 'The block number to end the range of blocks to prove. (Set to the same value as block_start to only prove 1 block)' - required: true + prover_configs: + description: 'A comma separated values for additional configs for the proving, in the following format "batch_size,cpu_cycles".' + default: '10,19' type: string other_args: description: 'Other text to append into the generated CSV file' @@ -83,5 +84,11 @@ jobs: GCP_WORKLOAD_IDENTITY_ID: ${{ secrets.GCP_WORKLOAD_IDENTITY_ID }} GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }} ENVIRONMENT: production - run: > - ./tools/run-benchmark.sh ${{ inputs.machine_type }} ${{ inputs.num_workers }} ${{ inputs.cpu_request }} ${{ inputs.cpu_limit }} ${{ inputs.memory }} ${{ inputs.memory }} ${{ inputs.block_start }} ${{ inputs.block_end }} ${{ inputs.other_args }} ${{ inputs.rpc_endpoint }} \ No newline at end of file + run: |- + IFS=',' read -r block_start block_end <<< ${{ inputs.block_range }} + IFS=',' read -r batch_size cpu_cycles <<< ${{ inputs.prover_configs }} + echo "block_start: $block_start" + echo "block_end: $block_end" + echo "batch_size: $batch_size" + echo "cpu_cycles: $cpu_cycles" + ./tools/run-benchmark.sh ${{ inputs.machine_type }} ${{ inputs.num_workers }} ${{ inputs.cpu_request }} ${{ inputs.cpu_limit }} ${{ inputs.memory }} ${{ inputs.memory }} $block_start $block_end ${{ inputs.other_args }} ${{ inputs.rpc_endpoint }} $batch_size $cpu_cycles \ No newline at end of file diff --git a/tools/run-benchmark.sh b/tools/run-benchmark.sh index 903b61837..6fee5f794 100755 --- a/tools/run-benchmark.sh +++ b/tools/run-benchmark.sh @@ -3,8 +3,8 @@ set -e set -o pipefail # Check if the correct number of arguments are provided -if [ "$#" -ne 10 ]; then - echo "Usage: $0 " +if [ "$#" -ne 12 ]; then + echo "Usage: $0 " exit 1 fi @@ -42,6 +42,8 @@ block_start=$7 block_end=$8 other_args=$9 # will be appended to the csv file name RPC_ENDPOINT=${10} +batch_size=${11} +cpu_cycles=${12} ###################### # Do some validation # @@ -201,8 +203,8 @@ done # Build out the request parameters folder_name=$(printf "%s/%s" "$ENVIRONMENT" "$SUBFOLDER_NAME") -csv_file_name=$(printf "%s.%s.%s.%s.%s.%scpu.%sworkers.csv" "$other_args" "$block_start" "$block_end" "$machine_type" "$CPU_PLATFORM" "$cpu_request" "$num_workers") -post_body=$(printf '{"run_name":"%s","block_source":{"Rpc":{"rpc_url":"%s","block_interval":"%s..=%s"}},"benchmark_output":{"GoogleCloudStorageCsv":{"file_name":"%s/%s","bucket":"zkevm-csv"}},"prover_config":{"batch_size":10,"max_cpu_len_log":19,"save_inputs_on_error":false}}' "$csv_file_name" "$RPC_ADDRESS" "$block_start" "$block_end" "$folder_name" "$csv_file_name") +csv_file_name=$(printf "%s.%s.%s.%s.%s.%scpu.%sworkers.%sbatch_size.%scpu_cycles.csv" "$other_args" "$block_start" "$block_end" "$machine_type" "$CPU_PLATFORM" "$cpu_request" "$num_workers" "$batch_size" "$cpu_cycles") +post_body=$(printf '{"run_name":"%s","block_source":{"Rpc":{"rpc_url":"%s","block_interval":"%s..=%s"}},"benchmark_output":{"GoogleCloudStorageCsv":{"file_name":"%s/%s","bucket":"zkevm-csv"}},"prover_config":{"batch_size":%s,"max_cpu_len_log":%s,"save_inputs_on_error":false}}' "$csv_file_name" "$RPC_ADDRESS" "$block_start" "$block_end" "$folder_name" "$csv_file_name" "$batch_size" "$cpu_cycles") # Run the benchmark test echo "Triggering benchmark test..."