Skip to content

Commit

Permalink
parallel wide fib test
Browse files Browse the repository at this point in the history
  • Loading branch information
spapinistarkware committed Mar 19, 2024
1 parent 59e61ce commit 7e21160
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ thiserror = "1.0.56"
merging-iterator = "1.3.0"
bytemuck = { version = "1.14.3", features = ["derive"] }
tracing = "0.1.40"
rayon = "1.9.0"

[dev-dependencies]
criterion = { version = "0.5.1", features = ["html_reports"] }
Expand Down
14 changes: 9 additions & 5 deletions src/examples/wide_fib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ impl Component<AVX512Backend> for WideFibComponent {
#[cfg(all(target_arch = "x86_64", target_feature = "avx512f"))]
#[cfg(test)]
mod tests {
use rayon::prelude::*;

use crate::commitment_scheme::blake2_hash::Blake2sHasher;
use crate::commitment_scheme::hasher::Hasher;
use crate::core::channel::{Blake2sChannel, Channel};
Expand All @@ -165,10 +167,12 @@ mod tests {

// TODO(spapini): Increase to 20, to get 1GB.
const LOG_SIZE: u32 = 12;
let component = WideFibComponent { log_size: LOG_SIZE };
let air = WideFibAir { component };
let trace = gen_trace(LOG_SIZE as usize);
let channel = &mut Blake2sChannel::new(Blake2sHasher::hash(BaseField::into_slice(&[])));
prove(&air, channel, trace);
(0..8).into_par_iter().for_each(|_| {
let component = WideFibComponent { log_size: LOG_SIZE };
let air = WideFibAir { component };
let trace = gen_trace(LOG_SIZE as usize);
let channel = &mut Blake2sChannel::new(Blake2sHasher::hash(BaseField::into_slice(&[])));
prove(&air, channel, trace);
});
}
}

0 comments on commit 7e21160

Please sign in to comment.