Skip to content

Commit

Permalink
fix: parallelize flatten permutation traces and collect domains
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker authored and wwared committed Jun 21, 2024
1 parent 53ca687 commit 9dad0a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/src/stark/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub type Challenger<SC> = <SC as StarkGenericConfig>::Challenger;
pub trait StarkGenericConfig: Send + Sync + Serialize + DeserializeOwned + Clone {
type Val: PrimeField;

type Domain: PolynomialSpace<Val = Self::Val> + Sync;
type Domain: PolynomialSpace<Val = Self::Val> + Sync + Send;

/// The PCS used to commit to trace polynomials.
type Pcs: Pcs<Self::Challenge, Self::Challenger, Domain = Self::Domain> + Sync;
Expand Down
6 changes: 3 additions & 3 deletions core/src/stark/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ where
let domains_and_perm_traces =
tracing::debug_span!("flatten permutation traces and collect domains").in_scope(|| {
permutation_traces
.into_iter()
.zip(trace_domains.iter())
.into_par_iter()
.zip(trace_domains.par_iter())
.map(|(perm_trace, domain)| {
let trace = perm_trace.flatten_to_base();
(*domain, trace.clone())
Expand Down Expand Up @@ -354,7 +354,7 @@ where
let quotient_values =
parent_span.in_scope(|| {
quotient_domains
.into_par_iter()
.par_iter()
.enumerate()
.map(|(i, quotient_domain)| {
tracing::debug_span!(parent: &parent_span, "compute quotient values for domain")
Expand Down

0 comments on commit 9dad0a2

Please sign in to comment.