8000 Possible incorrect rule implementation. · Issue #528 · chalk-lab/Mooncake.jl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Possible incorrect rule implementation. #528

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

Open
AstitvaAggarwal opened this issue Mar 17, 2025 · 3 comments
Open

Possible incorrect rule implementation. #528

AstitvaAggarwal opened this issue Mar 17, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@AstitvaAggarwal
Copy link
Collaborator
AstitvaAggarwal commented Mar 17, 2025

When i call Mooncake.prepare_pullback_cache(x->Ptr{Float64}(x), 1)

I get the following Error and Stacktrace :


ERROR: TypeError: in typeassert, expected Mooncake.CoDual{Ptr{Float64}, Ptr{Float64}}, got a value of type Mooncake.CoDual{Ptr{Float64}, Mooncake.NoFData}

Stacktrace:
 [1] #25
   @ .\REPL[208]:1 [inlined]
 [2] (::Tuple{…})(none::Mooncake.CoDual{…}, none::Mooncake.CoDual{…})
   @ Base.Experimental .\<missing>:0
 [3] (::Mooncake.DerivedRule{…})(::Mooncake.CoDual{…}, ::Mooncake.CoDual{…})
   @ Mooncake C:\Users\astit\OneDrive\Desktop\GSOC\Julia\contri\Mooncake.jl\src\interpreter\s2s_reverse_mode_ad.jl:963
 [4] prepare_pullback_cache(::Function, ::Vararg{Any}; kwargs::@Kwargs{})
   @ Mooncake C:\Users\astit\OneDrive\Desktop\GSOC\Julia\contri\Mooncake.jl\src\interface.jl:279
 [5] prepare_pullback_cache(::Function, ::Vararg{Any})
   @ Mooncake C:\Users\astit\OneDrive\Desktop\GSOC\Julia\contri\Mooncake.jl\src\interface.jl:270
 [6] top-level scope
   @ REPL[208]:1
Some type information was truncated. Use `show(err)` to see complete types.

julia> show(err)
1-element ExceptionStack:
TypeError: in typeassert, expected Mooncake.CoDual{Ptr{Float64}, Ptr{Float64}}, got a value of type Mooncake.CoDual{Ptr{Float64}, Mooncake.NoFData}
Stacktrace:
  [1] #13
    @ .\REPL[147]:1 [inlined]
  [2] (::Tuple{Mooncake.Stack{Int32}, Base.RefValue{Tuple{Mooncake.LazyZeroRData{var"#13#14", Nothing}, Mooncake.LazyZeroRData{Int64, Nothing}}}})(none::Mooncake.CoDual{var"#13#14", Mooncake.NoFData}, none::Mooncake.CoDual{Int64, Mooncake.NoFData})
    @ Base.Experimental .\<missing>:0
  [3] (::Mooncake.DerivedRule{Tuple{var"#13#14", Int64}, Tuple{Mooncake.CoDual{var"#13#14", Mooncake.NoFData}, Mooncake.CoDual{Int64, Mooncake.NoFData}}, Mooncake.CoDual{Ptr{Float64}, Ptr{Float64}}, Tuple{Mooncake.NoRData}, Tuple{Mooncake.NoRData, Mooncake.NoRData}, false, Val{2}})(::Mooncake.CoDual{var"#13#14", Mooncake.NoFData}, ::Mooncake.CoDual{Int64, Mooncake.NoFData})
    @ Mooncake C:\Users\astit\OneDrive\Desktop\GSOC\Julia\contri\Mooncake.jl\src\interpreter\s2s_reverse_mode_ad.jl:963
  [4] prepare_pullback_cache(::Function, ::Vararg{Any}; kwargs::@Kwargs{})
    @ Mooncake C:\Users\astit\OneDrive\Desktop\GSOC\Julia\contri\Mooncake.jl\src\interface.jl:304
  [5] prepare_pullback_cache(::Function, ::Vararg{Any})
    @ Mooncake C:\Users\astit\OneDrive\Desktop\GSOC\Julia\contri\Mooncake.jl\src\interface.jl:294
  [6] top-level scope
    @ REPL[147]:1
  [7] eval
    @ .\boot.jl:385 [inlined]
  [8] eval
    @ .\Base.jl:88 [inlined]
  [9] repleval(m::Module, code::Expr, ::String)
    @ VSCodeServer c:\Users\astit\.vscode\extensions\julialang.language-julia-1.127.2\scripts\packages\VSCodeServer\src\repl.jl:229
 [10] (::VSCodeServer.var"#112#114"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer c:\Users\astit\.vscode\extensions\julialang.language-julia-1.127.2\scripts\packages\VSCodeServer\src\repl.jl:192
 [11] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging .\logging.jl:515
 [12] with_logger
    @ .\logging.jl:627 [inlined]
 [13] (::VSCodeServer.var"#111#113"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer c:\Users\astit\.vscode\extensions\julialang.language-julia-1.127.2\scripts\packages\VSCodeServer\src\repl.jl:193
 [14] #invokelatest#2
    @ .\essentials.jl:892 [inlined]
 [15] invokelatest(::Any)
    @ Base .\essentials.jl:889
 [16] (::VSCodeServer.var"#64#65")()
    @ VSCodeServer c:\Users\astit\.vscode\extensions\julialang.language-julia-1.127.2\scripts\packages\VSCodeServer\src\eval.jl:34
julia> 
@AstitvaAggarwal AstitvaAggarwal added the bug Something isn't working label Mar 17, 2025
@willtebbutt
Copy link
Collaborator

Thanks for opening this @AstitvaAggarwal . Would you mind sharing the stacktrace that you get when you call show(err) -- we need quite a bit more information from the types in order to see what's going on.

@AstitvaAggarwal
Copy link
Collaborator Author

@willtebbutt ive edited that into the REPL output above, take a look.

@willtebbutt
Copy link
Collaborator

Thanks @AstitvaAggarwal . This definitely looks like a bug. I'll have a dig later to try and figure out where this is coming from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
0