Skip to content

Commit

Permalink
Remove Enzyme special handling on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed May 17, 2024
1 parent 441c5ea commit b040693
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 78 deletions.
43 changes: 5 additions & 38 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,9 @@
name: format-check
name: Format suggestions

on:
push:
branches:
- 'master'
- 'release-'
tags: '*'
pull_request:
on: [pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1]
julia-arch: [x86]
os: [ubuntu-latest]
code-style:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}

- uses: actions/checkout@v4
- name: Install JuliaFormatter and format
# This will use the latest version by default but you can set the version like so:
#
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
julia -e 'using JuliaFormatter; format(".", verbose=true)'
- name: Format check
run: |
julia -e '
out = Cmd(`git diff --name-only`) |> read |> String
if out == ""
exit(0)
else
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
end'
- uses: julia-actions/julia-format@v2
13 changes: 4 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ BenchmarkTools = "1.4"
CUDA = "5.2"
ConcreteStructs = "0.2.3"
DiffEqBase = "6.149.0"
Enzyme = "0.11.15, 0.12"
Enzyme = "0.12"
FastBroadcast = "0.2.8"
FastClosures = "0.3.2"
FastLevenbergMarquardt = "0.1"
Expand Down Expand Up @@ -103,8 +103,8 @@ StableRNGs = "1"
StaticArrays = "1.9"
StaticArraysCore = "1.4"
Sundials = "4.23.1"
Symbolics = "5.13"
SymbolicIndexingInterface = "0.3.15"
Symbolics = "5.13"
Test = "1.10"
TimerOutputs = "0.5.23"
Zygote = "0.6.69"
Expand All @@ -115,15 +115,12 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
FastLevenbergMarquardt = "7a0df574-e128-4d35-8cbd-3d84502bf7ce"
FixedPointAcceleration = "817d07cb-a79a-5c30-9a31-890123675176"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
LeastSquaresOptim = "0fc2ff8b-aaa3-5acd-a817-1944a5e08891"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
MINPACK = "4854310b-de5a-5eb6-a2a5-c1dee2bd17f9"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
NLSolvers = "337daf1e-9722-11e9-073e-8b9effe078ba"
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
Expand All @@ -132,10 +129,8 @@ OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SIAMFANLEquations = "084e46ad-d928-497d-ad5e-07fa361a48c4"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
SpeedMapping = "f1835b91-879b-4a3f-a438-e4baacf14412"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Expand All @@ -145,4 +140,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[targets]
test = ["Aqua", "Enzyme", "BenchmarkTools", "SafeTestsets", "Pkg", "Test", "ForwardDiff", "StaticArrays", "Symbolics", "LinearSolve", "Random", "LinearAlgebra", "Zygote", "SparseDiffTools", "NonlinearProblemLibrary", "LeastSquaresOptim", "FastLevenbergMarquardt", "NaNMath", "BandedMatrices", "DiffEqBase", "StableRNGs", "MINPACK", "NLsolve", "OrdinaryDiffEq", "SpeedMapping", "FixedPointAcceleration", "SIAMFANLEquations", "Sundials", "ReTestItems", "Reexport", "CUDA", "NLSolvers"]
test = ["Aqua", "BandedMatrices", "BenchmarkTools", "CUDA", "Enzyme", "FastLevenbergMarquardt", "FixedPointAcceleration", "LeastSquaresOptim", "MINPACK", "ModelingToolkit", "NLSolvers", "NLsolve", "NaNMath", "NonlinearProblemLibrary", "OrdinaryDiffEq", "Pkg", "Random", "ReTestItems", "SIAMFANLEquations", "SafeTestsets", "SparseDiffTools", "SpeedMapping", "StableRNGs", "StaticArrays", "Sundials", "Symbolics", "Test", "Zygote"]
21 changes: 5 additions & 16 deletions test/core/rootfind_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ using Reexport
@reexport using BenchmarkTools, LinearSolve, NonlinearSolve, StaticArrays, Random,
LinearAlgebra, ForwardDiff, Zygote, Enzyme, SparseDiffTools, DiffEqBase

