Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev-cliff-support-bn128
Browse files Browse the repository at this point in the history
  • Loading branch information
cliff0412 committed Mar 25, 2024
2 parents 1d46a15 + 57662ec commit 4714e90
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion depends/cryptography_cuda
11 changes: 5 additions & 6 deletions plonky2/src/fri/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>
let log_n = log2_strict(degree);

#[cfg(feature = "cuda")]
if log_n + rate_bits > 10 && polynomials.len() > 0 {
if log_n + rate_bits > 1 && polynomials.len() > 0 {
println!("invoke from_coeffs_gpu with log_n: {:?}", log_n);
let lde_values = Self::from_coeffs_gpu(
&polynomials,
rate_bits,
Expand Down Expand Up @@ -232,9 +233,6 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>

let start_lde = std::time::Instant::now();

// let poly_chunk = polynomials;
// let id = 0;

let mut gpu_input: Vec<F> = polynomials
.into_iter()
.flat_map(
Expand All @@ -254,7 +252,7 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>

let mut device_output_data: HostOrDeviceSlice<'_, F> =
HostOrDeviceSlice::cuda_malloc(0 as i32, total_num_output_elements).unwrap();

println!("start lde_batch_multi_gpu");
lde_batch_multi_gpu::<F>(
device_output_data.as_mut_ptr(),
gpu_input.as_mut_ptr(),
Expand Down Expand Up @@ -299,7 +297,8 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize>
0,
total_num_of_fft,
).expect("copy to host error");
PolynomialValues::new(host_data).values
// PolynomialValues::new(host_data).values
host_data
})
.collect::<Vec<Vec<F>>>();
println!("collect data from gpu used: {:?}", start.elapsed());
Expand Down
2 changes: 1 addition & 1 deletion plonky2/tests/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn init_cuda() {
println!("num of gpus: {:?}", num_of_gpus);
std::env::set_var("NUM_OF_GPUS", num_of_gpus.to_string());

let log_ns: Vec<usize> = (6..22).collect();
let log_ns: Vec<usize> = (2..22).collect();

let mut device_id = 0;
while device_id < num_of_gpus {
Expand Down

0 comments on commit 4714e90

Please sign in to comment.