-
Notifications
You must be signed in to change notification settings - Fork 22
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
Create CUDA extension #259
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #259 +/- ##
==========================================
+ Coverage 50.80% 51.08% +0.27%
==========================================
Files 21 22 +1
Lines 1986 1985 -1
==========================================
+ Hits 1009 1014 +5
+ Misses 977 971 -6
☔ View full report in Codecov by Sentry. |
Project.toml
Outdated
[weakdeps] | ||
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" |
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.
From Julia's formatter, it appears that expected order of project keys to be:
- deps
- compat
- weakdeps
- extensions
- compat
- extras
- targets
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.
It depends on the Julia version you use: On Julia 1.6, the order Pkg uses is
- deps
- compat
- extensions
- extras
- targets
- weakdeps
whereas on Julia 1.7, 1.8, and 1.9 it is - deps
- weakdeps
- extensions
- compat
- extras
- targets
See eg the discussion in JuliaTesting/Aqua.jl#105 and in particular JuliaTesting/Aqua.jl#105 (comment)
I guess you were referring to the order in Julia > 1.6 and accidentally included the compat section twice?
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.
Yes I meant to refer to Julia > 1.6, sorry about the confusion for the duplicated compat
.
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.
I updated the order to the convention in Julia > 1.6.
Thanks for the PR!
|
Yes, CUDA should be kept in the
Problems with 1.10 should be caused by something else. |
No, it should work fine (the main problem with CUDA is that it pulls in many dependencies and in particular CUDA jlls). The problem with the current nightlies (https://github.com/TuringLang/MCMCDiagnosticTools.jl/actions/runs/6428712477/job/17456380934#step:6:335) is that CUDA defines GPU overrides for |
Thanks for the clarifications. Regarding the Project.toml keys order, I'll likely move towards the Julia v1.6 order in subsequent release. Let me know if that's an issue for you. Or feel free to make an adjustment in this PR. |
I updated the order of the sections in the Project.toml file to the convention in Julia > 1.6. |
Registraion of new release v0.16.3 is underway. Thanks for your patience! |
Thank you! |
I moved the CUDA-specific code to an extension. On Julia < 1.9, CUDA will continue to be a dependency and CUDA is supported automatically; on Julia >= 1.9, the package will not install CUDA by default but CUDA support can be enabled by loading CUDA (explicitly with e.g.
using CUDA
or when loaded by another dependency).It was reasonably straightforward:
device_ones
->ones
on the CPU,CUDA.ones
on the GPU,device_array_type
->Array
on the CPU,CuArray
on the GPU, andpost_fit_gc
-> no-op on the CPU and garbage collection on the GPU) were sufficient.The main problem is that I don't have access to an NVIDIA GPU, and hence can't verify that I did not break CUDA support 😅 I would recommend adding CUDA-specific tests with buildkite to the repo (see https://github.com/JuliaGPU/buildkite#adding-a-repository, the setup is quite straightforward, I did add it to a few repos successfully).
Fixes #226.