8000 Missing `rrule!!` for Lux.jl matrix operations · Issue #622 · chalk-lab/Mooncake.jl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Missing rrule!! for Lux.jl matrix operations #622
Open
@MilesCranmer

Description

@MilesCranmer

Simple training of an MLP generates this traceback which points to MooncakeLuxLibExt.jl, specifically LuxLib.Impl.fused_dense, which hits this error:

    nested task error: No rrule!! available for foreigncall with primal argument types Tuple{Val{(:sgemm_64_, Symbol("@rpath/libblastrampoline.5.dylib"))}, Val{Nothing}, Tuple{Val{Ref{UInt8}}, Val{Ref{UInt8}}, Val{Ref{Int64}}, Val{Ref{Int64}}, Val{Ref{Int64}}, Val{Ref{Float32}}, Val{Ptr{Float32}}, Val{Ref{Int64}}, Val{Ptr{Float32}}, Val{Ref{Int64}}, Val{Ref{Float32}}, Val{Ptr{Float32}}, Val{Ref{Int64}}, Val{Int64}, Val{Int64}}, Val{0}, Val{:ccall}, Ptr{UInt8}, Ptr{UInt8}, Ptr{Int64}, Ptr{Int64}, Ptr{Int64}, Ptr{Float32}, Ptr{Float32}, Ptr{Int64}, Ptr{Float32}, Ptr{Int64}, Ptr{Float32}, Ptr{Float32}, Ptr{Int64}, Int64, Int64, Int64, Int64, Base.RefValue{Int64}, MemoryRef{Float32}, Base.RefValue{Float32}, Base.RefValue{Int64}, MemoryRef{Float32}, Base.RefValue{Int64}, SubArray{Float32, 1, Vector{Float32}, Tuple{UnitRange{Int64}}, true}, Base.RefValue{Float32}, Base.RefValue{Int64}, Base.RefValue{Int64}, Base.RefValue{Int64}, Base.RefValue{UInt8}, Base.RefValue{UInt8}}. This problem has most likely arisen because there is a ccall somewhere in the function you are trying to differentiate, for which an rrule!! has not been explicitly written.You have three options: write an rrule!! for this foreigncall, write an rrule!! for a Julia function that calls this foreigncall, or re-write your code to avoid this foreigncall entirely. If you believe that this error has arisen for some other reason than the above, or the above does not help you to workaround this problem, please open an issue.
    Stacktrace:
      [1] rrule!!(::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Mooncake.CoDual{…}, ::Vararg{…})
        @ Mooncake ~/.julia/packages/Mooncake/JFoRx/src/rrules/foreigncall.jl:12
      [2] gemm!
        @ ~/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/LinearAlgebra/src/blas.jl:1633 [inlined]
      [3] (::Tuple{…})(none::Mooncake.CoDual{…}, none::Mooncake.CoDual{…}, none::Mooncake.CoDual{…}, none::Mooncake.CoDual{…}, none::Mooncake.CoDual{…}, none::Mooncake.CoDual{…}, none::Mooncake.CoDual{…}, none::Mooncake.CoDual{…})
        @ Base.Experimental ./<missing>:0
      [4] DerivedRule
        @ ~/.julia/packages/Mooncake/JFoRx/src/interpreter/s2s_reverse_mode_ad.jl:966 [inlined]

cc @yebai @avik-pal

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0