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

Commit

Permalink
test: check if extended test sets are useful
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Jul 5, 2024
1 parent 31d03b6 commit 63642a7
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestSetExtensions = "98d24dd4-01ad-11ea-1b02-c9a08f80db04"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
cuDNN = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"

[targets]
test = ["AMDGPU", "Aqua", "CUDA", "ComponentArrays", "ExplicitImports", "ForwardDiff", "LuxCUDA", "LuxDeviceUtils", "LuxTestUtils", "ReTestItems", "ReverseDiff", "StableRNGs", "Test", "Tracker", "Zygote", "cuDNN"]
test = ["AMDGPU", "Aqua", "CUDA", "ComponentArrays", "ExplicitImports", "ForwardDiff", "LuxCUDA", "LuxDeviceUtils", "LuxTestUtils", "ReTestItems", "ReverseDiff", "StableRNGs", "Test", "TestSetExtensions", "Tracker", "Zygote", "cuDNN"]
2 changes: 1 addition & 1 deletion test/batchnorm_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
end
end

@testset "$mode" for (mode, aType, on_gpu) in MODES
@testset ExtendedTestSet "$mode" for (mode, aType, on_gpu) in MODES
@testset "eltype $T, size $sz, $act" for T in (Float16, Float32, Float64),
sz in ((4, 4, 6, 2), (8, 2), (4, 4, 4, 3, 2)),
training in (Val(true), Val(false)),
Expand Down
2 changes: 1 addition & 1 deletion test/conv_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

anonact = x -> gelu(x)

@testset "$mode" for (mode, aType, on_gpu) in MODES
@testset ExtendedTestSet "$mode" for (mode, aType, on_gpu) in MODES
# These are not all possible combinations but rather a representative set to keep
# CI timings under check
# Most of the actual tests happen upstream in Lux
Expand Down
2 changes: 1 addition & 1 deletion test/dense_tests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@testitem "Fused Dense Bias Activation" tags=[:common_ops] setup=[SharedTestSetup] begin
rng = get_stable_rng(12345)

@testset "$mode" for (mode, aType, on_gpu) in MODES
@testset ExtendedTestSet "$mode" for (mode, aType, on_gpu) in MODES
# These are not all possible combinations but rather a representative set to keep
# CI timings under check
@testset "$(Tw) x $(Tx)" for (Tw, Tx) in [
Expand Down
2 changes: 1 addition & 1 deletion test/dropout_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ end

rng = get_stable_rng(12345)

@testset "$mode" for (mode, aType, on_gpu) in MODES
@testset ExtendedTestSet "$mode" for (mode, aType, on_gpu) in MODES
for T in (Float16, Float32, Float64),
x_shape in ((2, 3), (2, 2, 3), (2, 2, 3, 1), (2, 2, 1, 3, 1))

Expand Down
4 changes: 2 additions & 2 deletions test/forwarddiff_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
end
end

@testset "$(mode): Jacobian Vector Products" for (mode, aType, on_gpu) in MODES
@testset ExtendedTestSet "$(mode): Jacobian Vector Products" for (mode, aType, on_gpu) in MODES
@testset "$(op)(; flipped = $flipped)" for flipped in (true, false),
op in (depthwiseconv, conv)

Expand Down Expand Up @@ -96,7 +96,7 @@ end

rng = get_stable_rng(12345)

@testset "$mode: dropout" for (mode, aType, on_gpu) in MODES
@testset ExtendedTestSet "$mode: dropout" for (mode, aType, on_gpu) in MODES
x = randn(rng, Float32, 10, 2) |> aType
x_dual = ForwardDiff.Dual.(x)

Expand Down
2 changes: 1 addition & 1 deletion test/groupnorm_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
return x, scale, bias
end

@testset "$mode" for (mode, aType, on_gpu) in MODES
@testset ExtendedTestSet "$mode" for (mode, aType, on_gpu) in MODES
@testset "eltype $T, size $sz, ngroups $groups, $act" for T in (
Float16, Float32, Float64),
sz in ((4, 6, 2), (8, 8, 8, 6, 2), (3, 16, 16, 12, 2),
Expand Down
2 changes: 1 addition & 1 deletion test/instancenorm_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
return x, scale, bias
end

@testset "$mode" for (mode, aType, on_gpu) in MODES
@testset ExtendedTestSet "$mode" for (mode, aType, on_gpu) in MODES
@testset "eltype $T, size $sz, $act" for T in (Float16, Float32, Float64),
sz in ((4, 4, 6, 2), (3, 4, 2), (4, 4, 4, 3, 2)),
training in (Val(true), Val(false)),
Expand Down
2 changes: 1 addition & 1 deletion test/layernorm_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
end
end

@testset "$mode" for (mode, aType, on_gpu) in MODES
@testset ExtendedTestSet "$mode" for (mode, aType, on_gpu) in MODES
@testset "eltype $T, size $x_shape, $act" for T in (Float16, Float32, Float64),
x_shape in ((3, 3, 2, 1), (2, 2, 2, 1), (2, 3, 2, 2)),
affine_shape in (nothing, x_shape[1:3], (1, 1, 1), (1, 1, x_shape[3])),
Expand Down
2 changes: 1 addition & 1 deletion test/shared_testsetup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Reexport: @reexport

using LuxLib, LuxCUDA, AMDGPU
using LuxDeviceUtils
@reexport using LuxTestUtils, StableRNGs, Test, Zygote
@reexport using LuxTestUtils, StableRNGs, Test, TestSetExtensions, Zygote
import LuxTestUtils: @jet, @test_gradients, check_approx

const BACKEND_GROUP = get(ENV, "BACKEND_GROUP", "All")
Expand Down

0 comments on commit 63642a7

Please sign in to comment.