From 052be1388e9ebfb2c609ce18d9c99661a2f50b60 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Sun, 10 Mar 2024 21:33:07 +0100 Subject: [PATCH 1/2] Fix KernelFunctions on Julia 1.3 --- .github/workflows/ci.yml | 2 +- Project.toml | 2 +- src/chainrules.jl | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 628e5517d..2db820022 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,8 @@ jobs: fail-fast: false matrix: version: + - '1.3' - '1' - - '1.6' - 'nightly' os: - ubuntu-latest diff --git a/Project.toml b/Project.toml index 24da5ddcc..249f032ec 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "KernelFunctions" uuid = "ec8451be-7e33-11e9-00cf-bbf324bd1392" -version = "0.10.63" +version = "0.10.64" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" diff --git a/src/chainrules.jl b/src/chainrules.jl index 549373876..851490309 100644 --- a/src/chainrules.jl +++ b/src/chainrules.jl @@ -153,7 +153,7 @@ function ChainRulesCore.rrule( d̄ = ChainRulesCore.Tangent{typeof(d)}(; r=r̄) return NoTangent(), d̄, @thunk(project_x(x̄)) end - return Distances.pairwise(d, x; dims), pairwise_pullback + return Distances.pairwise(d, x; dims=dims), pairwise_pullback end function ChainRulesCore.rrule( @@ -190,7 +190,7 @@ function ChainRulesCore.rrule( d̄ = ChainRulesCore.Tangent{typeof(d)}(; r=r̄) return NoTangent(), d̄, @thunk(project_x(x̄)), @thunk(project_y(ȳ)) end - return Distances.pairwise(d, x, y; dims), pairwise_pullback + return Distances.pairwise(d, x, y; dims=dims), pairwise_pullback end function ChainRulesCore.rrule( @@ -229,7 +229,7 @@ function ChainRulesCore.rrule(::Type{<:ColVecs}, X::AbstractMatrix) "or because some external computation has acted on `ColVecs` to produce a vector of vectors." * "In the former case, to solve this issue overload `kernelmatrix(_diag)` for your kernel for `ColVecs`." * "In the latter case, one needs to track down the `rrule` whose pullback returns a `Vector{Vector{T}}`," * - " rather than a `Tangent`, as the cotangent / gradient for `ColVecs` input, and circumvent it." + " rather than a `Tangent`, as the cotangent / gradient for `ColVecs` input, and circumvent it.", ) end return ColVecs(X), ColVecs_pullback From ee837929f58e6e580bee75f0308e0ac12bff4215 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Sun, 10 Mar 2024 22:59:26 +0100 Subject: [PATCH 2/2] More fixes --- test/test_utils.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_utils.jl b/test/test_utils.jl index aa8c81e1f..6c679ed69 100644 --- a/test/test_utils.jl +++ b/test/test_utils.jl @@ -372,7 +372,7 @@ function test_zygote_perf_heuristic( f, name::String, args1, args2, passes, Δ1=nothing, Δ2=nothing ) @testset "$name" begin - primal, fwd, pb = ad_constant_allocs_heuristic(f, args1, args2; Δ1, Δ2) + primal, fwd, pb = ad_constant_allocs_heuristic(f, args1, args2; Δ1=Δ1, Δ2=Δ2) if passes[1] @test primal[1] == primal[2] else