-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30d92bc
commit 8b6c421
Showing
11 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import json | ||
from pathlib import Path | ||
|
||
PREFIX = Path("build-op-count-time") | ||
IVC_BENCH_JSON = Path("ivc_bench.json") | ||
BENCHMARK = "IvcBench/Full/6" | ||
|
||
|
||
ops = {} | ||
to_keep = [ | ||
"construct_mock_function_circuit(t)", | ||
"construct_mock_folding_kernel(t)", | ||
"ProtogalaxyProver::fold_instances(t)", | ||
"Decider::construct_proof(t)", | ||
"ECCVMComposer::create_prover(t)", | ||
"GoblinTranslatorComposer::create_prover(t)", | ||
"eccvm::construct_proof(t)", | ||
"translator::construct_proof(t)", | ||
"Goblin::merge(t)" | ||
] | ||
|
||
to_keep_condition = lambda x: x[0] in to_keep | ||
|
||
with open(PREFIX/IVC_BENCH_JSON, "r") as read_file: | ||
read_result = json.load(read_file) | ||
for _bench in read_result["benchmarks"]: | ||
if _bench["name"] == BENCHMARK: | ||
bench = _bench | ||
|
||
bench_components = dict([pair for pair in filter(to_keep_condition, bench.items()) ]) | ||
sum_of_kept_times_ms = sum(float(time) for _, time in bench_components.items())/1e6 | ||
total_time_ms = bench["real_time"] | ||
|
||
print(f'Total time accounted for: {sum_of_kept_times_ms:.0f}ms/{total_time_ms:.0f}ms = {sum_of_kept_times_ms/total_time_ms:.2%}') | ||
print('breakdown:') | ||
for key in to_keep: | ||
time_ms = bench[key]/1e6 | ||
print(key, f"{time_ms: .0f}ms, {time_ms/total_time_ms: .2%}") |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
TARGET="ivc_bench" | ||
FILTER="IvcBench/Full/6$" | ||
|
||
BUILD_DIR=build-op-count-time | ||
|
||
# Move above script dir. | ||
cd $(dirname $0)/.. | ||
|
||
# Measure the benchmarks with ops time counting | ||
./scripts/benchmark_remote.sh ivc_bench\ | ||
"./ivc_bench --benchmark_filter=Full/6$\ | ||
--benchmark_out=$TARGET.json\ | ||
--benchmark_out_format=json"\ | ||
op-count-time\ | ||
build-op-count-time | ||
|
||
cd $BUILD_DIR | ||
scp $BB_SSH_KEY $BB_SSH_INSTANCE:$BB_SSH_CPP_PATH/build/$TARGET.json . | ||
|
||
# # If needed, benchmark the basic Fr operations | ||
# FIELD_OP_COSTS=field_op_costs.json | ||
# if [ ! -f $FIELD_OP_COSTS ]; then | ||
# cd ../ | ||
# FIELD_OPS_TARGET=fr_straight_bench | ||
# cmake --preset clang16 | ||
# cmake --build --preset clang16 --target $FIELD_OPS_TARGET | ||
# cd build | ||
# ./bin/$FIELD_OPS_TARGET --benchmark_out=../$BUILD_DIR/$FIELD_OP_COSTS \ | ||
# --benchmark_out_format=json | ||
# fi | ||
|
||
# # Compute the singly-threaded benchmarks for comparison | ||
# cd ../ | ||
# ./scripts/benchmark_remote.sh goblin_bench "taskset -c 0 ./goblin_bench --benchmark_filter=Full/1$" | ||
|
||
cd ../ | ||
|
||
# Analyze the results | ||
python3 ./scripts/analyze_client_ivc_bench.py |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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