Comments (4)
Closing for now as I think this is working, but happy to hear if there are further issues.
from zygote.jl.
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.
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.
This seems to be OK for me on Julia master (along with Zygote and IRTools master).
from zygote.jl.
Related Issues (20)
- `sort(x; rev=true)` is not supported HOT 1
- Incorrect gradients for `plan_rfft(x) * x` HOT 2
- Gradient of scalar function of gradient giving mutating array error HOT 4
- `sum` with CUDA and view on array errors HOT 3
- Cannot take gradient of sort on 2D CuArray HOT 1
- `Ref` and broadcasting issue HOT 2
- Strip zygote frames from mutation error stack trace HOT 1
- Zygote in Julia 1.10+ not reading rrules for default constructors HOT 7
- Few issues in the Zygote Home Page documentation HOT 1
- OOM when computing the gradient in an embarrassingly parallel problem HOT 1
- Pullback over jacobian HOT 6
- `withjacobian` flattens the output when it is a matrix HOT 1
- Gradient wrt to a sparse matrix is mathematically wrong HOT 6
- Increasing memory usage in each call of gradient HOT 1
- Precompilation error in Julia nightly HOT 1
- Gradient involving `LinearAlgebra.tr` errors HOT 1
- Device-to-host copies with GPU code HOT 11
- Inferring `Any` on gradient w.r.t. wrapper of recursive type
- Manually changing the Flux parameters and optimizing using Zygote
- Support try/catch by assuming try branch HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zygote.jl.