pub struct PartitionOptions { /* private fields */ }Expand description
Defines the parameters used to calculate partition size when committing to the traces generated during the protocol.
Using multiple partitions will change how vector commitments are calculated:
- Input matrix columns are split into at most num_partitions partitions
- For each matrix row, a hash is calculated for each partition separately
- The results are merged together by one more hash iteration
This is especially useful when proving with multiple GPU cards where each device holds a subset of data and allows less data reshuffling when generating commitments.
Hash_rate parameter is used to find the optimal partition size to minimize the number of hash iterations. It specifies how many field elements are consumed by each hash iteration.
Implementations§
Source§impl PartitionOptions
impl PartitionOptions
Sourcepub const fn new(num_partitions: usize, hash_rate: usize) -> Self
pub const fn new(num_partitions: usize, hash_rate: usize) -> Self
Returns a new instance of [PartitionOptions].
Sourcepub fn partition_size<E: FieldElement>(&self, num_columns: usize) -> usize
pub fn partition_size<E: FieldElement>(&self, num_columns: usize) -> usize
Returns the size of each partition used when committing to the main and auxiliary traces as
well as the constraint evaluation trace.
The returned size is given in terms of number of columns in the field E.
Sourcepub fn num_partitions<E: FieldElement>(&self, num_columns: usize) -> usize
pub fn num_partitions<E: FieldElement>(&self, num_columns: usize) -> usize
The actual number of partitions, after the min partition size implied by the hash rate is taken into account.
Trait Implementations§
Source§impl Clone for PartitionOptions
impl Clone for PartitionOptions
Source§fn clone(&self) -> PartitionOptions
fn clone(&self) -> PartitionOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more