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

Feat/cuzk/bucket point reduction #43

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

FoodChain1028
Copy link
Collaborator

@FoodChain1028 FoodChain1028 commented Feb 13, 2025

This PR introduce bpr (parallel) Bucket point redution algorithm in gpu.

New Utility Functions:

  • Added bpr.metal, with 2 kernels: bpr_stage_1 and bpr_stage_2.

Refactoring and Enhancements:

  • Refactored Jacobian addition (jacobian_add_2007_bl) to handle special cases where one of the points is zero or both points are equal (mopro-msm/src/msm/metal_msm/shader/curve/jacobian.metal). [1] [2]
  • Moved the jacobian_dbl_2009_l function to the top of the file and added it to the jacobian_add_2007_bl function to handle doubling when points are equal (mopro-msm/src/msm/metal_msm/shader/curve/jacobian.metal). [1] [2]

New Functions:

  • Added jacobian_scalar_mul function to perform scalar multiplication on Jacobian points (mopro-msm/src/msm/metal_msm/shader/curve/jacobian.metal).
  • Added a new Metal kernel run for scalar multiplication in jacobian_scalar_mul.metal (mopro-msm/src/msm/metal_msm/shader/curve/jacobian_scalar_mul.metal).

Tests:

  • Added bpr_stage_1 test in rust side (mopro-msm/src/msm/metal_msm/shader/cuzk/bpr.rs)
  • Adding bpr_stage_2 test in rust side.

TODOs

  • Check the result of bpr_stage_1 is correct.
  • Check the result of bpr_stage_2 is correct.

@FoodChain1028 FoodChain1028 self-assigned this Feb 13, 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

Successfully merging this pull request may close these issues.

1 participant