Skip to content

Commit b00c6c6

Browse files
committed
Mark tests broken on 1.6 + CUDA
1 parent 13b0d24 commit b00c6c6

File tree

4 files changed

+33
-9
lines changed

4 files changed

+33
-9
lines changed

test/convnet_tests.jl

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ end
4949
(dropout_prob = 0.8, stochastic_depth_prob = 0.8, dropblock_prob = 0.8),
5050
]
5151
@testset for drop_probs in drop_list
52-
m = Metalhead.resnet(block_fn, layers; drop_probs...)
52+
m = Metalhead.resnet(block_fn, layers; drop_probs...) |> gpu
5353
@test size(m(x_224)) == (1000, 1)
5454
@test gradtest(m, x_224)
5555
_gc()
@@ -132,9 +132,14 @@ end
132132
m = Res2Net(50; base_width, scale) |> gpu
133133
@test size(m(x_224)) == (1000, 1)
134134
if (Res2Net, 50, base_width, scale) in PRETRAINED_MODELS
135-
@test acctest(Res2Net(50; base_width, scale, pretrain = true))
135+
if VERSION < v"1.7" && has_cuda()
136+
@test_broken acctest(Res2Net(50; base_width, scale, pretrain = true))
137+
else
138+
@test acctest(Res2Net(50; base_width, scale, pretrain = true))
139+
end
136140
else
137-
@test_throws ArgumentError Res2Net(50; base_width, scale, pretrain = true)
141+
err_type = VERSION < v"1.7" && has_cuda() ? Exception : ArgumentError
142+
@test_throws err_type Res2Net(50; base_width, scale, pretrain = true)
138143
end
139144
@test gradtest(m, x_224)
140145
_gc()
@@ -158,13 +163,21 @@ end
158163
@testitem "Res2NeXt" setup=[TestModels] begin
159164
@testset for depth in [50, 101]
160165
m = Res2NeXt(depth) |> gpu
161-
@test size(m(x_224)) == (1000, 1)
166+
if VERSION < v"1.7" && has_cuda()
167+
@test_broken size(m(x_224)) == (1000, 1)
168+
else
169+
@test size(m(x_224)) == (1000, 1)
170+
end
162171
if (Res2NeXt, depth) in PRETRAINED_MODELS
163172
@test acctest(Res2NeXt(depth; pretrain = true))
164173
else
165174
@test_throws ArgumentError Res2NeXt(depth, pretrain = true)
166175
end
167-
@test gradtest(m, x_224)
176+
if VERSION < v"1.7" && has_cuda()
177+
@test_broken gradtest(m, x_224)
178+
else
179+
@test gradtest(m, x_224)
180+
end
168181
_gc()
169182
end
170183
end

test/mixer_tests.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ end
2222
configs = TEST_FAST ? [:small] : [:small, :base, :large]
2323
@testset for config in configs
2424
m = gMLP(config) |> gpu
25-
@test size(m(x_224)) == (1000, 1)
26-
@test gradtest(m, x_224)
25+
if VERSION < v"1.7" && has_cuda()
26+
@test_broken size(m(x_224)) == (1000, 1)
27+
@test_broken gradtest(m, x_224)
28+
else
29+
@test size(m(x_224)) == (1000, 1)
30+
@test gradtest(m, x_224)
31+
end
2732
_gc()
2833
end
2934
end

test/model_tests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@testsetup module TestModels
22
using Metalhead, Images, TestImages
33
using Flux: gradient, gpu
4+
using CUDA: has_cudaj
45

56
export PRETRAINED_MODELS,
67
TEST_FAST,
@@ -14,7 +15,8 @@ export PRETRAINED_MODELS,
1415
acctest,
1516
x_224,
1617
x_256,
17-
gpu
18+
gpu,
19+
has_cuda
1820

1921
const PRETRAINED_MODELS = [
2022
# (DenseNet, 121),

test/vit_tests.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
@testset for config in configs
44
m = ViT(config) |> gpu
55
@test size(m(x_224)) == (1000, 1)
6-
@test gradtest(m, x_224)
6+
if VERSION < v"1.7" && has_cuda()
7+
@test_broken gradtest(m, x_224)
8+
else
9+
@test gradtest(m, x_224)
10+
end
711
_gc()
812
end
913
end

0 commit comments

Comments
 (0)