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

Optimize Bucket Point Reduction #34

Open
FoodChain1028 opened this issue Jan 8, 2025 · 0 comments
Open

Optimize Bucket Point Reduction #34

FoodChain1028 opened this issue Jan 8, 2025 · 0 comments
Assignees

Comments

@FoodChain1028
Copy link
Collaborator

FoodChain1028 commented Jan 8, 2025

Problem

Current algorithm of bucket point reduction is not suitable for parallel computation. Instead, we should change this algorithm in a parallelized version.

Details

The pBPR (parallel Bucket Points Reduction) algorithm is originated from cuzk paper and we will take reference from zprize-2023 winner.

$$ \sum_{l=1}^{2^{s-1}} lB_l $$

This algorithm splits the buckets into multiple threads, computes the running sum of the points in each thread, multiplying each running sum by a required amount.

B7 +
B7 + B6 +
B7 + B6 + B5 + 
B7 + B6 + B5 + B4 +
B7 + B6 + B5 + B4 + B3 +
B7 + B6 + B5 + B4 + B3 + B2 +
B7 + B6 + B5 + B4 + B3 + B2 + B1 +
B7 + B6 + B5 + B4 + B3 + B2 + B1 + B0 =
/*
t0      | t1      | t2      | t3
*/
// Thread 0 computes:
B7 +
B7 + B6 +
(B7 + B6) * 6
// Thread 1 computes:
B5 +
B5 + B4 +
(B5 + B4) * 4
// Thread 2 computes:
B3 +
B3 + B2 +
(B3 + B2) * 2
// Thread 3 computes:
B1 +
B1 + B0

Acceptance criteria

  1. writing bpr in rust (host side).
  2. should use metal shader to generate the correct reduction result.

Next steps (optional)

This algorithm will be integrated in the future to make MSM work.

@FoodChain1028 FoodChain1028 self-assigned this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant