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

mul! for Vector{Float64}, SparseMatrixCSC, and SubArray, custom_rule_method_error #1970

Closed
jClugstor opened this issue Oct 16, 2024 · 3 comments

Comments

@jClugstor
Copy link

Stacktrace:
  [1] custom_rule_method_error
    @ ~/.julia/packages/Enzyme/Vjlrr/src/rules/customrules.jl:452 [inlined]
  [2] mul!
    @ ~/.julia/juliaup/julia-1.10.4+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/matmul.jl:237 [inlined]
LoadError: MethodError: no method matching augmented_primal(::EnzymeCore.EnzymeRules.RevConfigWidth{1, false, false, (false, true, true, false, false, false), false}, ::EnzymeCore.Const{typeof(mul!)}, ::Type{EnzymeCore.Const{Vector{Float64}}}, ::EnzymeCore.Duplicated{Vector{Float64}}, ::EnzymeCore.Duplicated{SparseMatrixCSC{Float64, Int32}}, ::EnzymeCore.Duplicated{SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}}, ::EnzymeCore.Const{Bool}, ::EnzymeCore.Const{Bool})

Closest candidates are:
  augmented_primal(::EnzymeCore.EnzymeRules.RevConfig, ::EnzymeCore.Const{typeof(mul!)}, ::Type{RT}, ::EnzymeCore.Annotation{<:StridedVecOrMat}, ::EnzymeCore.Const{<:Union{SparseArrays.AbstractSparseMatrixCSC{Tv, Ti}, SubArray{Tv, 2, <:SparseArrays.AbstractSparseMatrixCSC{Tv, Ti}, Tuple{Base.Slice{Base.OneTo{Int64}}, I}} where I<:AbstractUnitRange} where {Tv, Ti}}, ::EnzymeCore.Annotation{<:StridedVecOrMat}, ::EnzymeCore.Annotation{<:Number}, ::EnzymeCore.Annotation{<:Number}) where RT
   @ Enzyme ~/.julia/packages/Enzyme/Vjlrr/src/internal_rules.jl:732
  augmented_primal(::Any, ::EnzymeCore.Const{typeof(QuadGK.quadgk)}, ::Type{RT}, ::Any, ::EnzymeCore.Annotation{T}...; kws...) where {RT, T}
   @ QuadGKEnzymeExt ~/.julia/packages/QuadGK/BjmU0/ext/QuadGKEnzymeExt.jl:6
  augmented_primal(::Any, ::EnzymeCore.Const{typeof(NNlib._dropout!)}, ::Type{RT}, ::Any, ::OutType, ::Any, ::Any, ::Any) where {OutType, RT}
   @ NNlibEnzymeCoreExt ~/.julia/packages/NNlib/CkJqS/ext/NNlibEnzymeCoreExt/NNlibEnzymeCoreExt.jl:318
@wsmoses
Copy link
Member

wsmoses commented Nov 20, 2024

Can you attach a full runnable MWE?

and cc @ptiede

@jClugstor
Copy link
Author

Ugh, I had a full MWE that for some reason I didn't post and now I can't find it :(

Now I can't seem to recreate it, but IIRC it can be seen when trying to differentiate a function that has mul! with
a view multiplied by a SparseMatrixCSC going in to a Vector{Float64}, so I was able to reproduce it with a length 3 subarray and a 3x3 SparseMatrixCSC. I'll try again in the morning

@wsmoses
Copy link
Member

wsmoses commented Dec 7, 2024

I think this is resolved? if not please reopen

@wsmoses wsmoses closed this as completed Dec 7, 2024
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