function __autosparseenzyme()
@static if Sys.iswindows()
@warn "Enzyme on Windows stalls. Using AutoSparse(AutoFiniteDiff()) instead till \
https://github.com/EnzymeAD/Enzyme.jl/issues/1236 is resolved."
return AutoSparse(AutoFiniteDiff())
else
return AutoSparse(AutoEnzyme())
end
end

_nameof(x) = applicable(nameof, x) ? nameof(x) : _nameof(typeof(x))

quadratic_f(u, p) = u .* u .- p
Expand Down Expand Up @@ -58,8 +48,7 @@ function nlprob_iterator_interface(f, p_range, ::Val{iip}, solver) where {iip}
end

export nlprob_iterator_interface, benchmark_nlsolve_oop, benchmark_nlsolve_iip,
TERMINATION_CONDITIONS, _nameof, newton_fails, quadratic_f, quadratic_f!,
__autosparseenzyme
TERMINATION_CONDITIONS, _nameof, newton_fails, quadratic_f, quadratic_f!
end

# --- NewtonRaphson tests ---
Expand Down Expand Up @@ -113,7 +102,7 @@ end

@testset "ADType: $(autodiff) u0: $(_nameof(u0))" for autodiff in (
AutoSparse(AutoForwardDiff()), AutoSparse(AutoFiniteDiff()),
AutoZygote(), AutoSparse(AutoZygote()), __autosparseenzyme()),
AutoZygote(), AutoSparse(AutoZygote()), AutoSparse(AutoEnzyme())),
u0 in (1.0, [1.0, 1.0])

probN = NonlinearProblem(quadratic_f, u0, 2.0)
Expand Down Expand Up @@ -176,7 +165,7 @@ end

@testset "ADType: $(autodiff) u0: $(_nameof(u0)) radius_update_scheme: $(radius_update_scheme)" for autodiff in (
AutoSparse(AutoForwardDiff()), AutoSparse(AutoFiniteDiff()),
AutoZygote(), AutoSparse(AutoZygote()), __autosparseenzyme()),
AutoZygote(), AutoSparse(AutoZygote()), AutoSparse(AutoEnzyme())),
u0 in (1.0, [1.0, 1.0]),
radius_update_scheme in radius_update_schemes

Expand Down Expand Up @@ -272,7 +261,7 @@ end

@testset "ADType: $(autodiff) u0: $(_nameof(u0))" for autodiff in (
AutoSparse(AutoForwardDiff()), AutoSparse(AutoFiniteDiff()),
AutoZygote(), AutoSparse(AutoZygote()), __autosparseenzyme()),
AutoZygote(), AutoSparse(AutoZygote()), AutoSparse(AutoEnzyme())),
u0 in (1.0, [1.0, 1.0])

probN = NonlinearProblem(quadratic_f, u0, 2.0)
Expand Down Expand Up @@ -454,7 +443,7 @@ end

@testset "ADType: $(autodiff) u0: $(_nameof(u0))" for autodiff in (
AutoSparse(AutoForwardDiff()), AutoSparse(AutoFiniteDiff()),
AutoZygote(), AutoSparse(AutoZygote()), __autosparseenzyme()),
AutoZygote(), AutoSparse(AutoZygote()), AutoSparse(AutoEnzyme())),
u0 in (1.0, [1.0, 1.0])

probN = NonlinearProblem(quadratic_f, u0, 2.0)
Expand Down
4 changes: 0 additions & 4 deletions test/downstream/Project.toml

This file was deleted.

11 changes: 0 additions & 11 deletions test/downstream/downstream_tests.jl

This file was deleted.

File renamed without changes.

0 comments on commit b040693

Please sign in to comment.