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

GPU accelerated Grumpkin MSM #187

Merged
merged 3 commits into from
Dec 22, 2023
Merged

GPU accelerated Grumpkin MSM #187

merged 3 commits into from
Dec 22, 2023

Conversation

winston-h-zhang
Copy link
Member

@winston-h-zhang winston-h-zhang commented Dec 15, 2023

Resolves #186.

Note: force-no-sort does not disable sorting. It removes redundant sort-related symbols between pasta-msm and grumpkin-msm so the linker is happy.

Copy link
Member

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good overall, but we would really benefit from a test that, on the right platforms (x86/aarch64) and under the right feature (cuda), compares the results of cpu_best_msm and grumpkin::{bn256, grumpkin} for a deterministically-seeded random point/scalar vector.

This test should probably have existed in the pasta variant in the first place, and will give us a lot more confidence both in the sppark GPU implementation and in CPU changes required by #193

Copy link
Member

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back to your queue for the missing test.

@@ -47,7 +47,8 @@ rand = "0.8.5"
ref-cast = "1.0.20"

[target.'cfg(any(target_arch = "x86_64", target_arch = "aarch64"))'.dependencies]
pasta-msm = { git="https://github.com/lurk-lab/pasta-msm", branch="dev", version = "0.1.4" }
pasta-msm = { git = "https://github.com/lurk-lab/pasta-msm", branch = "dev", version = "0.1.4" }
grumpkin-msm = { git = "https://github.com/lurk-lab/grumpkin-msm", branch = "dev", features = ["dont-implement-sort"] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following comment would elucidate the feature:

Suggested change
grumpkin-msm = { git = "https://github.com/lurk-lab/grumpkin-msm", branch = "dev", features = ["dont-implement-sort"] }
# pasta-msm also calls into sppark, which defines the same common sorting code this crate would: the `dont-implement-sort` feature avoid creating conflicting symbols.
grumpkin-msm = { git = "https://github.com/lurk-lab/grumpkin-msm", branch = "dev", features = ["dont-implement-sort"] }

Copy link
Member

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much!

@winston-h-zhang winston-h-zhang added this pull request to the merge queue Dec 22, 2023
Merged via the queue into dev with commit e2b2008 Dec 22, 2023
4 checks passed
@winston-h-zhang winston-h-zhang deleted the grumpkin-msm branch December 22, 2023 08:07
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.

Integrate with grumpkin-msm
2 participants