Skip to content

Commit

Permalink
chore(avm): better namespace reporting (#11535)
Browse files Browse the repository at this point in the history
Using the prefix until _ didn't always work, so I use the relation names now.

```
Column sizes per namespace:
  precomputed: 2097152 (~2^21)
  execution: 6 (~2^3)
  alu: 1 (~2^0)
  bc_decomposition: 61945 (~2^16)
  bc_retrieval: 1 (~2^0)
  instr_fetching: 6 (~2^3)
  range_check: 1 (~2^0)
  lookup: 196608 (~2^18)
  perm: 6 (~2^3)
```
  • Loading branch information
fcarreiro authored Jan 27, 2025
1 parent 534bb47 commit ac26e1d
Show file tree
Hide file tree
Showing 43 changed files with 167 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void AvmProver::execute_log_derivative_inverse_round()
bb::constexpr_for<0, std::tuple_size_v<Flavor::LookupRelations>, 1>([&]<size_t relation_idx>() {
using Relation = std::tuple_element_t<relation_idx, Flavor::LookupRelations>;
tasks.push_back([&]() {
AVM_TRACK_TIME(std::string("prove/execute_log_derivative_inverse_round/") + Relation::NAME,
AVM_TRACK_TIME(std::string("prove/execute_log_derivative_inverse_round/") + std::string(Relation::NAME),
(compute_logderivative_inverse<Flavor, Relation>(
prover_polynomials, relation_parameters, key->circuit_size)));
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// AUTOGENERATED FILE
#pragma once

#include <string_view>

#include "barretenberg/relations/relation_parameters.hpp"
#include "barretenberg/relations/relation_types.hpp"

Expand Down Expand Up @@ -425,7 +427,7 @@ template <typename FF_> class aluImpl {

template <typename FF> class alu : public Relation<aluImpl<FF>> {
public:
static constexpr const char* NAME = "alu";
static constexpr const std::string_view NAME = "alu";

static std::string get_subrelation_label(size_t index)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// AUTOGENERATED FILE
#pragma once

#include <string_view>

#include "barretenberg/relations/relation_parameters.hpp"
#include "barretenberg/relations/relation_types.hpp"

Expand Down Expand Up @@ -94,7 +96,7 @@ template <typename FF_> class binaryImpl {

template <typename FF> class binary : public Relation<binaryImpl<FF>> {
public:
static constexpr const char* NAME = "binary";
static constexpr const std::string_view NAME = "binary";

static std::string get_subrelation_label(size_t index)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// AUTOGENERATED FILE
#pragma once

#include <string_view>

#include "barretenberg/relations/relation_parameters.hpp"
#include "barretenberg/relations/relation_types.hpp"

Expand Down Expand Up @@ -30,7 +32,7 @@ template <typename FF_> class bytecodeImpl {

template <typename FF> class bytecode : public Relation<bytecodeImpl<FF>> {
public:
static constexpr const char* NAME = "bytecode";
static constexpr const std::string_view NAME = "bytecode";

static std::string get_subrelation_label(size_t index)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// AUTOGENERATED FILE
#pragma once

#include <string_view>

#include "barretenberg/relations/relation_parameters.hpp"
#include "barretenberg/relations/relation_types.hpp"

Expand Down Expand Up @@ -223,7 +225,7 @@ template <typename FF_> class cmpImpl {

template <typename FF> class cmp : public Relation<cmpImpl<FF>> {
public:
static constexpr const char* NAME = "cmp";
static constexpr const std::string_view NAME = "cmp";

static std::string get_subrelation_label(size_t index)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// AUTOGENERATED FILE
#pragma once

#include <string_view>

#include "barretenberg/relations/relation_parameters.hpp"
#include "barretenberg/relations/relation_types.hpp"

Expand Down Expand Up @@ -30,7 +32,7 @@ template <typename FF_> class conversionImpl {

template <typename FF> class conversion : public Relation<conversionImpl<FF>> {
public:
static constexpr const char* NAME = "conversion";
static constexpr const std::string_view NAME = "conversion";

static std::string get_subrelation_label(size_t index)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// AUTOGENERATED FILE
#pragma once

#include <string_view>

#include "barretenberg/relations/relation_parameters.hpp"
#include "barretenberg/relations/relation_types.hpp"

Expand Down Expand Up @@ -99,7 +101,7 @@ template <typename FF_> class gasImpl {

template <typename FF> class gas : public Relation<gasImpl<FF>> {
public:
static constexpr const char* NAME = "gas";
static constexpr const std::string_view NAME = "gas";

static std::string get_subrelation_label(size_t index)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// AUTOGENERATED FILE
#pragma once

#include <string_view>

#include "barretenberg/relations/relation_parameters.hpp"
#include "barretenberg/relations/relation_types.hpp"

Expand Down Expand Up @@ -30,7 +32,7 @@ template <typename FF_> class keccakf1600Impl {

template <typename FF> class keccakf1600 : public Relation<keccakf1600Impl<FF>> {
public:
static constexpr const char* NAME = "keccakf1600";
static constexpr const std::string_view NAME = "keccakf1600";

static std::string get_subrelation_label(size_t index)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
#include <string_view>
#include <tuple>

namespace bb::avm {
Expand Down Expand Up @@ -71,7 +72,7 @@ class lookup_pow_2_0_lookup_settings {
template <typename FF_>
class lookup_pow_2_0_relation : public GenericLookupRelation<lookup_pow_2_0_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_POW_2_0";
static constexpr std::string_view NAME = "LOOKUP_POW_2_0";
};
template <typename FF_> using lookup_pow_2_0 = GenericLookup<lookup_pow_2_0_lookup_settings, FF_>;

Expand Down Expand Up @@ -138,7 +139,7 @@ class lookup_pow_2_1_lookup_settings {
template <typename FF_>
class lookup_pow_2_1_relation : public GenericLookupRelation<lookup_pow_2_1_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_POW_2_1";
static constexpr std::string_view NAME = "LOOKUP_POW_2_1";
};
template <typename FF_> using lookup_pow_2_1 = GenericLookup<lookup_pow_2_1_lookup_settings, FF_>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
#include <string_view>
#include <tuple>

namespace bb::avm {
Expand Down Expand Up @@ -72,7 +73,7 @@ class lookup_byte_lengths_lookup_settings {
template <typename FF_>
class lookup_byte_lengths_relation : public GenericLookupRelation<lookup_byte_lengths_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_BYTE_LENGTHS";
static constexpr std::string_view NAME = "LOOKUP_BYTE_LENGTHS";
};
template <typename FF_> using lookup_byte_lengths = GenericLookup<lookup_byte_lengths_lookup_settings, FF_>;

Expand Down Expand Up @@ -146,7 +147,7 @@ class lookup_byte_operations_lookup_settings {
template <typename FF_>
class lookup_byte_operations_relation : public GenericLookupRelation<lookup_byte_operations_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_BYTE_OPERATIONS";
static constexpr std::string_view NAME = "LOOKUP_BYTE_OPERATIONS";
};
template <typename FF_> using lookup_byte_operations = GenericLookup<lookup_byte_operations_lookup_settings, FF_>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
#include <string_view>
#include <tuple>

namespace bb::avm {
Expand Down Expand Up @@ -84,7 +85,7 @@ class lookup_opcode_gas_lookup_settings {
template <typename FF_>
class lookup_opcode_gas_relation : public GenericLookupRelation<lookup_opcode_gas_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_OPCODE_GAS";
static constexpr std::string_view NAME = "LOOKUP_OPCODE_GAS";
};
template <typename FF_> using lookup_opcode_gas = GenericLookup<lookup_opcode_gas_lookup_settings, FF_>;

Expand Down Expand Up @@ -147,7 +148,7 @@ class lookup_l2_gas_rng_chk_0_lookup_settings {
template <typename FF_>
class lookup_l2_gas_rng_chk_0_relation : public GenericLookupRelation<lookup_l2_gas_rng_chk_0_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_L2_GAS_RNG_CHK_0";
static constexpr std::string_view NAME = "LOOKUP_L2_GAS_RNG_CHK_0";
};
template <typename FF_> using lookup_l2_gas_rng_chk_0 = GenericLookup<lookup_l2_gas_rng_chk_0_lookup_settings, FF_>;

Expand Down Expand Up @@ -210,7 +211,7 @@ class lookup_l2_gas_rng_chk_1_lookup_settings {
template <typename FF_>
class lookup_l2_gas_rng_chk_1_relation : public GenericLookupRelation<lookup_l2_gas_rng_chk_1_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_L2_GAS_RNG_CHK_1";
static constexpr std::string_view NAME = "LOOKUP_L2_GAS_RNG_CHK_1";
};
template <typename FF_> using lookup_l2_gas_rng_chk_1 = GenericLookup<lookup_l2_gas_rng_chk_1_lookup_settings, FF_>;

Expand Down Expand Up @@ -273,7 +274,7 @@ class lookup_da_gas_rng_chk_0_lookup_settings {
template <typename FF_>
class lookup_da_gas_rng_chk_0_relation : public GenericLookupRelation<lookup_da_gas_rng_chk_0_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_DA_GAS_RNG_CHK_0";
static constexpr std::string_view NAME = "LOOKUP_DA_GAS_RNG_CHK_0";
};
template <typename FF_> using lookup_da_gas_rng_chk_0 = GenericLookup<lookup_da_gas_rng_chk_0_lookup_settings, FF_>;

Expand Down Expand Up @@ -336,7 +337,7 @@ class lookup_da_gas_rng_chk_1_lookup_settings {
template <typename FF_>
class lookup_da_gas_rng_chk_1_relation : public GenericLookupRelation<lookup_da_gas_rng_chk_1_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_DA_GAS_RNG_CHK_1";
static constexpr std::string_view NAME = "LOOKUP_DA_GAS_RNG_CHK_1";
};
template <typename FF_> using lookup_da_gas_rng_chk_1 = GenericLookup<lookup_da_gas_rng_chk_1_lookup_settings, FF_>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
#include <string_view>
#include <tuple>

namespace bb::avm {
Expand Down Expand Up @@ -68,7 +69,7 @@ class incl_main_tag_err_lookup_settings {
template <typename FF_>
class incl_main_tag_err_relation : public GenericLookupRelation<incl_main_tag_err_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "INCL_MAIN_TAG_ERR";
static constexpr std::string_view NAME = "INCL_MAIN_TAG_ERR";
};
template <typename FF_> using incl_main_tag_err = GenericLookup<incl_main_tag_err_lookup_settings, FF_>;

Expand Down Expand Up @@ -131,7 +132,7 @@ class incl_mem_tag_err_lookup_settings {
template <typename FF_>
class incl_mem_tag_err_relation : public GenericLookupRelation<incl_mem_tag_err_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "INCL_MEM_TAG_ERR";
static constexpr std::string_view NAME = "INCL_MEM_TAG_ERR";
};
template <typename FF_> using incl_mem_tag_err = GenericLookup<incl_mem_tag_err_lookup_settings, FF_>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
#include <string_view>
#include <tuple>

namespace bb::avm {
Expand Down Expand Up @@ -68,7 +69,7 @@ class lookup_mem_rng_chk_0_lookup_settings {
template <typename FF_>
class lookup_mem_rng_chk_0_relation : public GenericLookupRelation<lookup_mem_rng_chk_0_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_MEM_RNG_CHK_0";
static constexpr std::string_view NAME = "LOOKUP_MEM_RNG_CHK_0";
};
template <typename FF_> using lookup_mem_rng_chk_0 = GenericLookup<lookup_mem_rng_chk_0_lookup_settings, FF_>;

Expand Down Expand Up @@ -131,7 +132,7 @@ class lookup_mem_rng_chk_1_lookup_settings {
template <typename FF_>
class lookup_mem_rng_chk_1_relation : public GenericLookupRelation<lookup_mem_rng_chk_1_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_MEM_RNG_CHK_1";
static constexpr std::string_view NAME = "LOOKUP_MEM_RNG_CHK_1";
};
template <typename FF_> using lookup_mem_rng_chk_1 = GenericLookup<lookup_mem_rng_chk_1_lookup_settings, FF_>;

Expand Down Expand Up @@ -194,7 +195,7 @@ class lookup_mem_rng_chk_2_lookup_settings {
template <typename FF_>
class lookup_mem_rng_chk_2_relation : public GenericLookupRelation<lookup_mem_rng_chk_2_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_MEM_RNG_CHK_2";
static constexpr std::string_view NAME = "LOOKUP_MEM_RNG_CHK_2";
};
template <typename FF_> using lookup_mem_rng_chk_2 = GenericLookup<lookup_mem_rng_chk_2_lookup_settings, FF_>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
#include <string_view>
#include <tuple>

namespace bb::avm {
Expand Down Expand Up @@ -71,7 +72,7 @@ class lookup_cd_value_lookup_settings {
template <typename FF_>
class lookup_cd_value_relation : public GenericLookupRelation<lookup_cd_value_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_CD_VALUE";
static constexpr std::string_view NAME = "LOOKUP_CD_VALUE";
};
template <typename FF_> using lookup_cd_value = GenericLookup<lookup_cd_value_lookup_settings, FF_>;

Expand Down Expand Up @@ -137,7 +138,7 @@ class lookup_ret_value_lookup_settings {
template <typename FF_>
class lookup_ret_value_relation : public GenericLookupRelation<lookup_ret_value_lookup_settings, FF_> {
public:
static constexpr const char* NAME = "LOOKUP_RET_VALUE";
static constexpr std::string_view NAME = "LOOKUP_RET_VALUE";
};
template <typename FF_> using lookup_ret_value = GenericLookup<lookup_ret_value_lookup_settings, FF_>;

Expand Down
Loading

1 comment on commit ac26e1d

@AztecBot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: ac26e1d Previous: 2c250c4 Ratio
wasmconstruct_proof_ultrahonk_power_of_2/20 14659.975545000001 ms/iter 13531.520641000003 ms/iter 1.08

This comment was automatically generated by workflow using github-action-benchmark.

CC: @ludamad @codygunton

Please sign in to comment.