Skip to content

Commit

Permalink
Do not install all GPU backends at once (#2453)
Browse files Browse the repository at this point in the history
* Do not install all GPU backends at once

* Fix Enzyme tests
  • Loading branch information
pxl-th authored Jun 15, 2024
1 parent 2f19e68 commit 4d674a9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
26 changes: 2 additions & 24 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.14.16"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
Expand Down Expand Up @@ -35,13 +36,11 @@ FluxCUDAcuDNNExt = ["CUDA", "cuDNN"]
FluxMetalExt = "Metal"

[compat]
AMDGPU = "0.8, 0.9.1"
AMDGPU = "0.9.3"
Adapt = "3, 4"
CUDA = "4, 5"
ChainRulesCore = "1.12"
Compat = "4.10.0"
Enzyme = "0.12.4"
FiniteDifferences = "0.12"
Functors = "0.4"
MLUtils = "0.4"
MacroTools = "0.5"
Expand All @@ -54,27 +53,6 @@ ProgressLogging = "0.1"
Reexport = "1.0"
SpecialFunctions = "2.1.2"
Statistics = "1"
Tracker = "0.2.33"
Zygote = "0.6.67"
cuDNN = "1"
julia = "1.9"

[extras]
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
cuDNN = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"

[targets]
test = ["Test", "Documenter", "IterTools", "LinearAlgebra", "FillArrays", "ComponentArrays", "BSON", "Pkg", "CUDA", "cuDNN", "Metal", "AMDGPU", "Enzyme", "FiniteDifferences", "Tracker"]
24 changes: 24 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[deps]
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
FiniteDifferences = "0.12"
Tracker = "0.2.33"
Enzyme = "0.12.4"
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using Test
using Random, Statistics, LinearAlgebra
using IterTools: ncycle
using Zygote
using Pkg

# ENV["FLUX_TEST_AMDGPU"] = "true"
# ENV["FLUX_TEST_CUDA"] = "true"
Expand Down Expand Up @@ -73,6 +74,7 @@ Random.seed!(0)
end

if get(ENV, "FLUX_TEST_CUDA", "false") == "true"
Pkg.add(["CUDA", "cuDNN"])
using CUDA, cuDNN
Flux.gpu_backend!("CUDA")

Expand All @@ -88,6 +90,7 @@ Random.seed!(0)
end

if get(ENV, "FLUX_TEST_AMDGPU", "false") == "true"
Pkg.add("AMDGPU")
using AMDGPU
Flux.gpu_backend!("AMDGPU")

Expand All @@ -103,6 +106,7 @@ Random.seed!(0)
end

if get(ENV, "FLUX_TEST_METAL", "false") == "true"
Pkg.add("Metal")
using Metal
Flux.gpu_backend!("Metal")

Expand All @@ -118,6 +122,7 @@ Random.seed!(0)
end

@testset "Enzyme" begin
Pkg.add(["CUDA", "cuDNN"])
import Enzyme
include("ext_enzyme/enzyme.jl")
end
Expand Down

2 comments on commit 4d674a9

@mcabbott
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/109085

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.14.16 -m "<description of version>" 4d674a9e0defefe5597e8a67bd840228eb29f4aa
git push origin v0.14.16

Please sign in to comment.