Skip to content

Commit

Permalink
ci: combine workflows (#1023)
Browse files Browse the repository at this point in the history
* ci: remove certain workflows

* ci: reduce test groups

* test: disable some LuxLib enzyme tests

* test: reduce lux groups

* ci: try fixing more tests

* ci: run 1.11 tests

* ci: minor tweaks

* ci: don't run reactant tests in parallel

* fix: update to latest Reactant changes

* test: skip some Enzyme tests

* chore: run formatter
  • Loading branch information
avik-pal authored Nov 5, 2024
1 parent dc2885f commit bf1f12b
Show file tree
Hide file tree
Showing 49 changed files with 355 additions and 324 deletions.
4 changes: 2 additions & 2 deletions .buildkite/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ steps:
env:
BACKEND_GROUP: "CUDA"
if: build.message !~ /\[skip tests\]/ && build.message !~ /\[skip ci\]/
timeout_in_minutes: 60
timeout_in_minutes: 120
matrix:
setup:
julia:
Expand Down Expand Up @@ -101,7 +101,7 @@ steps:
rocm: "*"
rocmgpu: "*"
if: build.message !~ /\[skip tests\]/ && build.message !~ /\[skip ci\]/
timeout_in_minutes: 60
timeout_in_minutes: 120
matrix:
setup:
julia:
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,23 @@ jobs:
matrix:
version:
- "1.10"
- "1"
os:
- ubuntu-latest
- macos-latest
- windows-latest
test_group:
- "core_layers"
- "contrib"
- "helpers"
- "distributed"
- "normalize_layers"
- "others"
- "autodiff"
- "recurrent_layers"
- "eltype_match"
- "fluxcompat"
- "autodiff"
- "misc"
- "reactant"
include:
- version: "1.10"
os: "macos-latest"
test_group: "all"
- version: "1.10"
os: "windows-latest"
test_group: "all"
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
Expand Down
35 changes: 26 additions & 9 deletions .github/workflows/CIPreRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,10 @@ jobs:
- ubuntu-latest
test_group:
- "core_layers"
- "contrib"
- "helpers"
- "distributed"
- "normalize_layers"
- "others"
- "autodiff"
- "recurrent_layers"
- "eltype_match"
- "fluxcompat"
- "autodiff"
- "misc"
- "reactant"
steps:
- uses: actions/checkout@v4
Expand All @@ -62,8 +57,30 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- name: "Install Dependencies"
run: |
import Pkg
dev_pkgs = Pkg.PackageSpec[]
for pkg in ("lib/LuxCore", "lib/MLDataDevices", "lib/WeightInitializers", "lib/LuxLib",)
push!(dev_pkgs, Pkg.PackageSpec(path=pkg))
end
Pkg.develop(dev_pkgs)
Pkg.Registry.update()
Pkg.instantiate()
Pkg.activate("test")
dev_pkgs = Pkg.PackageSpec[]
for pkg in ("lib/LuxTestUtils", "lib/LuxLib", "lib/MLDataDevices", "lib/LuxCore", ".")
push!(dev_pkgs, Pkg.PackageSpec(path=pkg))
end
Pkg.develop(dev_pkgs)
Pkg.instantiate()
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0}
- name: "Run Tests"
run: |
import Pkg, Lux
dir = dirname(pathof(Lux))
include(joinpath(dir, "../test/runtests.jl"))
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=test {0}
env:
LUX_TEST_GROUP: ${{ matrix.test_group }}
BACKEND_GROUP: "CPU"
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/CI_LuxCore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:
- "1"
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
Expand All @@ -53,7 +51,7 @@ jobs:
Pkg.instantiate()
Pkg.activate("lib/LuxCore/test")
dev_pkgs = Pkg.PackageSpec[]
for pkg in ("lib/LuxCore",)
for pkg in ("lib/LuxCore", "lib/MLDataDevices")
push!(dev_pkgs, Pkg.PackageSpec(path=pkg))
end
Pkg.develop(dev_pkgs)
Expand Down Expand Up @@ -94,7 +92,7 @@ jobs:
Pkg.instantiate()
Pkg.activate("lib/LuxCore/test")
dev_pkgs = Pkg.PackageSpec[]
for pkg in ("lib/LuxCore",)
for pkg in ("lib/LuxCore", "lib/MLDataDevices")
push!(dev_pkgs, Pkg.PackageSpec(path=pkg))
end
Pkg.develop(dev_pkgs)
Expand Down
74 changes: 25 additions & 49 deletions .github/workflows/CI_LuxLib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,62 +28,53 @@ jobs:
matrix:
version:
- "1.10"
- "1"
os:
- ubuntu-latest
test_group:
- "conv"
- "dense"
- "batch_norm"
- "group_norm"
- "instance_norm"
- "layer_norm"
- "other_ops"
- "batched_ops"
- "others"
- "normalization"
- "misc"
blas_backend:
- "default"
loopvec:
- "true"
include:
- os: ubuntu-latest
- version: "1.10"
os: ubuntu-latest
test_group: "dense"
blas_backend: "blis"
version: "1.10"
loopvec: "true"
- os: ubuntu-latest
- version: "1.10"
os: ubuntu-latest
test_group: "dense"
blas_backend: "mkl"
version: "1.10"
loopvec: "true"
- os: ubuntu-latest
- version: "1.10"
os: macos-latest
test_group: "dense"
blas_backend: "appleaccelerate"
loopvec: "true"
- version: "1.10"
os: ubuntu-latest
test_group: "dense"
blas_backend: "default"
version: "1.10"
loopvec: "false"
- os: ubuntu-latest
test_group: "batched_ops"
blas_backend: "default"
version: "1.10"
loopvec: "false"
- os: ubuntu-latest
test_group: "other_ops"
- version: "1.10"
os: ubuntu-latest
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
- version: "1.10"
os: macos-latest
test_group: "all"
blas_backend: "default"
version: "1.10"
loopvec: "true"
- os: windows-latest
- version: "1.10"
os: windows-latest
test_group: "all"
blas_backend: "default"
version: "1.10"
loopvec: "true"
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -112,7 +103,7 @@ jobs:
Pkg.instantiate()
Pkg.activate("lib/LuxLib/test")
dev_pkgs = Pkg.PackageSpec[]
for pkg in ("lib/LuxTestUtils", "lib/LuxLib")
for pkg in ("lib/LuxTestUtils", "lib/LuxLib", "lib/MLDataDevices")
push!(dev_pkgs, Pkg.PackageSpec(path=pkg))
end
Pkg.develop(dev_pkgs)
Expand Down Expand Up @@ -142,21 +133,6 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test_group:
- "conv"
- "dense"
- "batch_norm"
- "group_norm"
- "instance_norm"
- "layer_norm"
- "other_ops"
- "batched_ops"
- "others"
blas_backend:
- "default"
loopvec:
- "true"
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
Expand Down Expand Up @@ -189,9 +165,9 @@ jobs:
include(joinpath(dir, "../test/runtests.jl"))
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=lib/LuxLib/test {0}
env:
LUXLIB_TEST_GROUP: ${{ matrix.test_group }}
LUXLIB_BLAS_BACKEND: ${{ matrix.blas_backend }}
LUXLIB_LOAD_LOOPVEC: ${{ matrix.loopvec }}
LUXLIB_TEST_GROUP: "all"
LUXLIB_BLAS_BACKEND: "default"
LUXLIB_LOAD_LOOPVEC: "true"
- uses: julia-actions/julia-processcoverage@v1
with:
directories: lib/LuxLib/src,lib/LuxLib/ext,lib/LuxCore/src,lib/LuxCore/ext,lib/MLDataDevices/src,lib/MLDataDevices/ext,lib/LuxTestUtils/src
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/CI_LuxTestUtils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jobs:
- "1"
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/CI_WeightInitializers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jobs:
- "1"
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
Expand Down
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ Compat = "4.15"
ComponentArrays = "0.15.16"
ConcreteStructs = "0.2.3"
DispatchDoctor = "0.4.12"
Enzyme = "0.13.1"
EnzymeCore = "0.8.1"
Enzyme = "0.13.13"
EnzymeCore = "0.8.5"
FastClosures = "0.3.2"
Flux = "0.14.20"
Flux = "0.14.25"
ForwardDiff = "0.10.36"
FunctionWrappers = "1.1.3"
Functors = "0.4.12"
Expand Down
4 changes: 2 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ChainRulesCore = "1.24"
ComponentArrays = "0.15"
Documenter = "1.4"
DocumenterVitepress = "0.1.3"
Enzyme = "0.13"
Enzyme = "0.13.13"
FiniteDiff = "2.23.1"
ForwardDiff = "0.10.36"
Functors = "0.4.12"
Expand All @@ -48,7 +48,7 @@ Lux = "1"
LuxCUDA = "0.3.2"
LuxCore = "1"
LuxLib = "1.3.4"
LuxTestUtils = "1.2"
LuxTestUtils = "1.4"
MLDataDevices = "1.4"
Optimisers = "0.3.3"
Pkg = "1.10"
Expand Down
18 changes: 10 additions & 8 deletions docs/src/manual/compiling_lux_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ using Lux, Reactant, Enzyme, Random, Zygote
using Functors, Optimisers, Printf
```

!!! tip "Running on alternate accelerators"

`Reactant.set_default_backend("gpu")` sets the default backend to CUDA and
`Reactant.set_default_backend("tpu")` sets the default backend to TPU.

!!! tip "Using the `TrainState` API"

If you are using the [`Training.TrainState`](@ref) API, skip to the
Expand Down Expand Up @@ -149,15 +154,12 @@ function train_model(model, ps, st, dataloader)
train_state = Training.TrainState(model, ps, st, Adam(0.001f0))
for iteration in 1:1000
for (xᵢ, yᵢ) in dataloader
grads, loss, stats, train_state = Training.single_train_step!(
for (i, (xᵢ, yᵢ)) in enumerate(dataloader)
_, loss, _, train_state = Training.single_train_step!(
AutoEnzyme(), MSELoss(), (xᵢ, yᵢ), train_state)
end
if iteration % 100 == 0 || iteration == 1
# We need to do this since scalar outputs are currently expressed as a zero-dim
# array
loss = Array(loss)[]
@printf("Iter: [%4d/%4d]\tLoss: %.8f\n", iteration, 1000, loss)
if (iteration % 100 == 0 || iteration == 1) && i == 1
@printf("Iter: [%4d/%4d]\tLoss: %.8f\n", iteration, 1000, loss)
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/LuxCore/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "LuxCore"
uuid = "bb33d45b-7691-41d6-9220-0943567d0623"
authors = ["Avik Pal <[email protected]> and contributors"]
version = "1.1.0"
version = "1.1.1"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand Down Expand Up @@ -34,11 +34,11 @@ ArrayInterface = "7.9"
ChainRulesCore = "1.24"
Compat = "4.15.0"
DispatchDoctor = "0.4.10"
EnzymeCore = "0.7.7, 0.8"
EnzymeCore = "0.8.5"
Functors = "0.4.12"
MLDataDevices = "1"
Random = "1.10"
Reactant = "0.2.3"
Reactant = "0.2.4"
ReverseDiff = "1.15"
Setfield = "1"
Tracker = "0.2.34"
Expand Down
2 changes: 1 addition & 1 deletion lib/LuxCore/test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Aqua = "0.8.7"
EnzymeCore = "0.7.7"
EnzymeCore = "0.8.5"
ExplicitImports = "1.9.0"
Functors = "0.4.12"
MLDataDevices = "1.0.0"
Expand Down
4 changes: 2 additions & 2 deletions lib/LuxLib/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ ChainRulesCore = "1.24"
Compat = "4.15.0"
CpuId = "0.3"
DispatchDoctor = "0.4.12"
Enzyme = "0.13.1"
EnzymeCore = "0.8.1"
Enzyme = "0.13.13"
EnzymeCore = "0.8.5"
FastClosures = "0.3.2"
ForwardDiff = "0.10.36"
Hwloc = "3.2"
Expand Down
Loading

8 comments on commit bf1f12b

@avik-pal
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register subdir=lib/MLDataDevices

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/118708

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a MLDataDevices-v1.5.0 -m "<description of version>" bf1f12b6e4555afc11119f7ac5bcd68b82f42dd1
git push origin MLDataDevices-v1.5.0

@avik-pal
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register subdir=lib/LuxTestUtils

@avik-pal
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register subdir=lib/LuxLib

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/118711

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a LuxTestUtils-v1.4.0 -m "<description of version>" bf1f12b6e4555afc11119f7ac5bcd68b82f42dd1
git push origin LuxTestUtils-v1.4.0

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/118712

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a LuxLib-v1.3.7 -m "<description of version>" bf1f12b6e4555afc11119f7ac5bcd68b82f42dd1
git push origin LuxLib-v1.3.7

@avik-pal
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/118713

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.2.1 -m "<description of version>" bf1f12b6e4555afc11119f7ac5bcd68b82f42dd1
git push origin v1.2.1

Please sign in to comment.