Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed locks and build MT only with allocated leaves from Rust #27

Merged
merged 6 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion field/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ rand = { workspace = true, features = ["getrandom"] }
serde = { workspace = true, features = ["alloc"] }
static_assertions = { workspace = true }
unroll = { workspace = true }
cryptography_cuda ={git="ssh://[email protected]/okx/cryptography_cuda.git", rev="56cee09dd044de44f05c7d54383c6a8cb4078b29", optional=true}
cryptography_cuda = { git = "ssh://[email protected]/okx/cryptography_cuda.git", rev = "173510160183f3299f4765b30bd4f2c1685353f9", optional = true }

[dev-dependencies]
rand = { version = "0.8.5", default-features = false, features = ["getrandom"] }
Expand Down
2 changes: 1 addition & 1 deletion plonky2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ once_cell = { version = "1.18.0" }
plonky2_field = { version = "0.2.0", path = "../field", default-features = false }
plonky2_maybe_rayon = { version = "0.2.0", path = "../maybe_rayon", default-features = false }
plonky2_util = { version = "0.2.0", path = "../util", default-features = false }
cryptography_cuda ={git="ssh://[email protected]/okx/cryptography_cuda.git", rev="56cee09dd044de44f05c7d54383c6a8cb4078b29", optional=true}
cryptography_cuda = { git = "ssh://[email protected]/okx/cryptography_cuda.git", rev = "173510160183f3299f4765b30bd4f2c1685353f9", optional = true }

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
getrandom = { version = "0.2", default-features = false, features = ["js"] }
Expand Down
9 changes: 0 additions & 9 deletions plonky2/src/fri/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ use cryptography_cuda::{
device::memory::HostOrDeviceSlice, lde_batch, lde_batch_multi_gpu, transpose_rev_batch,
types::*,
};
#[cfg(feature = "cuda")]
use crate::hash::merkle_tree::GPU_LOCK;

use itertools::Itertools;
use plonky2_field::types::Field;
Expand Down Expand Up @@ -245,10 +243,6 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>
log_n: usize,
_degree: usize,
) -> MerkleTree<F, <C as GenericConfig<D>>::Hasher> {

let mut lock = GPU_LOCK.lock().unwrap();
*lock += 1;

// let salt_size = if blinding { SALT_SIZE } else { 0 };
// println!("salt_size: {:?}", salt_size);
let output_domain_size = log_n + rate_bits;
Expand Down Expand Up @@ -374,9 +368,6 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>

#[cfg(all(feature = "cuda", feature = "batch"))]
if log_n > 10 && polynomials.len() > 0 {
let mut lock = GPU_LOCK.lock().unwrap();
*lock += 1;

println!("log_n: {:?}", log_n);
let start_lde = std::time::Instant::now();

Expand Down
Loading
Loading