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

Make CUDA an optional dependency in Julia 1.9 #250

Closed
mohamed82008 opened this issue Aug 24, 2023 · 3 comments · Fixed by #253
Closed

Make CUDA an optional dependency in Julia 1.9 #250

mohamed82008 opened this issue Aug 24, 2023 · 3 comments · Fixed by #253
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mohamed82008
Copy link
Contributor

Motivation and description

CUDA and GPUCompiler are heavy dependencies and are often not needed in non-CUDA systems.

Possible Implementation

The new pkg extensions in Julia1.9 can be used.

@ToucheSir
Copy link
Member

The only code which relies on CUDA.jl is https://github.com/FluxML/Metalhead.jl/blob/4e5b8f16964468518eeb6eb8d7e5f85af4ecf959/src/layers/drop.jl#L48C1-L52, so extracting that into an extension should be sufficient.

@ToucheSir ToucheSir added enhancement New feature or request good first issue Good for newcomers labels Aug 24, 2023
@theabhirath
Copy link
Member

With all the different GPU backend work in Flux recently to allow for Metal and AMD, is there a way to write this code so that it just works for all of them? Also something to fix is that Metalhead uses a private function from Flux here (Flux.isactive, which I believe may have been renamed upstream). GPU testing is also an issue...highlighting all these here because they just occurred to me 😅

@ToucheSir
Copy link
Member

For RNGs? Probably not, because I don't think the GPU packages have a common interface or supertype for their RNG types.

Some sort of getter for the train/test status of a layer would be a nice addition to Flux. I think we'd just have to bikeshed the name. _isactive as used internally does something other than that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants