Code Monkey home page Code Monkey logo

Comments (4)

MikeInnes avatar MikeInnes commented on August 24, 2024 1

Closing for now as I think this is working, but happy to hear if there are further issues.

from zygote.jl.

mszep avatar mszep commented on August 24, 2024

FYI can't reproduce on a debug build of 1.2.0-DEV, instead I get a regular error:

marks@localhost ~/julia> ./julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.2.0-DEV.181 (2019-01-18)
 _/ |\__'_|_|_|\__'_|  |  Commit 30c6ee7234 (0 days old master)
|__/                   |

julia> using Zygote
[ Info: Precompiling Zygote [e88e6eb3-aa80-5325-afca-941959d7151f]

julia> Zygote.gradient((a, b) -> sum(a + b), [1], [2])
ERROR: type StmtRange has no field first
Stacktrace:
 [1] getproperty(::Any, ::Symbol) at ./sysimg.jl:18
 [2] range(::Core.Compiler.BasicBlock) at /home/marks/.julia/packages/Zygote/g8WMA/src/tools/ir.jl:76
 [3] #reverse_ir#47(::Nothing, ::Function, ::Core.Compiler.IRCode, ::Set{Any}) at /home/marks/.julia/packages/Zygote/g8WMA/src/compiler/reverse.jl:294
 [4] (::getfield(Zygote, Symbol("#kw##reverse_ir")))(::NamedTuple{(:varargs,),Tuple{Nothing}}, ::typeof(Zygote.reverse_ir), ::Core.Compiler.IRCode, ::Set{Any}) at ./none:0
 [5] #grad_ir#50(::Nothing, ::Function, ::Core.Compiler.IRCode) at /home/marks/.julia/packages/Zygote/g8WMA/src/compiler/reverse.jl:320
 [6] (::getfield(Zygote, Symbol("#kw##grad_ir")))(::NamedTuple{(:varargs,),Tuple{Nothing}}, ::typeof(Zygote.grad_ir), ::Core.Compiler.IRCode) at ./none:0
 [7] _lookup_grad(::Type) at /home/marks/.julia/packages/Zygote/g8WMA/src/compiler/emit.jl:118
 [8] #s19#533 at /home/marks/.julia/packages/Zygote/g8WMA/src/compiler/interface2.jl:18 [inlined]
 [9] #s19#533(::Any, ::Any, ::Any) at ./none:0
 [10] (::Core.GeneratedFunctionStub)(::Any, ::Vararg{Any,N} where N) at ./boot.jl:522
 [11] (::getfield(Zygote, Symbol("##51#52")){Zygote.J{Tuple{getfield(Main, Symbol("##3#4")),Array{Int64,1},Array{Int64,1}},Tuple{getfield(Main, Symbol("##3#4"))}}})(::Int64) at /home/marks/.julia/packages/Zygote/g8WMA/src/compiler/interface.jl:28
 [12] gradient(::Function, ::Array{Int64,1}, ::Vararg{Array{Int64,1},N} where N) at /home/marks/.julia/packages/Zygote/g8WMA/src/compiler/interface.jl:34
 [13] top-level scope at REPL[2]:1

julia> 

from zygote.jl.

mszep avatar mszep commented on August 24, 2024

I can't reproduce either with a debug build of julia/release-1.0. (Causes an assertion error in libc).

Happy to dig a little further, but I'd appreciate some input:

  • is my understanding correct that Zygote.gradient((a, b) -> sum(a + b), [1], [2]) should in principle work, yielding ([1], [1])?
  • the error when using julia master traces back to a9d4de4 which looks like a bit of a workaround, maybe there's a better way to fix that?
  • I assume the best way to proceed is to see if the bug is reproducible on the latest julia and the latest Zygote. Can anyone provide other suggestions?

from zygote.jl.

MikeInnes avatar MikeInnes commented on August 24, 2024

This seems to be OK for me on Julia master (along with Zygote and IRTools master).

from zygote.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.