From 1b6410a203659f431bcb8dc7f86ec651a41a90f6 Mon Sep 17 00:00:00 2001 From: Songchen Tan Date: Thu, 21 Nov 2024 16:23:32 -0500 Subject: [PATCH 1/2] Initialize --- DifferentiationInterface/Project.toml | 6 +++++- .../DifferentiationInterfaceTaylorDiffExt.jl | 8 ++++++++ .../src/DifferentiationInterface.jl | 2 ++ .../test/Back/TaylorDiff/test.jl | 16 ++++++++++++++++ DifferentiationInterface/test/runtests.jl | 2 +- 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 DifferentiationInterface/ext/DifferentiationInterfaceTaylorDiffExt/DifferentiationInterfaceTaylorDiffExt.jl create mode 100644 DifferentiationInterface/test/Back/TaylorDiff/test.jl diff --git a/DifferentiationInterface/Project.toml b/DifferentiationInterface/Project.toml index 6341e12e7..017ec8796 100644 --- a/DifferentiationInterface/Project.toml +++ b/DifferentiationInterface/Project.toml @@ -22,6 +22,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" +TaylorDiff = "b36ab563-344f-407b-a36a-4f200bebf99c" Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" @@ -40,6 +41,7 @@ DifferentiationInterfaceSparseArraysExt = "SparseArrays" DifferentiationInterfaceSparseMatrixColoringsExt = "SparseMatrixColorings" DifferentiationInterfaceStaticArraysExt = "StaticArrays" DifferentiationInterfaceSymbolicsExt = "Symbolics" +DifferentiationInterfaceTaylorDiffExt = "TaylorDiff" DifferentiationInterfaceTrackerExt = "Tracker" DifferentiationInterfaceZygoteExt = ["Zygote", "ForwardDiff"] @@ -63,6 +65,7 @@ SparseConnectivityTracer = "0.5.0,0.6" StaticArrays = "1.9.7" SparseMatrixColorings = "0.4.9" Symbolics = "5.27.1, 6" +TaylorDiff = "0.3" Tracker = "0.2.33" Zygote = "0.6.69" julia = "1.10" @@ -94,9 +97,10 @@ SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" +TaylorDiff = "b36ab563-344f-407b-a36a-4f200bebf99c" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" [targets] -test = ["ADTypes", "Aqua", "ComponentArrays", "DataFrames", "ExplicitImports", "ForwardDiff", "JET", "JLArrays", "JuliaFormatter", "Pkg", "Random", "SparseArrays", "SparseConnectivityTracer", "SparseMatrixColorings", "StableRNGs", "StaticArrays", "Test", "Zygote"] +test = ["ADTypes", "Aqua", "ComponentArrays", "DataFrames", "ExplicitImports", "ForwardDiff", "JET", "JLArrays", "JuliaFormatter", "Pkg", "Random", "SparseArrays", "SparseConnectivityTracer", "SparseMatrixColorings", "StableRNGs", "StaticArrays", "TaylorDiff", "Test", "Zygote"] diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceTaylorDiffExt/DifferentiationInterfaceTaylorDiffExt.jl b/DifferentiationInterface/ext/DifferentiationInterfaceTaylorDiffExt/DifferentiationInterfaceTaylorDiffExt.jl new file mode 100644 index 000000000..dfd210aea --- /dev/null +++ b/DifferentiationInterface/ext/DifferentiationInterfaceTaylorDiffExt/DifferentiationInterfaceTaylorDiffExt.jl @@ -0,0 +1,8 @@ +module DifferentiationInterfaceTaylorDiffExt + +using ADTypes: AutoTaylorDiff +import DifferentiationInterface as DI +using TaylorDiff + +DI.check_available(::AutoTaylorDiff) = true +end diff --git a/DifferentiationInterface/src/DifferentiationInterface.jl b/DifferentiationInterface/src/DifferentiationInterface.jl index fcfc25dd0..df05379bc 100644 --- a/DifferentiationInterface/src/DifferentiationInterface.jl +++ b/DifferentiationInterface/src/DifferentiationInterface.jl @@ -27,6 +27,7 @@ using ADTypes: AutoPolyesterForwardDiff, AutoReverseDiff, AutoSymbolics, + AutoTaylorDiff, AutoTracker, AutoZygote using LinearAlgebra: dot @@ -113,6 +114,7 @@ export AutoMooncake export AutoPolyesterForwardDiff export AutoReverseDiff export AutoSymbolics +export AutoTaylorDiff export AutoTracker export AutoZygote diff --git a/DifferentiationInterface/test/Back/TaylorDiff/test.jl b/DifferentiationInterface/test/Back/TaylorDiff/test.jl new file mode 100644 index 000000000..a08640b8d --- /dev/null +++ b/DifferentiationInterface/test/Back/TaylorDiff/test.jl @@ -0,0 +1,16 @@ +using Pkg +Pkg.add("TaylorDiff") + +using DifferentiationInterface, DifferentiationInterfaceTest +import DifferentiationInterfaceTest as DIT +using TaylorDiff: TaylorDiff +using Test + +LOGGING = get(ENV, "CI", "false") == "false" + +backends = [AutoTaylorDiff(), AutoTaylorDiff(; order=2)] + +for backend in backends + @test check_available(backend) + @test check_inplace(backend) +end diff --git a/DifferentiationInterface/test/runtests.jl b/DifferentiationInterface/test/runtests.jl index a1758105b..5a4963c94 100644 --- a/DifferentiationInterface/test/runtests.jl +++ b/DifferentiationInterface/test/runtests.jl @@ -18,7 +18,7 @@ else Pkg.add("DifferentiationInterfaceTest") end -GROUP = get(ENV, "JULIA_DI_TEST_GROUP", "All") +GROUP = get(ENV, "JULIA_DI_TEST_GROUP", "Back/TaylorDiff") ## Main tests From cf6ec8e5f84bf4401d8e83413d51f3564660a934 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Thu, 21 Nov 2024 22:40:06 +0100 Subject: [PATCH 2/2] Reduce CI workload --- .github/workflows/Test.yml | 45 ++++++++++--------- .../Documentation.yml | 0 2 files changed, 23 insertions(+), 22 deletions(-) rename .github/{workflows => workflows_inactive}/Documentation.yml (100%) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 3fbb6210a..3032cb2c4 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -28,28 +28,29 @@ jobs: fail-fast: false # TODO: toggle matrix: version: - - "1.10" + # - "1.10" - "1" group: - Misc/Internals - - Misc/DifferentiateWith - - Misc/FromPrimitive - - Misc/SparsityDetector - - Misc/ZeroBackends - - Back/ChainRules + # - Misc/DifferentiateWith + # - Misc/FromPrimitive + # - Misc/SparsityDetector + # - Misc/ZeroBackends + # - Back/ChainRules # - Back/Diffractor - - Back/Enzyme - - Back/FiniteDiff - - Back/FiniteDifferences - - Back/ForwardDiff - - Back/Mooncake - - Back/PolyesterForwardDiff - - Back/ReverseDiff - - Back/SymbolicBackends - - Back/Tracker - - Back/Zygote - - Down/Flux - - Down/Lux + # - Back/Enzyme + # - Back/FiniteDiff + # - Back/FiniteDifferences + # - Back/ForwardDiff + # - Back/Mooncake + # - Back/PolyesterForwardDiff + # - Back/ReverseDiff + # - Back/SymbolicBackends + - Back/TaylorDiff + # - Back/Tracker + # - Back/Zygote + # - Down/Flux + # - Down/Lux skip_lts: - ${{ github.event.pull_request.draft }} exclude: @@ -96,13 +97,13 @@ jobs: fail-fast: true matrix: version: - - "1.10" + # - "1.10" - "1" group: - Formalities - - Zero - - Standard - - Weird + # - Zero + # - Standard + # - Weird skip_lts: - ${{ github.event.pull_request.draft }} # exclude: diff --git a/.github/workflows/Documentation.yml b/.github/workflows_inactive/Documentation.yml similarity index 100% rename from .github/workflows/Documentation.yml rename to .github/workflows_inactive/Documentation.yml