Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
test: skip certain RNG tests for cuda/rocm
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Jul 3, 2024
1 parent f8c1a36 commit 99bc756
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ oneAPI = "1.5.0"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "Documenter", "ExplicitImports", "Pkg", "ReTestItems", "StableRNGs", "Test"]
test = ["Aqua", "Documenter", "ExplicitImports", "GPUArrays", "Pkg", "ReTestItems", "StableRNGs", "Test"]
7 changes: 6 additions & 1 deletion test/initializers_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,12 @@ end

v = kaiming_normal(rng, n_in, n_out)
σ2 = sqrt(2 / n_out)
@test 0.9σ2 < std(Array(v)) < 1.1σ2 # Just for safety move to Array

if (backend == "cuda" || backend == "amdgpu") && rng isa GPUArrays.RNG
@test_broken 0.9σ2 < std(v) < 1.1σ2
else
@test 0.9σ2 < std(v) < 1.1σ2
end
end
# Type
@test eltype(kaiming_uniform(rng, 3, 4; gain=1.5f0)) == Float32
Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ BACKEND_GROUP == "all" || BACKEND_GROUP == "cuda" && push!(EXTRA_PKGS, "CUDA")
BACKEND_GROUP == "all" || BACKEND_GROUP == "amdgpu" && push!(EXTRA_PKGS, "AMDGPU")
BACKEND_GROUP == "all" || BACKEND_GROUP == "metal" && push!(EXTRA_PKGS, "Metal")
BACKEND_GROUP == "all" || BACKEND_GROUP == "oneapi" && push!(EXTRA_PKGS, "oneAPI")
BACKEND_GROUP != "all" && push!(EXTRA_PKGS, "GPUArrays")

if !isempty(EXTRA_PKGS)
@info "Installing Extra Packages for testing" EXTRA_PKGS=EXTRA_PKGS
Expand Down
6 changes: 3 additions & 3 deletions test/shared_testsetup.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testsetup module SharedTestSetup

using GPUArraysCore, Random, StableRNGs
using GPUArrays, GPUArraysCore, Random, StableRNGs

GPUArraysCore.allowscalar(false)

Expand All @@ -13,7 +13,7 @@ if BACKEND_GROUP == "all" || BACKEND_GROUP == "cpu"
(Random.GLOBAL_RNG, AbstractArray, true, "cpu")])
end
if BACKEND_GROUP == "all" || BACKEND_GROUP == "cuda"
using CUDA, GPUArrays
using CUDA
append!(RNGS_ARRTYPES,
[(CUDA.default_rng(), CuArray, true, "cuda"),
(GPUArrays.default_rng(CuArray), CuArray, true, "cuda")])
Expand All @@ -38,6 +38,6 @@ if BACKEND_GROUP == "all" || BACKEND_GROUP == "oneapi"
push!(RNGS_ARRTYPES, (oneAPI.gpuarrays_rng(), oneArray, supports_fp64, "oneapi"))
end

export StableRNG, RNGS_ARRTYPES, BACKEND_GROUP
export StableRNG, RNGS_ARRTYPES, BACKEND_GROUP, GPUArrays

end

2 comments on commit 99bc756

@avik-pal
Copy link
Member Author

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/110308

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.1.9 -m "<description of version>" 99bc756e0ee0277654677da081c78d4c1ce0b6dd
git push origin v0.1.9

Please sign in to comment.