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

fix: Add a working cuda feature #9

Merged
merged 3 commits into from
Jan 23, 2024
Merged

fix: Add a working cuda feature #9

merged 3 commits into from
Jan 23, 2024

Conversation

winston-h-zhang
Copy link
Contributor

@winston-h-zhang winston-h-zhang commented Jan 9, 2024

Resolves lurk-lang/arecibo#259 downstream. This PR adds an actual cuda feature that can be toggled grumpkin-msm, and thus all of its dependents. We also add GPU CI checks.

@@ -0,0 +1,33 @@
# Runs the test suite on a self-hosted GPU machine with CUDA enabled

Choose a reason for hiding this comment

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

Nit: we're only building here, not testing. Is the latter intended for later or not a priority?

Copy link
Contributor

@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.

  1. do we really need to push the semantics of the cuda feature inside grumpkin-msm or can we simply not import grumpkin-msm in dependents if that feature is not activated?
  2. can we make grumpkin-msm print an indiscutably spectacular message if it's loaded and does not manage to resolve to a GPU-using MSM? I really want the fallback to the CPU to be extremely noticeable, 100% of the time, every time.

Copy link
Contributor

@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.

To reproduce the comment from lurk-lang/arecibo#259, this is going in a good direction given the fresh benchmarks results, but:

we should make grumpkin-msm:
1/ always compile the CPU method, as it does now,
2/ only attempt to compile and run the GPU method when the cuda feature is enabled
3/ emit an indiscutably spectacular message when it's compiled with the cuda feature and does not find the CPU,

@winston-h-zhang
Copy link
Contributor Author

This is the error message:

paperspace@psrjp5jvivu1:~/lurk-lab/grumpkin-msm$ cargo build --features cuda
   Compiling sppark v0.1.5
   Compiling grumpkin-msm v0.1.0 (/home/paperspace/lurk-lab/grumpkin-msm)
warning: [email protected]: feature "cuda" was enabled but no valid installation of CUDA was found
warning: [email protected]: the crate's default CPU methods will be compiled instead; NO GPU IMPLEMENTATION WILL BE USED WHEN CALLING THIS CRATE'S METHODS
warning: [email protected]: please recompile without feature "cuda" or provide a valid CUDA installation
    Finished dev [unoptimized + debuginfo] target(s) in 2.48s

Copy link
Contributor

@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.

Excellent, thanks a lot!

@winston-h-zhang winston-h-zhang merged commit 29af3cd into dev Jan 23, 2024
6 checks passed
@winston-h-zhang winston-h-zhang deleted the fix-cuda-feature branch January 23, 2024 21:24
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.

CUDA acceleration always enabled regardless of cuda feature enabled
3 participants