pub struct ProvingMemoryConfig {
pub base_field_size: usize,
pub extension_degree: usize,
pub log_blowup: usize,
pub l_skip: usize,
pub max_constraint_degree: usize,
pub cache_rs_code_matrix: bool,
}Expand description
Configuration for proving memory estimates.
Fields§
§base_field_size: usizeSize of one base-field element in bytes.
extension_degree: usizeDegree of the extension field over the base field.
log_blowup: usize-log_2 of the rate for the initial Reed-Solomon code.
l_skip: usizelog_2 of the univariate skip domain.
max_constraint_degree: usizeMaximum constraint degree across AIR and interaction constraints.
cache_rs_code_matrix: boolWhether the prover keeps the Reed-Solomon code matrix cached after stacked_commit.
Implementations§
Source§impl ProvingMemoryConfig
impl ProvingMemoryConfig
pub fn from_protocol_config<SC: StarkProtocolConfig>( config: &SC, cache_rs_code_matrix: bool, ) -> Self
pub fn main_memory_bytes(&self, main_cells: usize) -> usize
pub fn rs_code_matrix_memory_bytes(&self, main_cells: usize) -> usize
pub fn main_cell_secondary_weight(&self) -> f64
Sourcepub fn main_secondary_memory_bytes_for_rot(
&self,
main_cells: usize,
need_rot: bool,
) -> usize
pub fn main_secondary_memory_bytes_for_rot( &self, main_cells: usize, need_rot: bool, ) -> usize
Secondary memory for main_cells = Σ(padded_height * width).
mat_eval_bytes = (padded_height / 2^l_skip) * ((1 + need_rot) * width) * sizeof(EF)
= (1 + need_rot) * main_cells * D_EF / 2^l_skip * sizeof(F)
interp_bytes = (constraint_degree / 2) * mat_eval_bytes
secondary_bytes = (1 + constraint_degree / 2) * mat_eval_bytes
secondary_weight = (1 + constraint_degree / 2) * D_EF / 2^l_skipAIRs with need_rot = true open two PCS cells per column.
pub fn main_secondary_memory_bytes(&self, counts: ProvingMemoryCounts) -> usize
pub fn interaction_memory_bytes_without_overhead( &self, interaction_cells: usize, ) -> usize
pub fn interaction_memory_bytes(&self, interaction_cells: usize) -> usize
Sourcepub fn estimate(&self, counts: ProvingMemoryCounts) -> ProvingMemoryEstimate
pub fn estimate(&self, counts: ProvingMemoryCounts) -> ProvingMemoryEstimate
Convert main trace cells and interaction cells to memory bytes.
main_cells = main_cells_with_rot + main_cells_without_rot
main = main_cells * sizeof(F)
rs_code_matrix = main_cells * 2^log_blowup * sizeof(F)
main_secondary = sizeof(F) *
(2 * main_cell_secondary_weight() * main_cells_with_rot
+ main_cell_secondary_weight() * main_cells_without_rot)
interaction = sizeof(F) * interaction_cell_weight * interaction_cells
+ INTERACTION_MEMORY_OVERHEADCached RS code matrix:
total = main + rs_code_matrix + max(main_secondary, interaction)Dropped RS code matrix:
total = main + max(rs_code_matrix, main_secondary, interaction)Trait Implementations§
Source§impl Clone for ProvingMemoryConfig
impl Clone for ProvingMemoryConfig
Source§fn clone(&self) -> ProvingMemoryConfig
fn clone(&self) -> ProvingMemoryConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ProvingMemoryConfig
Source§impl Debug for ProvingMemoryConfig
impl Debug for ProvingMemoryConfig
Source§impl PartialEq for ProvingMemoryConfig
impl PartialEq for ProvingMemoryConfig
impl StructuralPartialEq for ProvingMemoryConfig
Auto Trait Implementations§
impl Freeze for ProvingMemoryConfig
impl RefUnwindSafe for ProvingMemoryConfig
impl Send for ProvingMemoryConfig
impl Sync for ProvingMemoryConfig
impl Unpin for ProvingMemoryConfig
impl UnsafeUnpin for ProvingMemoryConfig
impl UnwindSafe for ProvingMemoryConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more