TuringLang / Turing.jl

Bayesian inference with probabilistic programming.
https://turinglang.org
MIT License
2.04k stars 218 forks source link

AD error with Bijectors 0.7 #1256

Closed yebai closed 4 years ago

yebai commented 4 years ago

Simplex Tracker, Zygote and ReverseDiff (with and without caching) AD: Error During Test at /home/runner/work/Turing.jl/Turing.jl/test/core/ad.jl:266
  Got exception outside of a @test
  MethodError: *(::Adjoint{Float64,LowerTriangular{Float64,Array{Float64,2}}}, ::TrackedArray{…,Array{Float64,1}}) is ambiguous. Candidates:
    *(adjA::Adjoint{#s664,#s663} where #s663<:LinearAlgebra.AbstractTriangular where #s664, B::AbstractArray{T,1} where T) in LinearAlgebra at /opt/hostedtoolcache/julia/1.4.1/x64/share/julia/stdlib/v1.4/LinearAlgebra/src/triangular.jl:1971
    *(x::Adjoint{T,#s50} where #s50<:AbstractArray{T,2}, y::TrackedArray{T,1,A} where A where T) where T in Tracker at /home/runner/.julia/packages/Tracker/cpxco/src/lib/array.jl:412
  Possible fix, define
    *(::Adjoint{T,#s50} where #s50<:(LinearAlgebra.AbstractTriangular{T,S} where S<:(AbstractArray{T,2} where T)), ::TrackedArray{T,1,A} where A where T) where T

https://github.com/TuringLang/Turing.jl/runs/641913837#step:5:141

yebai commented 4 years ago

maybe this is already fixed in https://github.com/TuringLang/Turing.jl/commits/mt/hmc_and_ad_fixes?

mohamed82008 commented 4 years ago

Let me see, looks like something DAD should fix.

devmotion commented 4 years ago

Seems to work on master, so I guess the DAD update might have fixed it? Should the compatibility bounds be updated accordingly then (to avoid to users run into the same problem)?

yebai commented 4 years ago

yes, the tests are passing on master once the DistributionsAD PR was merged.

mohamed82008 commented 4 years ago

👍

mohamed82008 commented 4 years ago

I don't mind increasing the DAD compat bound but it's not necessary since most people won't hit this error.