Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precompilation error in 1.10: conflict with static arrays #120

Closed
sefffal opened this issue Dec 20, 2023 · 2 comments
Closed

Precompilation error in 1.10: conflict with static arrays #120

sefffal opened this issue Dec 20, 2023 · 2 comments

Comments

@sefffal
Copy link

sefffal commented Dec 20, 2023

It appears that ChainRules v1.58.1 and TemporalGPs v0.6.5 both define adjoints for static arrays.
Loading static arrays, chain rules, and temporalGPs in one session results in:

``julia
WARNING: Method definition rrule(Type{T}, Tuple) where {T<:(StaticArraysCore.SArray{S, T, N, L} where L where N where T where S<:Tuple)} in module StaticArraysChainRulesCoreExt at /Users/thompsonw/.julia/packages/StaticArrays/Uc4hE/ext/StaticArraysChainRulesCoreExt.jl:26 overwritten in module TemporalGPs at /Users/thompsonw/.julia/packages/TemporalGPs/zMIeA/src/util/chainrules.jl:31.
ERROR: Method overwriting is not permitted during Module precompilation. Use __precompile__(false) to opt-out of precompilation.


The two conflicting definitions appear to be:
```julia
function rrule(::Type{T}, x::Tuple) where {T <: SArray}
    project_x = ProjectTo(x)
    ∇Array(∂y) = (NoTangent(), project_x(∂y))
    return T(x), ∇Array
end

in ChainRules

and

function rrule(::Type{T}, x::Tuple) where {T<:SArray}
    SArray_rrule(Δ) = begin
        (NoTangent(), Tangent{typeof(x)}(unthunk(Δ).data...))
    end
    return T(x), SArray_rrule
end

in TemporalGPs.

@willtebbutt
Copy link
Member

Ahh okay. My type-piracy has now come back to bite me.

Could you try dev-ing TemporalGPs, removing the rrule that was written in TemporalGPs and seeing whether the tests pass? If we're lucky, it'll just work.

@willtebbutt
Copy link
Member

Resolved by #129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants