diff --git a/.github/workflows/CI_LuxLib.yml b/.github/workflows/CI_LuxLib.yml index 2ba26a789c..8626c2899b 100644 --- a/.github/workflows/CI_LuxLib.yml +++ b/.github/workflows/CI_LuxLib.yml @@ -33,13 +33,8 @@ jobs: test_group: - "conv" - "dense" - - "batch_norm" - - "group_norm" - - "instance_norm" - - "layer_norm" - - "other_ops" - - "batched_ops" - - "others" + - "normalization" + - "misc" blas_backend: - "default" loopvec: @@ -55,26 +50,21 @@ jobs: blas_backend: "mkl" version: "1.10" loopvec: "true" - - os: ubuntu-latest + - os: macos-latest test_group: "dense" - blas_backend: "default" + blas_backend: "appleaccelerate" version: "1.10" - loopvec: "false" + loopvec: "true" - os: ubuntu-latest - test_group: "batched_ops" + test_group: "dense" blas_backend: "default" version: "1.10" loopvec: "false" - os: ubuntu-latest - test_group: "other_ops" + test_group: "misc" blas_backend: "default" version: "1.10" loopvec: "false" - - os: macos-latest - test_group: "dense" - blas_backend: "appleaccelerate" - version: "1.10" - loopvec: "true" - os: macos-latest test_group: "all" blas_backend: "default" @@ -146,13 +136,8 @@ jobs: test_group: - "conv" - "dense" - - "batch_norm" - - "group_norm" - - "instance_norm" - - "layer_norm" - - "other_ops" - - "batched_ops" - - "others" + - "normalization" + - "misc" blas_backend: - "default" loopvec: diff --git a/lib/LuxLib/test/common_ops/activation_tests.jl b/lib/LuxLib/test/common_ops/activation_tests.jl index e2b80e7112..7575a765e2 100644 --- a/lib/LuxLib/test/common_ops/activation_tests.jl +++ b/lib/LuxLib/test/common_ops/activation_tests.jl @@ -1,4 +1,4 @@ -@testitem "Activation Functions" tags=[:other_ops] setup=[SharedTestSetup] begin +@testitem "Activation Functions" tags=[:misc] setup=[SharedTestSetup] begin rng = StableRNG(1234) apply_act(f::F, x) where {F} = sum(abs2, f.(x)) diff --git a/lib/LuxLib/test/common_ops/bias_act_tests.jl b/lib/LuxLib/test/common_ops/bias_act_tests.jl index 3b2f22d0c9..62dd8d04f9 100644 --- a/lib/LuxLib/test/common_ops/bias_act_tests.jl +++ b/lib/LuxLib/test/common_ops/bias_act_tests.jl @@ -1,4 +1,4 @@ -@testitem "Bias Activation" tags=[:other_ops] setup=[SharedTestSetup] begin +@testitem "Bias Activation" tags=[:misc] setup=[SharedTestSetup] begin rng = StableRNG(1234) bias_act_loss1(act, x, b) = sum(abs2, act.(x .+ LuxLib.Impl.reshape_bias(x, b))) @@ -68,7 +68,7 @@ end end -@testitem "Bias Activation (ReverseDiff)" tags=[:other_ops] setup=[SharedTestSetup] begin +@testitem "Bias Activation (ReverseDiff)" tags=[:misc] setup=[SharedTestSetup] begin using ReverseDiff, Tracker x = rand(Float32, 3, 4) @@ -88,7 +88,7 @@ end @test z isa Tracker.TrackedArray end -@testitem "Bias Activation: Zero-sized Arrays" tags=[:other_ops] setup=[SharedTestSetup] begin +@testitem "Bias Activation: Zero-sized Arrays" tags=[:misc] setup=[SharedTestSetup] begin @testset "$mode" for (mode, aType, ongpu) in MODES x = rand(Float32, 4, 3, 2, 0) |> aType b = rand(Float32, 2) |> aType diff --git a/lib/LuxLib/test/common_ops/dropout_tests.jl b/lib/LuxLib/test/common_ops/dropout_tests.jl index 45f8fd0179..f9dee4aef7 100644 --- a/lib/LuxLib/test/common_ops/dropout_tests.jl +++ b/lib/LuxLib/test/common_ops/dropout_tests.jl @@ -1,4 +1,4 @@ -@testitem "Dropout" tags=[:other_ops] setup=[SharedTestSetup] begin +@testitem "Dropout" tags=[:misc] setup=[SharedTestSetup] begin rng = StableRNG(12345) @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @@ -43,7 +43,7 @@ end end -@testitem "Dropout with Preset Mask" tags=[:other_ops] setup=[SharedTestSetup] begin +@testitem "Dropout with Preset Mask" tags=[:misc] setup=[SharedTestSetup] begin using Statistics rng = StableRNG(12345) @@ -132,7 +132,7 @@ end end end -@testitem "Alpha Dropout" tags=[:other_ops] setup=[SharedTestSetup] begin +@testitem "Alpha Dropout" tags=[:misc] setup=[SharedTestSetup] begin using Statistics rng = StableRNG(12345) diff --git a/lib/LuxLib/test/normalization/batchnorm_tests.jl b/lib/LuxLib/test/normalization/batchnorm_tests.jl index 3936200a8d..48ce127943 100644 --- a/lib/LuxLib/test/normalization/batchnorm_tests.jl +++ b/lib/LuxLib/test/normalization/batchnorm_tests.jl @@ -122,7 +122,8 @@ export setup_batchnorm, ALL_TEST_CONFIGS, TEST_BLOCKS, run_batchnorm_testing end -@testitem "Batch Norm: Group 1" tags=[:batch_norm] setup=[SharedTestSetup, BatchNormSetup] begin +@testitem "Batch Norm: Group 1" tags=[:normalization] setup=[ + SharedTestSetup, BatchNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $act $affine $track_stats" for (T, sz, training, affine, track_stats, act) in TEST_BLOCKS[1] !fp64 && T == Float64 && continue @@ -132,7 +133,8 @@ end end end -@testitem "Batch Norm: Group 2" tags=[:batch_norm] setup=[SharedTestSetup, BatchNormSetup] begin +@testitem "Batch Norm: Group 2" tags=[:normalization] setup=[ + SharedTestSetup, BatchNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $act $affine $track_stats" for (T, sz, training, affine, track_stats, act) in TEST_BLOCKS[2] !fp64 && T == Float64 && continue @@ -142,7 +144,8 @@ end end end -@testitem "Batch Norm: Group 3" tags=[:batch_norm] setup=[SharedTestSetup, BatchNormSetup] begin +@testitem "Batch Norm: Group 3" tags=[:normalization] setup=[ + SharedTestSetup, BatchNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $act $affine $track_stats" for (T, sz, training, affine, track_stats, act) in TEST_BLOCKS[3] !fp64 && T == Float64 && continue @@ -152,7 +155,8 @@ end end end -@testitem "Batch Norm: Group 4" tags=[:batch_norm] setup=[SharedTestSetup, BatchNormSetup] begin +@testitem "Batch Norm: Group 4" tags=[:normalization] setup=[ + SharedTestSetup, BatchNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $act $affine $track_stats" for (T, sz, training, affine, track_stats, act) in TEST_BLOCKS[4] !fp64 && T == Float64 && continue @@ -162,7 +166,8 @@ end end end -@testitem "Batch Norm: Group 5" tags=[:batch_norm] setup=[SharedTestSetup, BatchNormSetup] begin +@testitem "Batch Norm: Group 5" tags=[:normalization] setup=[ + SharedTestSetup, BatchNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $act $affine $track_stats" for (T, sz, training, affine, track_stats, act) in TEST_BLOCKS[5] !fp64 && T == Float64 && continue @@ -172,7 +177,7 @@ end end end -@testitem "Batch Norm: Mixed Precision" tags=[:batch_norm] setup=[SharedTestSetup] begin +@testitem "Batch Norm: Mixed Precision" tags=[:normalization] setup=[SharedTestSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES !fp64 && aType == Float64 && continue diff --git a/lib/LuxLib/test/normalization/groupnorm_tests.jl b/lib/LuxLib/test/normalization/groupnorm_tests.jl index 3c638885c7..b0a31ba81a 100644 --- a/lib/LuxLib/test/normalization/groupnorm_tests.jl +++ b/lib/LuxLib/test/normalization/groupnorm_tests.jl @@ -92,7 +92,8 @@ export setup_groupnorm, ALL_TEST_CONFIGS, TEST_BLOCKS, run_groupnorm_testing end -@testitem "Group Norm: Group 1" tags=[:group_norm] setup=[SharedTestSetup, GroupNormSetup] begin +@testitem "Group Norm: Group 1" tags=[:normalization] setup=[ + SharedTestSetup, GroupNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $groups, $affine, $act" for (T, sz, groups, affine, act) in TEST_BLOCKS[1] !fp64 && T == Float64 && continue @@ -101,7 +102,8 @@ end end end -@testitem "Group Norm: Group 2" tags=[:group_norm] setup=[SharedTestSetup, GroupNormSetup] begin +@testitem "Group Norm: Group 2" tags=[:normalization] setup=[ + SharedTestSetup, GroupNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $groups, $affine, $act" for (T, sz, groups, affine, act) in TEST_BLOCKS[2] !fp64 && T == Float64 && continue @@ -110,7 +112,8 @@ end end end -@testitem "Group Norm: Group 3" tags=[:group_norm] setup=[SharedTestSetup, GroupNormSetup] begin +@testitem "Group Norm: Group 3" tags=[:normalization] setup=[ + SharedTestSetup, GroupNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $groups, $affine, $act" for (T, sz, groups, affine, act) in TEST_BLOCKS[3] !fp64 && T == Float64 && continue @@ -119,7 +122,8 @@ end end end -@testitem "Group Norm: Group 4" tags=[:group_norm] setup=[SharedTestSetup, GroupNormSetup] begin +@testitem "Group Norm: Group 4" tags=[:normalization] setup=[ + SharedTestSetup, GroupNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $groups, $affine, $act" for (T, sz, groups, affine, act) in TEST_BLOCKS[4] !fp64 && T == Float64 && continue @@ -128,7 +132,8 @@ end end end -@testitem "Group Norm: Group 5" tags=[:group_norm] setup=[SharedTestSetup, GroupNormSetup] begin +@testitem "Group Norm: Group 5" tags=[:normalization] setup=[ + SharedTestSetup, GroupNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $groups, $affine, $act" for (T, sz, groups, affine, act) in TEST_BLOCKS[5] !fp64 && T == Float64 && continue diff --git a/lib/LuxLib/test/normalization/instancenorm_tests.jl b/lib/LuxLib/test/normalization/instancenorm_tests.jl index ff166cfa5f..0bc3155caf 100644 --- a/lib/LuxLib/test/normalization/instancenorm_tests.jl +++ b/lib/LuxLib/test/normalization/instancenorm_tests.jl @@ -82,7 +82,7 @@ export setup_instancenorm, ALL_TEST_CONFIGS, TEST_BLOCKS, run_instancenorm_testi end -@testitem "Instance Norm: Group 1" tags=[:instance_norm] setup=[ +@testitem "Instance Norm: Group 1" tags=[:normalization] setup=[ SharedTestSetup, InstanceNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $training $act" for (T, sz, training, act) in TEST_BLOCKS[1] @@ -93,7 +93,7 @@ end end end -@testitem "Instance Norm: Group 2" tags=[:instance_norm] setup=[ +@testitem "Instance Norm: Group 2" tags=[:normalization] setup=[ SharedTestSetup, InstanceNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $training $act" for (T, sz, training, act) in TEST_BLOCKS[2] @@ -104,7 +104,7 @@ end end end -@testitem "Instance Norm: Group 3" tags=[:instance_norm] setup=[ +@testitem "Instance Norm: Group 3" tags=[:normalization] setup=[ SharedTestSetup, InstanceNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $training $act" for (T, sz, training, act) in TEST_BLOCKS[3] @@ -115,7 +115,7 @@ end end end -@testitem "Instance Norm: Group 4" tags=[:instance_norm] setup=[ +@testitem "Instance Norm: Group 4" tags=[:normalization] setup=[ SharedTestSetup, InstanceNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $training $act" for (T, sz, training, act) in TEST_BLOCKS[4] @@ -126,7 +126,7 @@ end end end -@testitem "Instance Norm: Group 5" tags=[:instance_norm] setup=[ +@testitem "Instance Norm: Group 5" tags=[:normalization] setup=[ SharedTestSetup, InstanceNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $sz, $training $act" for (T, sz, training, act) in TEST_BLOCKS[5] diff --git a/lib/LuxLib/test/normalization/layernorm_tests.jl b/lib/LuxLib/test/normalization/layernorm_tests.jl index 37ca3c7027..09b671b111 100644 --- a/lib/LuxLib/test/normalization/layernorm_tests.jl +++ b/lib/LuxLib/test/normalization/layernorm_tests.jl @@ -89,7 +89,8 @@ export ALL_TEST_CONFIGS, TEST_BLOCKS, run_layernorm_testing end -@testitem "Layer Norm: Group 1" tags=[:layer_norm] setup=[SharedTestSetup, LayerNormSetup] begin +@testitem "Layer Norm: Group 1" tags=[:normalization] setup=[ + SharedTestSetup, LayerNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $x_shape, $act" for (T, x_shape, affine_shape, act) in TEST_BLOCKS[1] !fp64 && T == Float64 && continue @@ -99,7 +100,8 @@ end end end -@testitem "Layer Norm: Group 2" tags=[:layer_norm] setup=[SharedTestSetup, LayerNormSetup] begin +@testitem "Layer Norm: Group 2" tags=[:normalization] setup=[ + SharedTestSetup, LayerNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $x_shape, $act" for (T, x_shape, affine_shape, act) in TEST_BLOCKS[2] !fp64 && T == Float64 && continue @@ -109,7 +111,8 @@ end end end -@testitem "Layer Norm: Group 3" tags=[:layer_norm] setup=[SharedTestSetup, LayerNormSetup] begin +@testitem "Layer Norm: Group 3" tags=[:normalization] setup=[ + SharedTestSetup, LayerNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $x_shape, $act" for (T, x_shape, affine_shape, act) in TEST_BLOCKS[3] !fp64 && T == Float64 && continue @@ -119,7 +122,8 @@ end end end -@testitem "Layer Norm: Group 4" tags=[:layer_norm] setup=[SharedTestSetup, LayerNormSetup] begin +@testitem "Layer Norm: Group 4" tags=[:normalization] setup=[ + SharedTestSetup, LayerNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $x_shape, $act" for (T, x_shape, affine_shape, act) in TEST_BLOCKS[4] !fp64 && T == Float64 && continue @@ -129,7 +133,8 @@ end end end -@testitem "Layer Norm: Group 5" tags=[:layer_norm] setup=[SharedTestSetup, LayerNormSetup] begin +@testitem "Layer Norm: Group 5" tags=[:normalization] setup=[ + SharedTestSetup, LayerNormSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @testset "eltype $T, size $x_shape, $act" for (T, x_shape, affine_shape, act) in TEST_BLOCKS[5] !fp64 && T == Float64 && continue @@ -139,7 +144,7 @@ end end end -@testitem "Layer Norm: Error Checks" tags=[:layer_norm] setup=[SharedTestSetup] begin +@testitem "Layer Norm: Error Checks" tags=[:normalization] setup=[SharedTestSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES !fp64 && continue diff --git a/lib/LuxLib/test/others/bmm_tests.jl b/lib/LuxLib/test/others/bmm_tests.jl index 2b89b0ef24..0ca81a5f91 100644 --- a/lib/LuxLib/test/others/bmm_tests.jl +++ b/lib/LuxLib/test/others/bmm_tests.jl @@ -11,7 +11,6 @@ function bmm_test(a, b; transA=false, transB=false) for i in 1:bs push!(c, a[:, :, i] * b[:, :, i]) end - return cat(c...; dims=3) end @@ -23,7 +22,6 @@ function bmm_adjtest(a, b; adjA=false, adjB=false) bi = adjB ? adjoint(b[:, :, i]) : b[:, :, i] push!(c, ai * bi) end - return cat(c...; dims=3) end @@ -43,7 +41,7 @@ export bmm_test, bmm_adjtest, half_batched_mul, perm_12, perm_23 end -@testitem "batched_mul" tags=[:batched_ops] setup=[SharedTestSetup, BatchedMMSetup] begin +@testitem "batched_mul" tags=[:misc] setup=[SharedTestSetup, BatchedMMSetup] begin rng = StableRNG(1234) @testset "$mode" for (mode, aType, ongpu, fp64) in MODES @@ -129,7 +127,7 @@ end end end -@testitem "batched_mul: trivial dimensions & unit strides" tags=[:batched_ops] setup=[ +@testitem "batched_mul: trivial dimensions & unit strides" tags=[:misc] setup=[ SharedTestSetup, BatchedMMSetup] begin rng = StableRNG(1234) @@ -161,7 +159,7 @@ end end end -@testitem "BatchedAdjOrTrans interface" tags=[:batched_ops] setup=[ +@testitem "BatchedAdjOrTrans interface" tags=[:misc] setup=[ SharedTestSetup, BatchedMMSetup] begin rng = StableRNG(1234) @@ -228,7 +226,7 @@ end end end -@testitem "batched_matmul(ndims < 3)" tags=[:batched_ops] setup=[ +@testitem "batched_matmul(ndims < 3)" tags=[:misc] setup=[ SharedTestSetup, BatchedMMSetup] begin rng = StableRNG(1234) @@ -259,7 +257,7 @@ end end end -@testitem "BMM AutoDiff" tags=[:batched_ops] setup=[SharedTestSetup, BatchedMMSetup] begin +@testitem "BMM AutoDiff" tags=[:misc] setup=[SharedTestSetup, BatchedMMSetup] begin rng = StableRNG(1234) fn(A, B) = sum(batched_matmul(A, B)) @@ -307,7 +305,7 @@ end end end -@testitem "BMM Tracker AoS" tags=[:batched_ops] setup=[SharedTestSetup, BatchedMMSetup] begin +@testitem "BMM Tracker AoS" tags=[:misc] setup=[SharedTestSetup, BatchedMMSetup] begin using Tracker, Zygote, NNlib rng = StableRNG(1234) diff --git a/lib/LuxLib/test/others/forwarddiff_tests.jl b/lib/LuxLib/test/others/forwarddiff_tests.jl index 228aa7d385..eed0b1bb3b 100644 --- a/lib/LuxLib/test/others/forwarddiff_tests.jl +++ b/lib/LuxLib/test/others/forwarddiff_tests.jl @@ -1,4 +1,4 @@ -@testitem "Efficient JVPs" tags=[:others] setup=[SharedTestSetup] begin +@testitem "Efficient JVPs" tags=[:misc] setup=[SharedTestSetup] begin using ForwardDiff, Zygote, ComponentArrays using LuxTestUtils: check_approx @@ -92,7 +92,7 @@ end end -@testitem "ForwardDiff dropout" tags=[:other_ops] setup=[SharedTestSetup] begin +@testitem "ForwardDiff dropout" tags=[:misc] setup=[SharedTestSetup] begin using ForwardDiff using LuxTestUtils: check_approx diff --git a/lib/LuxLib/test/others/misc_tests.jl b/lib/LuxLib/test/others/misc_tests.jl index 6e046eea2c..48edb79f37 100644 --- a/lib/LuxLib/test/others/misc_tests.jl +++ b/lib/LuxLib/test/others/misc_tests.jl @@ -1,4 +1,4 @@ -@testitem "internal_operation_mode: Wrapped Arrays" tags=[:others] setup=[SharedTestSetup] begin +@testitem "internal_operation_mode: Wrapped Arrays" tags=[:misc] setup=[SharedTestSetup] begin @testset "$mode" for (mode, aType, ongpu, fp64) in MODES x = rand(Float32, 4, 3) |> aType retval = ongpu ? LuxLib.GPUBroadcastOp : LuxLib.LoopedArrayOp @@ -17,7 +17,7 @@ @test LuxLib.internal_operation_mode(x) isa LuxLib.GenericBroadcastOp end -@testitem "Matmul: StaticArrays" tags=[:others] setup=[SharedTestSetup] begin +@testitem "Matmul: StaticArrays" tags=[:misc] setup=[SharedTestSetup] begin using LuxLib.Impl: matmuladd using StaticArrays diff --git a/lib/LuxLib/test/others/qa_tests.jl b/lib/LuxLib/test/others/qa_tests.jl index ed7e9f980c..38cc6a6243 100644 --- a/lib/LuxLib/test/others/qa_tests.jl +++ b/lib/LuxLib/test/others/qa_tests.jl @@ -1,4 +1,4 @@ -@testitem "Aqua: Quality Assurance" tags=[:others] begin +@testitem "Aqua: Quality Assurance" tags=[:misc] begin using Aqua, ChainRulesCore, EnzymeCore, NNlib using EnzymeCore: EnzymeRules @@ -11,7 +11,7 @@ EnzymeRules.augmented_primal, EnzymeRules.reverse]) end -@testitem "Explicit Imports" tags=[:others] setup=[SharedTestSetup] begin +@testitem "Explicit Imports" tags=[:misc] setup=[SharedTestSetup] begin using ExplicitImports @test check_no_implicit_imports(LuxLib) === nothing