diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 5e2ae545d..8b8ee2468 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,8 +1,8 @@ steps: - - label: "GPU integration - julia v1.6" + - label: "GPU integration - julia v1.10" plugins: - JuliaCI/julia#v1: - version: "1.6" + version: "1.10" - JuliaCI/julia-test#v1: ~ command: - mkdir -p "$${JULIA_DEPOT_PATH}/conda/3/x86_64" diff --git a/.github/workflows/Downstream.yml b/.github/workflows/Downstream.yml index 9e8dcb0af..8905bef28 100644 --- a/.github/workflows/Downstream.yml +++ b/.github/workflows/Downstream.yml @@ -1,4 +1,4 @@ - + name: IntegrationTest on: push: @@ -25,7 +25,6 @@ jobs: - {user: SciML, repo: DiffEqFlux.jl, group: Layers} - {user: SciML, repo: DiffEqFlux.jl, group: BasicNeuralDE} - {user: SciML, repo: NeuralPDE.jl, group: NNPDE} - - {user: JuliaMolSim, repo: Molly.jl, group: Zygote} steps: - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@v1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c41fddaa..c0eb36aa1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: version: - - '1.6' # Replace this with the minimum Julia version that your package supports. + - '1.10' # Replace this with the minimum Julia version that your package supports. - '1' # automatically expands to the latest stable 1.x release of Julia - 'nightly' os: diff --git a/Project.toml b/Project.toml index 845fcb1ca..4e21d1047 100644 --- a/Project.toml +++ b/Project.toml @@ -58,7 +58,7 @@ SpecialFunctions = "1.6, 2" Statistics = "1" Tracker = "0.2" ZygoteRules = "0.2.5" -julia = "1.6" +julia = "1.10" [extras] CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" diff --git a/src/Zygote.jl b/src/Zygote.jl index 218ab1348..3e735fedf 100644 --- a/src/Zygote.jl +++ b/src/Zygote.jl @@ -79,10 +79,6 @@ macro profile(ex) end using PrecompileTools -# This caused freezes on early 1.8 patch versions, -# see https://github.com/SciML/DiffEqFlux.jl/issues/783 -@static if VERSION < v"1.8" || VERSION >= v"1.8.5" @compile_workload precompile() -end end # module diff --git a/src/compiler/interface2.jl b/src/compiler/interface2.jl index 5e0ae26dd..25cc07048 100644 --- a/src/compiler/interface2.jl +++ b/src/compiler/interface2.jl @@ -31,10 +31,6 @@ function _generate_pullback(ctx, world, f, args...) g = try _generate_pullback_via_decomposition(T, world) catch e - if VERSION < v"1.8" - # work around Julia bug - rethrow(CompileError(T,e)) - end return :(throw($(CompileError(T,e)))) end g === nothing && return :(f(args...), Pullback{$T}((f,))) @@ -53,10 +49,6 @@ function _generate_callable_pullback(j::Type{<:Pullback{T}}, world, Δ) where T g = try _generate_pullback_via_decomposition(T, world) catch e - if VERSION < v"1.8" - # work around Julia bug - rethrow(CompileError(T,e)) - end return :(throw($(CompileError(T,e)))) end if g === nothing diff --git a/src/lib/lib.jl b/src/lib/lib.jl index 179951033..739bcea63 100644 --- a/src/lib/lib.jl +++ b/src/lib/lib.jl @@ -1,13 +1,5 @@ using Base: RefValue - -if VERSION > v"1.7.0-DEV.204" - using Base: ismutabletype -else - function ismutabletype(@nospecialize(t::Type)) - t = Base.unwrap_unionall(t) - return isa(t, DataType) && t.mutable - end -end +using Base: ismutabletype # Interfaces @@ -87,12 +79,7 @@ unwrap(ref, x) = x end function global_set(ref, val) - @static if VERSION < v"1.9.0-DEV.265" - ccall(:jl_set_global, Cvoid, (Any, Any, Any), - ref.mod, ref.name, val) - else setglobal!(ref.mod, ref.name, val) - end end @_adjoint_keepthunks! function global_set(ref, x) diff --git a/src/lib/literal_getproperty.jl b/src/lib/literal_getproperty.jl index cf7d08068..ff9751f59 100644 --- a/src/lib/literal_getproperty.jl +++ b/src/lib/literal_getproperty.jl @@ -29,11 +29,7 @@ function reflect(@nospecialize(sigtypes::Tuple), world::UInt) end method_index === 0 && return nothing type_signature, raw_static_params, method = _methods[method_index] - if VERSION < v"1.8-" - method_instance = Core.Compiler.specialize_method(method, type_signature, raw_static_params, false) - else - method_instance = Core.Compiler.specialize_method(method, type_signature, raw_static_params; preexisting=false) - end + method_instance = Core.Compiler.specialize_method(method, type_signature, raw_static_params; preexisting=false) method_signature = method.sig static_params = Any[raw_static_params...] return method_instance, method_signature, static_params @@ -47,11 +43,7 @@ function _generate_literal_getproperty(ctx, world, x, ::Type{Val{f}}) where f sig(x) = Tuple{x, typeof(f)} rrule_sig(x) = Tuple{typeof(getproperty), x, typeof(f)} pb_sig(x) = Tuple{ctx, typeof(getproperty), x, typeof(f)} - @static if VERSION >= v"1.10.0-DEV.65" - which(f, t) = Base._which(Base.signature_type(f, t); world).method - else - which(f, t) = Base.which(f, t) - end + which(f, t) = Base._which(Base.signature_type(f, t); world).method # either `getproperty` has a custom implementation or `_pullback(ctx, getproperty, x, f)` # / `rrule(getproperty, x, f) is overloaded directly @@ -62,11 +54,7 @@ function _generate_literal_getproperty(ctx, world, x, ::Type{Val{f}}) where f if is_getfield_fallback # just copy pullback of `literal_getfield` mi, _sig, sparams = reflect((typeof(_pullback), ctx, typeof(literal_getfield), x, Val{f}), world) - ci = if VERSION >= v"1.10.0-DEV.873" - copy(Core.Compiler.retrieve_code_info(mi, world)) - else - copy(Core.Compiler.retrieve_code_info(mi)) - end + ci = copy(Core.Compiler.retrieve_code_info(mi, world)) # we need to change the second arg to `_pullback` from `literal_getproperty` to # `literal_getfield` @@ -100,7 +88,6 @@ function _generate_literal_getproperty(ctx, world, x, ::Type{Val{f}}) where f end end -if VERSION >= v"1.10.0-DEV.873" # on Julia 1.10, generated functions need to keep track of the world age @@ -116,11 +103,3 @@ end $(Expr(:meta, :generated, _literal_getproperty_pullback_generator)) $(Expr(:meta, :generated_only)) end - -else - -@generated function _pullback(ctx::AContext, ::typeof(literal_getproperty), x, f) - _generate_literal_getproperty(ctx, nothing, x, f) -end - -end diff --git a/test/compiler.jl b/test/compiler.jl index 07d498ecb..625d768a6 100644 --- a/test/compiler.jl +++ b/test/compiler.jl @@ -33,11 +33,7 @@ y, back = pullback(badly, 2) bt = try back(1) catch e stacktrace(catch_backtrace()) end @test trace_contains(bt, nothing, "compiler.jl", bad_def_line) -if VERSION >= v"1.10-" - @test trace_contains(bt, :badly, "compiler.jl", bad_call_line) -else - @test_broken trace_contains(bt, :badly, "compiler.jl", bad_call_line) -end +@test trace_contains(bt, :badly, "compiler.jl", bad_call_line) # Type inference checks @@ -178,12 +174,11 @@ end @test y_explicit == y_implicit == getfield(g, :m) ∇args = ((m = [1.0, 0.0, 0.0], P = nothing),) - if VERSION > v"1.7-" # This type instability is due to the handling of non-bitstypes in `accum_param` @test Base.return_types(back_implicit, Tuple{Vector{Float64}}) == Any[Union{Tuple{Nothing}, typeof(∇args)}] # But the same should infer if implicit parameters are disabled @test Base.return_types(back_explicit, Tuple{Vector{Float64}}) == Any[typeof(∇args)] - end + @test back_explicit([1., 0, 0]) == back_implicit([1., 0, 0]) == ∇args Base.getproperty(g::Gaussian, s::Symbol) = 2getfield(g, s) @@ -282,9 +277,6 @@ function try_catch_finally(cond, x) x end -if VERSION >= v"1.8" - # try/catch/else is invalid syntax prior to v1.8 - eval(Meta.parse(""" function try_catch_else(cond, x) x = 2x @@ -299,8 +291,6 @@ if VERSION >= v"1.8" x end - """)) -end @testset "try/catch" begin @testset "happy path (nothrow)" begin @@ -326,12 +316,10 @@ end end end - if VERSION >= v"1.8" @testset "try/catch/else" begin @test Zygote.gradient(try_catch_else, false, 1.0) == (nothing, 8.0) @test_throws ErrorException Zygote.gradient(try_catch_else, true, 1.0) end - end function foo_try(f) y = 1