From dde207c0ac28b50e7fe1c20247274b8893f3350b Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Tue, 5 Nov 2024 12:38:51 -0500 Subject: [PATCH] feat: update to latest package versions (#81) * feat: update to latest package versions * feat: update old compats * test: use runtime activity --- .buildkite/pipeline.yml | 2 +- .github/workflows/CI.yml | 35 +------------------- Project.toml | 12 +++---- docs/Project.toml | 2 +- examples/GettingStarted/Project.toml | 2 +- examples/SymbolicOptimalControl/Project.toml | 8 ++--- test/Project.toml | 6 ++-- test/layer_tests.jl | 14 ++++---- test/runtests.jl | 2 +- test/shared_testsetup.jl | 3 -- 10 files changed, 26 insertions(+), 60 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 2c00e63..a8c37f0 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,6 +1,6 @@ steps: - label: "Triggering Pipelines (Pull Request)" - if: "build.pull_request.base_branch == 'main'" + if: build.branch != "main" && build.tag == null agents: queue: "juliagpu" plugins: diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d0bcded..ab16047 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,19 +21,16 @@ concurrency: jobs: ci: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: version: - - "min" + - "1.10" - "1" os: - ubuntu-latest - - macos-latest - - windows-latest steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 @@ -63,7 +60,6 @@ jobs: downgrade: if: ${{ !contains(github.event.head_commit.message, '[skip tests]') && github.base_ref == github.event.repository.default_branch }} - name: Downgrade Julia ${{ matrix.version }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -88,34 +84,5 @@ jobs: verbose: true fail_ci_if_error: true - invalidations: - # Only run on PRs to the default branch. - # In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch - if: github.base_ref == github.event.repository.default_branch - runs-on: ubuntu-latest - steps: - - uses: julia-actions/setup-julia@v2 - with: - version: "1" - - uses: actions/checkout@v4 - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-invalidations@v1 - id: invs_pr - - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.repository.default_branch }} - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-invalidations@v1 - id: invs_default - - - name: Report invalidation counts - run: | - echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY - echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY - - name: Check if the PR does increase number of invalidations - if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total - run: exit 1 - env: BACKEND_GROUP: "CPU" diff --git a/Project.toml b/Project.toml index d5755a0..cd7a1c4 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Boltz" uuid = "4544d5e4-abc5-4dea-817f-29e4c205d9c8" authors = ["Avik Pal and contributors"] -version = "1.0.1" +version = "1.0.2" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" @@ -44,25 +44,25 @@ BoltzTrackerExt = "Tracker" BoltzZygoteExt = "Zygote" [compat] -ADTypes = "1.5" +ADTypes = "1.9" ArgCheck = "2.3" Artifacts = "1.10, 1" ChainRulesCore = "1.24" Compat = "4.15" ConcreteStructs = "0.2.3" DataInterpolations = "6.4" -DynamicExpressions = "0.16, 0.17, 0.18, 0.19" +DynamicExpressions = "0.16, 0.17, 0.18, 0.19, 1" ForwardDiff = "0.10.36" Functors = "0.4.12" GPUArraysCore = "0.1.6, 0.2" JLD2 = "0.5" LazyArtifacts = "1.10" -Lux = "1" +Lux = "1.2" LuxCore = "1" -MLDataDevices = "1.1" +MLDataDevices = "1.5" Markdown = "1.10" Metalhead = "0.9.4" -NNlib = "0.9.21" +NNlib = "0.9.24" Random = "1.10" Reexport = "1.2.2" ReverseDiff = "1.15" diff --git a/docs/Project.toml b/docs/Project.toml index d87c041..6621991 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -14,7 +14,7 @@ Boltz = "1" Documenter = "1" DocumenterCitations = "1" DocumenterVitepress = "0.1" -DynamicExpressions = "0.16, 0.17, 0.18, 0.19" +DynamicExpressions = "0.16, 0.17, 0.18, 0.19, 1" Literate = "2" Lux = "1" Random = "1.10" diff --git a/examples/GettingStarted/Project.toml b/examples/GettingStarted/Project.toml index c0183a5..39bc43e 100644 --- a/examples/GettingStarted/Project.toml +++ b/examples/GettingStarted/Project.toml @@ -10,7 +10,7 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [compat] Boltz = "1" InteractiveUtils = "<0.0.1, 1" -JLD2 = "0.4.52, 0.5" +JLD2 = "0.5" Literate = "2.19" Lux = "1" Metalhead = "0.9.3" diff --git a/examples/SymbolicOptimalControl/Project.toml b/examples/SymbolicOptimalControl/Project.toml index dfb351c..85e5821 100644 --- a/examples/SymbolicOptimalControl/Project.toml +++ b/examples/SymbolicOptimalControl/Project.toml @@ -23,14 +23,14 @@ SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b" Boltz = "1" CairoMakie = "0.12" ComponentArrays = "0.15.11" -DynamicExpressions = "0.16, 0.17, 0.18, 0.19" +DynamicExpressions = "0.16, 0.17, 0.18, 0.19, 1" Latexify = "0.16.2" Literate = "2" Lux = "1" MLJ = "0.20.3" -Optimization = "3.24.3" -OptimizationOptimJL = "0.2.3, 0.3" -OptimizationOptimisers = "0.2.1" +Optimization = "4" +OptimizationOptimJL = "0.4" +OptimizationOptimisers = "0.3.2" OrdinaryDiffEqVerner = "1" SciMLSensitivity = "7.57" Statistics = "1.10" diff --git a/test/Project.toml b/test/Project.toml index c2ce690..a05d3bd 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -12,6 +12,7 @@ GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" Hwloc = "0e44f5e4-bd66-52a0-8798-143a42290a1d" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" +LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890" Lux = "b2108857-7c20-44ae-9111-449ecde12c47" LuxLib = "82251201-b29d-42c6-8e01-566dec8acb11" LuxTestUtils = "ac9de150-d08f-4546-94fb-7472b5760531" @@ -32,14 +33,15 @@ Bumper = "0.6, 0.7" ComponentArrays = "0.15.16" DataInterpolations = "6.4" Downloads = "1.6" -DynamicExpressions = "0.16, 0.17, 0.18, 0.19" -Enzyme = "0.12" +DynamicExpressions = "0.16, 0.17, 0.18, 0.19, 1" +Enzyme = "0.13" ExplicitImports = "1.9.0" ForwardDiff = "0.10.36" GPUArraysCore = "0.1.6, 0.2" Hwloc = "3.2.0" InteractiveUtils = "<0.0.1, 1" JLD2 = "0.5" +LoopVectorization = "0.12.171" Lux = "1" LuxLib = "1" LuxTestUtils = "1.1.2" diff --git a/test/layer_tests.jl b/test/layer_tests.jl index 7cfd733..3477ba0 100644 --- a/test/layer_tests.jl +++ b/test/layer_tests.jl @@ -22,8 +22,8 @@ @jet model(x, ps, st) __f = (x, ps) -> sum(abs2, first(model(x, ps, st))) - test_gradients( - __f, x, ps; atol=1e-3, rtol=1e-3, soft_fail=[AutoFiniteDiff()]) + @test_gradients(__f, x, ps; atol=1e-3, rtol=1e-3, + soft_fail=[AutoFiniteDiff()]) end end end @@ -111,7 +111,7 @@ end @jet tensor_project(x, ps, st) __f = (x, ps) -> sum(abs2, first(tensor_project(x, ps, st))) - test_gradients(__f, x, ps; atol=1e-3, rtol=1e-3, + @test_gradients(__f, x, ps; atol=1e-3, rtol=1e-3, skip_backends=[AutoTracker(), AutoEnzyme()]) end end @@ -216,12 +216,12 @@ end @jet layer(x, ps, st) __f = x -> sum(first(layer(x, ps, st))) - test_gradients(__f, x; atol=1.0f-3, rtol=1.0f-3) + @test_gradients(__f, x; atol=1.0f-3, rtol=1.0f-3, enzyme_set_runtime_activity=true) end end @testitem "Dynamic Expressions Layer" setup=[SharedTestSetup] tags=[:layers] begin - using DynamicExpressions, ForwardDiff, ComponentArrays, Bumper + using DynamicExpressions, ForwardDiff, ComponentArrays, Bumper, LoopVectorization operators = OperatorEnum(; binary_operators=[+, -, *], unary_operators=[cos]) @@ -244,7 +244,7 @@ end y, st_ = layer(x, ps, st) @test eltype(y) == Float32 __f = (x, p) -> sum(abs2, first(layer(x, p, st))) - test_gradients(__f, x, ps; atol=1.0f-3, rtol=1.0f-3, skip_backends=[AutoEnzyme()]) + @test_gradients(__f, x, ps; atol=1.0f-3, rtol=1.0f-3, skip_backends=[AutoEnzyme()]) # Particular ForwardDiff dispatches ps_ca = ComponentArray(ps) @@ -265,7 +265,7 @@ end y, st_ = layer(x, ps, st) @test eltype(y) == Float64 __f = (x, p) -> sum(abs2, first(layer(x, p, st))) - test_gradients(__f, x, ps; atol=1.0e-3, rtol=1.0e-3, skip_backends=[AutoEnzyme()]) + @test_gradients(__f, x, ps; atol=1.0e-3, rtol=1.0e-3, skip_backends=[AutoEnzyme()]) end @testset "$(mode)" for (mode, aType, dev, ongpu) in MODES diff --git a/test/runtests.jl b/test/runtests.jl index 5ed2d20..30b27b1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -20,7 +20,7 @@ using Boltz const BOLTZ_TEST_GROUP = get(ENV, "BOLTZ_TEST_GROUP", "all") const RETESTITEMS_NWORKERS = parse( - Int, get(ENV, "RETESTITEMS_NWORKERS", string(min(Hwloc.num_physical_cores(), 16)))) + Int, get(ENV, "RETESTITEMS_NWORKERS", string(min(Hwloc.num_physical_cores(), 4)))) const RETESTITEMS_NWORKER_THREADS = parse(Int, get(ENV, "RETESTITEMS_NWORKER_THREADS", string(max(Hwloc.num_virtual_cores() รท RETESTITEMS_NWORKERS, 1)))) diff --git a/test/shared_testsetup.jl b/test/shared_testsetup.jl index 44bfaac..dc8e429 100644 --- a/test/shared_testsetup.jl +++ b/test/shared_testsetup.jl @@ -1,8 +1,5 @@ @testsetup module SharedTestSetup -using Enzyme -Enzyme.API.runtimeActivity!(true) - import Reexport: @reexport @reexport using Boltz, Lux, GPUArraysCore, LuxLib, LuxTestUtils, Random, StableRNGs using MLDataDevices, JLD2