-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into md/02-16-feat_avm_storage
- Loading branch information
Showing
95 changed files
with
2,244 additions
and
1,929 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import json | ||
from pathlib import Path | ||
|
||
PREFIX = Path("build-op-count-time") | ||
IVC_BENCH_JSON = Path("client_ivc_bench.json") | ||
BENCHMARK = "ClientIVCBench/Full/6" | ||
|
||
# Single out an independent set of functions accounting for most of BENCHMARK's real_time | ||
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)" | ||
] | ||
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(filter(lambda x: x[0] in to_keep, bench.items())) | ||
|
||
# For each kept time, get the proportion over all kept times. | ||
sum_of_kept_times_ms = sum(float(time) | ||
for _, time in bench_components.items())/1e6 | ||
MAX_LABEL_LENGTH = max(len(label) for label in to_keep) | ||
column = {"function": "function", "ms": "ms", "%": "% sum"} | ||
print( | ||
f"{column['function']:<{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/sum_of_kept_times_ms:>8.2%}") | ||
|
||
# Validate that kept times account for most of the total measured time. | ||
total_time_ms = bench["real_time"] | ||
totals = '\nTotal time accounted for: {:.0f}ms/{:.0f}ms = {:.2%}' | ||
totals = totals.format( | ||
sum_of_kept_times_ms, total_time_ms, sum_of_kept_times_ms/total_time_ms) | ||
print(totals) |
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,25 @@ | ||
#!/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 | ||
|
||
# Retrieve output from benching instance | ||
cd $BUILD_DIR | ||
scp $BB_SSH_KEY $BB_SSH_INSTANCE:$BB_SSH_CPP_PATH/build/$TARGET.json . | ||
|
||
# Analyze the results | ||
cd $(dirname $0)/.. | ||
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
Oops, something went wrong.