Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge and redo block number input, add support for new inputs #21

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 }}
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
10 changes: 6 additions & 4 deletions tools/run-benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <machine_type> <num_workers> <cpu_request> <cpu_limit> <memory_request> <memory_limit> <block_start> <block_end> <other_args> <rpc_endpoint>"
if [ "$#" -ne 12 ]; then
echo "Usage: $0 <machine_type> <num_workers> <cpu_request> <cpu_limit> <memory_request> <memory_limit> <block_start> <block_end> <other_args> <rpc_endpoint> <batch_size> <cpu_cycles>"
exit 1
fi

Expand Down Expand Up @@ -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 #
Expand Down Expand Up @@ -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..."
Expand Down
Loading