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

feat: new 17 in 20 IVC bench added to actions #10777

Merged
merged 1 commit into from
Dec 16, 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
2 changes: 2 additions & 0 deletions barretenberg/cpp/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ bench-client-ivc:
COPY --dir +bench-binaries/* .
# install SRS needed for proving
COPY --dir ./srs_db/+build/. srs_db
RUN cd release && ./bin/client_ivc_bench --benchmark_out=../client_ivc_17_in_20_release.json --benchmark_filter="ClientIVCBench/Ambient_17_in_20/6$"
RUN cd release && ./bin/client_ivc_bench --benchmark_out=../client_ivc_release.json --benchmark_filter="ClientIVCBench/Full/6$"
RUN cd op-count && ./bin/client_ivc_bench --benchmark_out=../client_ivc_op_count.json --benchmark_filter="ClientIVCBench/Full/6$"
RUN cd op-count-time && ./bin/client_ivc_bench --benchmark_out=../client_ivc_op_count_time.json --benchmark_filter="ClientIVCBench/Full/6$"
Expand All @@ -248,6 +249,7 @@ bench:
END
COPY ./scripts/ci/combine_benchmarks.py ./scripts/ci/combine_benchmarks.py
RUN ./scripts/ci/combine_benchmarks.py \
native client_ivc_17_in_20_release.json \
native client_ivc_release.json \
native ultra_honk_release.json \
wasm client_ivc_wasm.json \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,29 @@ BENCHMARK_DEFINE_F(ClientIVCBench, Full)(benchmark::State& state)
}
}

/**
* @brief Benchmark the prover work for the full PG-Goblin IVC protocol
* @details Processes "dense" circuits of size 2^17 in a size 2^20 structured trace
*/
BENCHMARK_DEFINE_F(ClientIVCBench, Ambient_17_in_20)(benchmark::State& state)
{
ClientIVC ivc{ { E2E_FULL_TEST_STRUCTURE } };

auto total_num_circuits = 2 * static_cast<size_t>(state.range(0)); // 2x accounts for kernel circuits
auto mocked_vkeys = mock_verification_keys(total_num_circuits);

for (auto _ : state) {
BB_REPORT_OP_COUNT_IN_BENCH(state);
perform_ivc_accumulation_rounds(
total_num_circuits, ivc, mocked_vkeys, /* mock_vk */ true, /* large_first_app */ false);
ivc.prove();
}
}

#define ARGS Arg(ClientIVCBench::NUM_ITERATIONS_MEDIUM_COMPLEXITY)->Arg(2)

BENCHMARK_REGISTER_F(ClientIVCBench, Full)->Unit(benchmark::kMillisecond)->ARGS;
BENCHMARK_REGISTER_F(ClientIVCBench, Ambient_17_in_20)->Unit(benchmark::kMillisecond)->ARGS;

} // namespace

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ class PrivateFunctionExecutionMockCircuitProducer {

MockDatabusProducer mock_databus;

bool large_first_app = true; // if true, first app is 2^19, else 2^17

public:
PrivateFunctionExecutionMockCircuitProducer(bool large_first_app = true)
: large_first_app(large_first_app)
{}

/**
* @brief Create the next circuit (app/kernel) in a mocked private function execution stack
*/
Expand All @@ -113,7 +119,7 @@ class PrivateFunctionExecutionMockCircuitProducer {
mock_databus.populate_kernel_databus(circuit); // populate databus inputs/outputs
ivc.complete_kernel_circuit_logic(circuit); // complete with recursive verifiers etc
} else {
bool use_large_circuit = (circuit_counter == 1); // first circuit is size 2^19
bool use_large_circuit = large_first_app && (circuit_counter == 1); // first circuit is size 2^19
GoblinMockCircuits::construct_mock_app_circuit(circuit, use_large_circuit); // construct mock app
mock_databus.populate_app_databus(circuit); // populate databus outputs
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ bool verify_ivc(ClientIVC::Proof& proof, ClientIVC& ivc)
void perform_ivc_accumulation_rounds(size_t NUM_CIRCUITS,
ClientIVC& ivc,
auto& precomputed_vks,
const bool& mock_vk = false)
const bool& mock_vk = false,
const bool large_first_app = true)
{
ASSERT(precomputed_vks.size() == NUM_CIRCUITS); // ensure presence of a precomputed VK for each circuit

PrivateFunctionExecutionMockCircuitProducer circuit_producer;
PrivateFunctionExecutionMockCircuitProducer circuit_producer(large_first_app);

for (size_t circuit_idx = 0; circuit_idx < NUM_CIRCUITS; ++circuit_idx) {
MegaCircuitBuilder circuit;
Expand Down
Loading