-
Notifications
You must be signed in to change notification settings - Fork 131
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
Add sanity checks when GPU is requested #903
Conversation
9750fe3
to
7fb35ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asking for a friend: it would also be nice, at the frontend level, to be sure there is a GPU available, when people want to run in --use_gpu. Such that CML can return a clean error if users ask GPU execution without the wheel or the HW
So this can be made into an error, but now it's a warning. It can be brought further up, but it's already covered with this PR. If the wheel is not GPU capable you get: |
I don't know exactly how it works @antoniupop but CML will need to be able to try/catch the error I think, so could you do something that they can intercept, please? Maybe it's already the case, just asking |
Maybe making a CP function |
It's not an exception, just a warning. If CML wants to test at their level, it's just a matter of querrying the Cuda runtime, but we can also provide a compiler level function to check. |
Yes that would be the most reasonable. There is a function already, but only covers HW, so could add compiler configuration too. |
Yes better to have a function in CP, for direct users of CP or for CML. Thank you |
7fb35ca
to
5b2dd07
Compare
So I've added two functions to CP, |
bcf4958
to
287b3d6
Compare
8ef0d1b
to
084dd6f
Compare
084dd6f
to
ed2f081
Compare
…tion is selected to ensure that the compiler/runtime have GPU capability and that at least one device is available to run on.
…e compiler is GPU enabled and whether a GPU is available on the system.
ed2f081
to
711758c
Compare
Ensure that the compiler/runtime have GPU capability and that at least one device is available to run on.
If the compiler/runtime was not compiled with Cuda enabled (e.g., a non-GPU wheel) and GPU support is requested (use_gpu) emit warning message and continue without GPU, using CPU only with loop parallelism.
If the compiler or wheel are GPU capable, but no GPU is found, emit warning and continue on CPU.