Skip to content

Commit

Permalink
Mark tests broken on 1.6 + CUDA
Browse files Browse the repository at this point in the history
  • Loading branch information
ToucheSir committed Dec 15, 2023
1 parent 13b0d24 commit b00c6c6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
23 changes: 18 additions & 5 deletions test/convnet_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ end
(dropout_prob = 0.8, stochastic_depth_prob = 0.8, dropblock_prob = 0.8),
]
@testset for drop_probs in drop_list
m = Metalhead.resnet(block_fn, layers; drop_probs...)
m = Metalhead.resnet(block_fn, layers; drop_probs...) |> gpu
@test size(m(x_224)) == (1000, 1)
@test gradtest(m, x_224)
_gc()
Expand Down Expand Up @@ -132,9 +132,14 @@ end
m = Res2Net(50; base_width, scale) |> gpu
@test size(m(x_224)) == (1000, 1)
if (Res2Net, 50, base_width, scale) in PRETRAINED_MODELS
@test acctest(Res2Net(50; base_width, scale, pretrain = true))
if VERSION < v"1.7" && has_cuda()
@test_broken acctest(Res2Net(50; base_width, scale, pretrain = true))
else
@test acctest(Res2Net(50; base_width, scale, pretrain = true))
end
else
@test_throws ArgumentError Res2Net(50; base_width, scale, pretrain = true)
err_type = VERSION < v"1.7" && has_cuda() ? Exception : ArgumentError
@test_throws err_type Res2Net(50; base_width, scale, pretrain = true)
end
@test gradtest(m, x_224)
_gc()
Expand All @@ -158,13 +163,21 @@ end
@testitem "Res2NeXt" setup=[TestModels] begin
@testset for depth in [50, 101]
m = Res2NeXt(depth) |> gpu
@test size(m(x_224)) == (1000, 1)
if VERSION < v"1.7" && has_cuda()
@test_broken size(m(x_224)) == (1000, 1)
else
@test size(m(x_224)) == (1000, 1)
end
if (Res2NeXt, depth) in PRETRAINED_MODELS
@test acctest(Res2NeXt(depth; pretrain = true))
else
@test_throws ArgumentError Res2NeXt(depth, pretrain = true)
end
@test gradtest(m, x_224)
if VERSION < v"1.7" && has_cuda()
@test_broken gradtest(m, x_224)
else
@test gradtest(m, x_224)
end
_gc()
end
end
Expand Down
9 changes: 7 additions & 2 deletions test/mixer_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ end
configs = TEST_FAST ? [:small] : [:small, :base, :large]
@testset for config in configs
m = gMLP(config) |> gpu
@test size(m(x_224)) == (1000, 1)
@test gradtest(m, x_224)
if VERSION < v"1.7" && has_cuda()
@test_broken size(m(x_224)) == (1000, 1)
@test_broken gradtest(m, x_224)
else
@test size(m(x_224)) == (1000, 1)
@test gradtest(m, x_224)
end
_gc()
end
end
4 changes: 3 additions & 1 deletion test/model_tests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@testsetup module TestModels
using Metalhead, Images, TestImages
using Flux: gradient, gpu
using CUDA: has_cudaj

export PRETRAINED_MODELS,
TEST_FAST,
Expand All @@ -14,7 +15,8 @@ export PRETRAINED_MODELS,
acctest,
x_224,
x_256,
gpu
gpu,
has_cuda

const PRETRAINED_MODELS = [
# (DenseNet, 121),
Expand Down
6 changes: 5 additions & 1 deletion test/vit_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
@testset for config in configs
m = ViT(config) |> gpu
@test size(m(x_224)) == (1000, 1)
@test gradtest(m, x_224)
if VERSION < v"1.7" && has_cuda()
@test_broken gradtest(m, x_224)
else
@test gradtest(m, x_224)
end
_gc()
end
end

0 comments on commit b00c6c6

Please sign in to comment.