File tree Expand file tree Collapse file tree 2 files changed +14
-19
lines changed Expand file tree Collapse file tree 2 files changed +14
-19
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,6 @@ adapt_storage(::FluxAMDAdaptor, x::AbstractRNG) = error("""
18
18
19
19
adapt_storage (:: FluxCPUAdaptor , x:: AMDGPU.rocRAND.RNG ) = Random. default_rng ()
20
20
21
- function ChainRulesCore. rrule (:: Type{Array} , x:: ROCArray )
22
- Array (x), dx -> (NoTangent (), ROCArray (unthunk (dx)))
23
- end
24
-
25
21
function ChainRulesCore. rrule (
26
22
:: typeof (Adapt. adapt_storage), to:: FluxCPUAdaptor , x:: AMDGPU.AnyROCArray ,
27
23
)
32
28
33
29
function _amd (x)
34
30
check_use_amdgpu ()
35
- USE_AMDGPU[] ?
36
- fmap (x -> Adapt. adapt (FluxAMDAdaptor (), x), x; exclude= _isleaf) :
37
- x
31
+ USE_AMDGPU[] || return x
32
+ fmap (x -> Adapt. adapt (FluxAMDAdaptor (), x), x; exclude= _isleaf)
38
33
end
39
34
40
35
# Since MIOpen supports only cross-correlation as convolution,
Original file line number Diff line number Diff line change @@ -63,18 +63,18 @@ Random.seed!(0)
63
63
end
64
64
end
65
65
66
- if get (ENV , " FLUX_TEST_AMDGPU" , " false" ) == " true"
67
- using AMDGPU
68
- AMDGPU. versioninfo ()
69
- if AMDGPU. functional () && AMDGPU. functional (:MIOpen )
70
- @show AMDGPU. MIOpen. version ()
71
- @testset " AMDGPU" begin
72
- include (" amd/runtests.jl" )
73
- end
74
- else
75
- @info " AMDGPU.jl package is not functional. Skipping AMDGPU tests."
76
- end
66
+ if get (ENV , " FLUX_TEST_AMDGPU" , " false" ) == " true"
67
+ using AMDGPU
68
+ AMDGPU. versioninfo ()
69
+ if AMDGPU. functional () && AMDGPU. functional (:MIOpen )
70
+ @show AMDGPU. MIOpen. version ()
71
+ @testset " AMDGPU" begin
72
+ include (" amd/runtests.jl" )
73
+ end
77
74
else
78
- @info " Skipping AMDGPU tests, set FLUX_TEST_CUDA=true to run them ."
75
+ @info " AMDGPU.jl package is not functional. Skipping AMDGPU tests ."
79
76
end
77
+ else
78
+ @info " Skipping AMDGPU tests, set FLUX_TEST_AMDGPU=true to run them."
79
+ end
80
80
end
You can’t perform that action at this time.
0 commit comments