-
Notifications
You must be signed in to change notification settings - Fork 265
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
e69b586
commit c2ab55e
Showing
16 changed files
with
97 additions
and
17 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,42 @@ | ||
import json | ||
from pathlib import Path | ||
|
||
PREFIX = Path("build-op-count-time") | ||
IVC_BENCH_JSON = Path("client_ivc_bench.json") | ||
BENCHMARK = "ClientIVCBench/Full/6" | ||
|
||
|
||
ops = {} | ||
to_keep = [ | ||
"construct_mock_function_circuit(t)", | ||
"construct_mock_folding_kernel(t)", | ||
"UltraComposer::create_prover_instance(t)", | ||
"ProtogalaxyProver::fold_instances(t)", | ||
"Decider::construct_proof(t)", | ||
"ECCVMComposer::create_prover(t)", | ||
"GoblinTranslatorComposer::create_prover(t)", | ||
"ECCVMProver::construct_proof(t)", | ||
"GoblinTranslatorProver::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"] | ||
|
||
MAX_LABEL_LENGTH = max(len(label) for label in to_keep) | ||
column = {"label":"label", "ms":"ms", "%":"% total"} | ||
print(f"{column['label']:<{MAX_LABEL_LENGTH}}{column['ms']:>8} {column['%']:>8}") | ||
for key in to_keep: | ||
time_ms = bench[key]/1e6 | ||
print(f"{key:<{MAX_LABEL_LENGTH}}{time_ms:>8.0f} {time_ms/total_time_ms:>8.2%}") | ||
|
||
print(f'\nTotal time accounted for: {sum_of_kept_times_ms:.0f}ms/{total_time_ms:.0f}ms = {sum_of_kept_times_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,26 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
TARGET="client_ivc_bench" | ||
FILTER="ClientIVCBench/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 client_ivc_bench\ | ||
"./client_ivc_bench --benchmark_filter=$FILTER\ | ||
--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 . | ||
|
||
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
1 change: 1 addition & 0 deletions
1
barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/CMakeLists.txt
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 @@ | ||
barretenberg_module(client_ivc_bench client_ivc stdlib_recursion stdlib_sha256 crypto_merkle_tree stdlib_primitives) |
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
1 change: 0 additions & 1 deletion
1
barretenberg/cpp/src/barretenberg/benchmark/ivc_bench/CMakeLists.txt
This file was deleted.
Oops, something went wrong.
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
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