|
1 | 1 | using LuxLib, Reactant, Enzyme, NNlib, Test |
2 | 2 |
|
| 3 | +const MightUseMIOpen = contains(lowercase(string(Reactant.devices()[1])), "rocm") |
| 4 | + |
3 | 5 | @testset "Fused Dense" begin |
4 | 6 | sumabs2fuseddense(act, weight, x, bias) = |
5 | 7 | sum(abs2, fused_dense_bias_activation(act, weight, x, bias)) |
@@ -182,15 +184,23 @@ end |
182 | 184 | padding in ((0, 0), (2, 2), (2, 0)), |
183 | 185 | dilation in ((1, 1), (1, 2)) |
184 | 186 |
|
| 187 | + if any(!=(1), dilation) && MightUseMIOpen |
| 188 | + continue # MIOpen doesn't support dilation != 1 yet |
| 189 | + end |
| 190 | + |
| 191 | + might_fail = MightUseMIOpen && any(!=(1), dilation) |
| 192 | + |
185 | 193 | conv_dims = DenseConvDims(x, weight; stride, padding, dilation, groups) |
186 | 194 |
|
187 | | - reactant_res = @jit fused_conv_bias_activation( |
188 | | - act, weight_reactant, x_reactant, bias_reactant, conv_dims |
189 | | - ) |
| 195 | + @test begin |
| 196 | + reactant_res = @jit fused_conv_bias_activation( |
| 197 | + act, weight_reactant, x_reactant, bias_reactant, conv_dims |
| 198 | + ) |
190 | 199 |
|
191 | | - luxlib_res = fused_conv_bias_activation(act, weight, x, bias, conv_dims) |
| 200 | + luxlib_res = fused_conv_bias_activation(act, weight, x, bias, conv_dims) |
192 | 201 |
|
193 | | - @test reactant_res ≈ luxlib_res atol = 1e-5 rtol = 1e-2 |
| 202 | + reactant_res ≈ luxlib_res |
| 203 | + end atol = 1e-5 rtol = 1e-2 broken = might_fail |
194 | 204 | end |
195 | 205 |
|
196 | 206 | # TODO: test for gradients |
|
0 commit comments