mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-04 06:43:07 +00:00
Tweaks to bench_ldes
This commit is contained in:
parent
0b75c9f1bc
commit
741dc4c94c
@ -8,25 +8,28 @@ use plonky2::polynomial::polynomial::PolynomialValues;
|
||||
|
||||
type F = CrandallField;
|
||||
|
||||
// 113 wire polys, 3 Z polys, 4 parts of quotient poly.
|
||||
const PROVER_POLYS: usize = 113 + 3 + 4;
|
||||
// This is an estimate of how many LDEs the prover will compute. The biggest component, 86, comes
|
||||
// from wire polynomials which "store" the outputs of S-boxes in our Poseidon gate.
|
||||
const NUM_LDES: usize = 8 + 8 + 3 + 86 + 3 + 8;
|
||||
|
||||
const DEGREE: usize = 1 << 14;
|
||||
|
||||
const RATE_BITS: usize = 3;
|
||||
|
||||
fn main() {
|
||||
const DEGREE: usize = 1 << 13;
|
||||
const RATE_BITS: usize = 3;
|
||||
// We start with random polynomials.
|
||||
let all_poly_values = (0..NUM_LDES)
|
||||
.map(|_| PolynomialValues::new(F::rand_vec(DEGREE)))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let start = Instant::now();
|
||||
(0usize..PROVER_POLYS).into_par_iter().for_each(|i| {
|
||||
let mut values = vec![F::ZERO; DEGREE];
|
||||
for j in 0usize..DEGREE {
|
||||
values[j] = F::from_canonical_u64((i * j) as u64);
|
||||
}
|
||||
let poly_values = PolynomialValues::new(values);
|
||||
|
||||
all_poly_values.into_par_iter().for_each(|poly_values| {
|
||||
let start = Instant::now();
|
||||
let result = poly_values.lde(RATE_BITS);
|
||||
let lde = poly_values.lde(RATE_BITS);
|
||||
let duration = start.elapsed();
|
||||
println!("LDE took {:?}", duration);
|
||||
println!("LDE result: {:?}", result.values[0]);
|
||||
println!("LDE result: {:?}", lde.values[0]);
|
||||
});
|
||||
println!("FFT overall took {:?}", start.elapsed());
|
||||
}
|
||||
|
||||
@ -349,12 +349,12 @@ mod tests {
|
||||
use crate::circuit_data::CircuitConfig;
|
||||
use crate::field::crandall_field::CrandallField;
|
||||
use crate::field::field::Field;
|
||||
use crate::gates::gate_testing::test_low_degree;
|
||||
use crate::gates::gmimc::{GMiMCGate, W};
|
||||
use crate::generator::generate_partial_witness;
|
||||
use crate::gmimc::gmimc_permute_naive;
|
||||
use crate::wire::Wire;
|
||||
use crate::witness::PartialWitness;
|
||||
use crate::gates::gate_testing::test_low_degree;
|
||||
|
||||
#[test]
|
||||
fn generated_output() {
|
||||
|
||||
@ -168,9 +168,7 @@ struct InterpolationGenerator<F: Field + Extendable<D>, const D: usize> {
|
||||
_phantom: PhantomData<F>,
|
||||
}
|
||||
|
||||
impl<F: Field + Extendable<D>, const D: usize> SimpleGenerator<F>
|
||||
for InterpolationGenerator<F, D>
|
||||
{
|
||||
impl<F: Field + Extendable<D>, const D: usize> SimpleGenerator<F> for InterpolationGenerator<F, D> {
|
||||
fn dependencies(&self) -> Vec<Target> {
|
||||
let local_target = |input| {
|
||||
Target::Wire(Wire {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user