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

MSM improvements #372

Merged
merged 14 commits into from
Feb 15, 2024
Prev Previous commit
Next Next commit
All zero scalars case handled
  • Loading branch information
DmytroTym committed Feb 15, 2024
commit d42a5898f151f290bd758a87b9eb886f0f939fba
4 changes: 2 additions & 2 deletions icicle/appUtils/msm/msm.cu
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,9 @@ namespace msm {
unsigned TOTAL_THREADS = 129000; // TODO: device dependent
unsigned cutoff_run_length = max(2, h_nof_buckets_to_compute / TOTAL_THREADS);
unsigned cutoff_nof_runs = (h_nof_buckets_to_compute + cutoff_run_length - 1) / cutoff_run_length;
NUM_THREADS = min(1 << 5, cutoff_nof_runs);
NUM_THREADS = 1 << 5;
NUM_BLOCKS = (cutoff_nof_runs + NUM_THREADS - 1) / NUM_THREADS;
if (bucket_th > 0)
if (h_nof_buckets_to_compute > 0 && bucket_th > 0)
find_cutoff_kernel<S><<<NUM_BLOCKS, NUM_THREADS, 0, stream>>>(
sorted_bucket_sizes, h_nof_buckets_to_compute, bucket_th, cutoff_run_length, nof_large_buckets);
unsigned h_nof_large_buckets;
Expand Down
6 changes: 1 addition & 5 deletions wrappers/rust/icicle-core/src/msm/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,9 @@ where
let rng = &mut test_rng();
for test_size in test_sizes {
for batch_size in batch_sizes {
let mut points = generate_random_affine_points_with_zeroes(test_size * batch_size, 5);
let points = generate_random_affine_points_with_zeroes(test_size * batch_size, 100);
let mut scalars = vec![C::ScalarField::zero(); test_size * batch_size];

// add some zero points
for _ in 0..100 {
points[rng.gen_range(0..test_size * batch_size)] = Affine::<C>::zero();
}
for _ in 0..(test_size * batch_size) {
scalars[rng.gen_range(0..test_size * batch_size)] = C::ScalarField::one();
}
Expand Down