Flux.jl icon indicating copy to clipboard operation
Flux.jl copied to clipboard

doc reference for `gpu_backend!`

Open CarloLucibello opened this issue 1 year ago • 3 comments

CarloLucibello avatar Jul 16 '23 21:07 CarloLucibello

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.90%. Comparing base (d3a083c) to head (7f6e9d3). Report is 163 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2292      +/-   ##
==========================================
+ Coverage   79.02%   79.90%   +0.88%     
==========================================
  Files          31       31              
  Lines        1721     1911     +190     
==========================================
+ Hits         1360     1527     +167     
- Misses        361      384      +23     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jul 16 '23 22:07 codecov-commenter

How easy would it be to make this friendlier?

julia> using Flux, Metal

julia> x = rand(Float32, 3) |> Flux.gpu
┌ Info: The CUDA functionality is being called but
│ `CUDA.jl` must be loaded to access it.
└ Add `using CUDA` or `import CUDA` to your code.

The minimal step would be to change this message, so that it mentions that you could be trying to use Metal / AMDGPU but have the wrong global setting.

If the Metal extension is loaded, it could be even more specific. Perhaps ideally, it would prompt you the way using Flux does, "do you want to change Flux's global setting to Metal, y/n?".

mcabbott avatar Jul 17 '23 15:07 mcabbott

Related to #2293 as well

darsnack avatar Jul 17 '23 15:07 darsnack