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: make gpu(x) return unmodified x when GPU backends aren't loaded #2295

Merged
merged 3 commits into from
Jul 19, 2023

Conversation

IanButterworth
Copy link
Contributor

@IanButterworth IanButterworth commented Jul 19, 2023

Fixes #2294

It seems a simple gpu(x) on a cpu-only machine isn't tested.
Can someone point me to where the tests run on a machine without a gpu so I can add that?

PR Checklist

  • Tests are added
  • Entry in NEWS.md
  • Documentation, if applicable

@IanButterworth IanButterworth marked this pull request as draft July 19, 2023 00:24
@IanButterworth IanButterworth changed the title fix: make gpu return unmodified input when gpu isn't available fix: make gpu(x) return unmodified x when gpu isn't available Jul 19, 2023
@CarloLucibello
Copy link
Member

ops, closed accidentally. You can create a test/functors.jl file and put the test under a

if !(Flux.CUDA_LOADED[] || Flux.AMD_LOADED[] || Flux.METAL_LOADED[])
...

guard.

@IanButterworth IanButterworth marked this pull request as ready for review July 19, 2023 14:38
@IanButterworth IanButterworth changed the title fix: make gpu(x) return unmodified x when gpu isn't available fix: make gpu(x) return unmodified x when GPU backends aren't loaded Jul 19, 2023
@IanButterworth
Copy link
Contributor Author

It'd be great to get this out in a patch release. It's blocking 0.14 adoption for me currently

@CarloLucibello CarloLucibello merged commit 2fe82a8 into FluxML:master Jul 19, 2023
5 of 6 checks passed
@IanButterworth IanButterworth deleted the ib/fix_gpu branch July 19, 2023 17:44
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.

gpu() returns nothing
2 participants