Skip to content

Commit

Permalink
Merge branch 'mm/pg-refactor-new' of github.com:AztecProtocol/aztec-p…
Browse files Browse the repository at this point in the history
…ackages into mm/pg-refactor-new
  • Loading branch information
maramihali committed Feb 23, 2024
2 parents f6378f3 + 8b52cc0 commit 6a339fe
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion barretenberg/cpp/scripts/collect_profile_information.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cd $(dirname $0)/..

# Configure and build with xray preset.
cmake --preset $PRESET
cmake --build --preset $PRESET
cmake --build --preset $PRESET --target $EXECUTABLE

cd build-$PRESET

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ BENCHMARK_DEFINE_F(IvcBench, Accumulate)(benchmark::State& state)
ivc.precompute_folding_verification_keys();
// Perform a specified number of iterations of function/kernel accumulation
for (auto _ : state) {
BB_REPORT_OP_COUNT_IN_BENCH(state);
perform_ivc_accumulation_rounds(state, ivc);
}
}
Expand All @@ -126,13 +127,12 @@ BENCHMARK_DEFINE_F(IvcBench, Accumulate)(benchmark::State& state)
BENCHMARK_DEFINE_F(IvcBench, Decide)(benchmark::State& state)
{
ClientIVC ivc;
ivc.precompute_folding_verification_keys();
BB_REPORT_OP_COUNT_IN_BENCH(state);
// Perform a specified number of iterations of function/kernel accumulation
perform_ivc_accumulation_rounds(state, ivc);

// Construct eccvm proof, measure only translator proof construction
for (auto _ : state) {
BB_REPORT_OP_COUNT_IN_BENCH(state);
ivc.decider_prove();
}
}
Expand All @@ -144,13 +144,12 @@ BENCHMARK_DEFINE_F(IvcBench, Decide)(benchmark::State& state)
BENCHMARK_DEFINE_F(IvcBench, ECCVM)(benchmark::State& state)
{
ClientIVC ivc;
ivc.precompute_folding_verification_keys();
BB_REPORT_OP_COUNT_IN_BENCH(state);
// Perform a specified number of iterations of function/kernel accumulation
perform_ivc_accumulation_rounds(state, ivc);

// Construct and measure eccvm only
for (auto _ : state) {
BB_REPORT_OP_COUNT_IN_BENCH(state);
ivc.goblin.prove_eccvm();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class ClientIVCTests : public ::testing::Test {
2)
*
*/
static Builder create_mock_circuit(ClientIVC& ivc, size_t num_gates = 1 << 15)
static Builder create_mock_circuit(ClientIVC& ivc, size_t log2_num_gates = 15)
{
Builder circuit{ ivc.goblin.op_queue };
GoblinMockCircuits::construct_arithmetic_circuit(circuit, num_gates);
GoblinMockCircuits::construct_arithmetic_circuit(circuit, log2_num_gates);
GoblinMockCircuits::construct_goblin_ecc_op_circuit(circuit);
return circuit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* simplify the codebase.
*/

#include "barretenberg/common/op_count.hpp"
#include "barretenberg/ecc/scalar_multiplication/scalar_multiplication.hpp"
#include "barretenberg/numeric/bitop/pow.hpp"
#include "barretenberg/polynomials/polynomial.hpp"
Expand Down Expand Up @@ -64,6 +65,7 @@ template <class Curve> class CommitmentKey {
*/
Commitment commit(std::span<const Fr> polynomial)
{
BB_OP_COUNT_TIME();
const size_t degree = polynomial.size();
ASSERT(degree <= srs->get_monomial_size());
return bb::scalar_multiplication::pippenger_unsafe<Curve>(
Expand Down
3 changes: 3 additions & 0 deletions barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "barretenberg/commitment_schemes/commitment_key.hpp"
#include "barretenberg/common/op_count.hpp"
#include "barretenberg/crypto/ecdsa/ecdsa.hpp"
#include "barretenberg/crypto/merkle_tree/membership.hpp"
#include "barretenberg/crypto/merkle_tree/memory_store.hpp"
Expand Down Expand Up @@ -108,6 +109,7 @@ class GoblinMockCircuits {
*/
static void construct_mock_function_circuit(GoblinUltraBuilder& builder, bool large = false)
{
BB_OP_COUNT_TIME();
// Determine number of times to execute the below operations that constitute the mock circuit logic. Note
// that the circuit size does not scale linearly with number of iterations due to e.g. amortization of
// lookup costs
Expand Down Expand Up @@ -233,6 +235,7 @@ class GoblinMockCircuits {
const VerifierFoldData& kernel,
std::shared_ptr<VerifierInstance>& prev_kernel_accum)
{
BB_OP_COUNT_TIME();
using GURecursiveFlavor = GoblinUltraRecursiveFlavor_<GoblinUltraBuilder>;
using RecursiveVerifierInstances =
bb::stdlib::recursion::honk::RecursiveVerifierInstances_<GURecursiveFlavor, 2>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#include "barretenberg/common/op_count.hpp"
#include "barretenberg/common/thread.hpp"
#include "barretenberg/ecc/curves/bn254/fr.hpp"
#include "barretenberg/flavor/flavor.hpp"
Expand Down Expand Up @@ -240,6 +241,7 @@ template <class ProverInstances_> class ProtoGalaxyProver_ {
static Polynomial<FF> compute_perturbator(const std::shared_ptr<Instance> accumulator,
const std::vector<FF>& deltas)
{
BB_OP_COUNT_TIME();
auto full_honk_evaluations = compute_full_honk_evaluations(
accumulator->prover_polynomials, accumulator->alphas, accumulator->relation_parameters);
const auto betas = accumulator->gate_challenges;
Expand Down Expand Up @@ -291,6 +293,7 @@ template <class ProverInstances_> class ProtoGalaxyProver_ {
*/
ExtendedUnivariateWithRandomization compute_combiner(const ProverInstances& instances, PowPolynomial<FF>& pow_betas)
{
BB_OP_COUNT_TIME();
size_t common_instance_size = instances[0]->instance_size;
pow_betas.compute_values();
// Determine number of threads for multithreading.
Expand Down

0 comments on commit 6a339fe

Please sign in to comment.