Skip to content

Commit

Permalink
perf: Parallelize evaluation-part of quotient-LDE
Browse files Browse the repository at this point in the history
This results in a 1kHz speedup for FRI with expansion factor 4,
padded-height 2^20, on mjolnir. This steps goes from 6s to 3s.

fix #292
  • Loading branch information
Sword-Smith authored and jan-ferdinand committed May 27, 2024
1 parent ed8bb8f commit 82de299
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions triton-vm/src/stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,13 @@ impl Stark {
quotient_segment_polynomials: ArrayView1<Polynomial<XFieldElement>>,
fri_domain: ArithmeticDomain,
) -> Array2<XFieldElement> {
let fri_domain_codewords = quotient_segment_polynomials
.iter()
.map(|segment| fri_domain.evaluate(segment));
let fri_domain_codewords: Vec<_> = quotient_segment_polynomials
.into_par_iter()
.flat_map(|segment| fri_domain.evaluate(segment))
.collect();
Array2::from_shape_vec(
[fri_domain.length, NUM_QUOTIENT_SEGMENTS].f(),
fri_domain_codewords.concat(),
fri_domain_codewords,
)
.unwrap()
}
Expand Down

0 comments on commit 82de299

Please sign in to comment.