This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to Distributed Testing using ReTestItems.jl
- Loading branch information
Showing
31 changed files
with
638 additions
and
571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Downgrade | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- 'docs/**' | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- 'docs/**' | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
version: ['1.9'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: ${{ matrix.version }} | ||
- uses: cjdoris/julia-downgrade-compat-action@v1 | ||
with: | ||
skip: Pkg,TOML | ||
- uses: julia-actions/julia-buildpkg@v1 | ||
- uses: julia-actions/julia-runtest@v1 | ||
env: | ||
GROUP: "CPU" | ||
RETESTITEMS_NWORKERS: 4 | ||
RETESTITEMS_NWORKER_THREADS: 2 | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
with: | ||
directories: src,ext | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
files: lcov.info | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true | ||
fail_ci_if_error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "LuxLib" | ||
uuid = "82251201-b29d-42c6-8e01-566dec8acb11" | ||
authors = ["Avik Pal <[email protected]> and contributors"] | ||
version = "0.3.9" | ||
version = "0.3.10" | ||
|
||
[deps] | ||
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" | ||
|
@@ -27,22 +27,43 @@ LuxLibReverseDiffExt = "ReverseDiff" | |
LuxLibTrackerExt = "Tracker" | ||
|
||
[compat] | ||
ChainRulesCore = "1" | ||
Aqua = "0.8" | ||
ChainRulesCore = "1.20" | ||
ComponentArrays = "0.15" | ||
ForwardDiff = "0.10" | ||
KernelAbstractions = "0.9" | ||
LuxCUDA = "0.2, 0.3" | ||
Markdown = "1" | ||
NNlib = "0.8, 0.9" | ||
PrecompileTools = "1" | ||
Random = "1" | ||
KernelAbstractions = "0.9.2" | ||
LuxAMDGPU = "0.2" | ||
LuxCUDA = "0.3" | ||
LuxTestUtils = "0.1.15" | ||
Markdown = "1.9" | ||
NNlib = "0.9" | ||
PrecompileTools = "1.2" | ||
Random = "1.9" | ||
ReTestItems = "1" | ||
Reexport = "1" | ||
ReverseDiff = "1" | ||
Statistics = "1" | ||
StableRNGs = "1" | ||
Statistics = "1.9" | ||
Test = "1.9" | ||
Tracker = "0.2" | ||
Zygote = "0.6" | ||
julia = "1.9" | ||
|
||
[extras] | ||
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" | ||
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" | ||
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66" | ||
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" | ||
LuxAMDGPU = "83120cb1-ca15-4f04-bf3b-6967d2e6b60b" | ||
LuxCUDA = "d0bbae9a-e099-4d5b-a835-1c6931763bda" | ||
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" | ||
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" | ||
LuxTestUtils = "ac9de150-d08f-4546-94fb-7472b5760531" | ||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823" | ||
Reexport = "189a3867-3050-52da-a836-e630ba90ab69" | ||
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" | ||
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" | ||
|
||
[targets] | ||
test = ["Aqua", "ChainRulesCore", "ComponentArrays", "ForwardDiff", "LuxAMDGPU", "LuxCUDA", "LuxTestUtils", "Random", "ReTestItems", "Reexport", "StableRNGs", "Statistics", "Test", "Zygote"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
@testitem "Batch Normalization" setup=[SharedTestSetup] begin | ||
rng = get_stable_rng(12345) | ||
|
||
function _setup_batchnorm(aType, T, sz; affine::Bool=true, track_stats::Bool) | ||
x = randn(T, sz) |> aType | ||
scale = affine ? aType(randn(T, sz[end - 1])) : nothing | ||
bias = affine ? aType(randn(T, sz[end - 1])) : nothing | ||
|
||
if track_stats | ||
running_mean = randn(T, sz[end - 1]) |> aType | ||
running_var = abs2.(randn(T, sz[end - 1])) |> aType | ||
return x, scale, bias, running_mean, running_var | ||
else | ||
return x, scale, bias, nothing, nothing | ||
end | ||
end | ||
|
||
@testset "$mode" for (mode, aType, on_gpu) in MODES | ||
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)), | ||
affine in (true, false), | ||
track_stats in (true, false) | ||
|
||
T === Float16 && mode == "AMDGPU" && continue | ||
|
||
_f = (args...) -> batchnorm(args...; epsilon, training, momentum=T(0.9)) | ||
|
||
epsilon = T(1e-5) | ||
x, scale, bias, rm, rv = _setup_batchnorm(aType, T, sz; track_stats, affine) | ||
|
||
y, nt = batchnorm(x, scale, bias, rm, rv; epsilon, training, momentum=T(0.9)) | ||
|
||
@inferred batchnorm(x, scale, bias, rm, rv; epsilon, training, momentum=T(0.9)) | ||
|
||
@jet _f(x, scale, bias, rm, rv) | ||
|
||
@test y isa aType{T, length(sz)} | ||
@test size(y) == sz | ||
|
||
if rm !== nothing | ||
@test size(nt.running_mean) == (size(x, length(sz) - 1),) | ||
@test size(nt.running_var) == (size(x, length(sz) - 1),) | ||
end | ||
|
||
if __istraining(training) && affine | ||
fp16 = T == Float16 | ||
__f = (args...) -> sum(first(batchnorm(x, args..., rm, rv; epsilon, | ||
training, momentum=T(0.9)))) | ||
@eval @test_gradients $__f $scale $bias gpu_testing=$on_gpu soft_fail=$fp16 atol=1.0f-2 rtol=1.0f-2 | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.