-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fall back to dynamic dispatch in union-splitting optimization #18046
Conversation
This should help #17932. If a function returns an unanticipated type that wasn't part of the `Union` seen by inference, do dynamic dispatch instead of erroring.
Unfortunately, it's not fixed: Julia Version 0.6.0-dev.232
Commit b0cf591 (2016-08-16 04:29 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin15.6.0)
CPU: Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz
WORD_SIZE: 64
BLAS: libgfortblas
LAPACK: liblapack
LIBM: libopenlibm
LLVM: libLLVM-3.7.1 (ORCJIT, broadwell)
INFO: Recompiling stale cache file /Users/solver/.julia/lib/v0.6/ApproxFun.ji for module ApproxFun.
WARNING: Base.writemime is deprecated.
likely near /Users/solver/.julia/v0.6/ApproxFun/src/Extras/show.jl:217
WARNING: Base.writemime is deprecated.
likely near /Users/solver/.julia/v0.6/ApproxFun/src/Extras/show.jl:217
WARNING: Base.writemime is deprecated.
likely near /Users/solver/.julia/v0.6/ApproxFun/src/Extras/show.jl:217
WARNING: Base.writemime is deprecated.
likely near /Users/solver/.julia/v0.6/ApproxFun/src/Extras/show.jl:228
WARNING: Base.writemime is deprecated.
likely near /Users/solver/.julia/v0.6/ApproxFun/src/Extras/show.jl:228
WARNING: Base.writemime is deprecated.
likely near /Users/solver/.julia/v0.6/ApproxFun/src/Extras/show.jl:228
Multivariate tests
WARNING: the no-op `transpose` fallback is deprecated, and no more specific `transpose` method for ApproxFun.Fun{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Float64}},Float64} exists. Consider `permutedims(x, [2, 1])` or writing a specific `transpose(x::ApproxFun.Fun{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Float64}},Float64})` method if appropriate.
in depwarn(::String, ::Symbol) at ./deprecated.jl:64
in transpose(::ApproxFun.Fun{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Float64}},Float64}) at ./deprecated.jl:771
in *(::ApproxFun.ProductFun{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Float64}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Float64}},ApproxFun.TensorSpace{Tuple{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Float64}},ApproxFun.Ultraspherical{0,ApproxFun.Interval{Float64}}},ApproxFun.RealBasis,2},Float64}, ::ApproxFun.Evaluation{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Float64}},Bool,Float64}) at /Users/solver/.julia/v0.6/ApproxFun/src/PDE/PDE.jl:68
in include_from_node1(::String) at ./loading.jl:426 (repeats 2 times)
in process_options(::Base.JLOptions) at ./client.jl:262
in _start() at ./client.jl:318
while loading /Users/solver/.julia/v0.6/ApproxFun/test/MultivariateTest.jl, in expression starting on line 95
PDE tests
WARNING: sub is deprecated, use view instead.
in depwarn(::String, ::Symbol) at ./deprecated.jl:64
in sub(::BandedMatrices.BandedMatrix{Complex{Float64}}, ::UnitRange{Int64}, ::UnitRange{Int64}) at ./deprecated.jl:30
in resizedata!(::ApproxFun.MutableOperator{Complex{Float64},ApproxFun.PlusOperator{Complex{Float64}},ApproxFun.SavedFunctional{Complex{Float64},M<:ApproxFun.Functional}}, ::Int64) at /Users/solver/.julia/v0.6/ApproxFun/src/Operators/almostbanded/MutableOperator.jl:216
in adaptiveqr!(::ApproxFun.MutableOperator{Complex{Float64},ApproxFun.PlusOperator{Complex{Float64}},ApproxFun.SavedFunctional{Complex{Float64},M<:ApproxFun.Functional}}, ::Array{Complex{Float64},1}, ::Float64, ::Int64) at /Users/solver/.julia/v0.6/ApproxFun/src/Operators/adaptiveqr.jl:89
in adaptiveqr(::Array{ApproxFun.Operator{Complex{Float64}},1}, ::Array{Complex{Float64},1}, ::Float64, ::Int64) at /Users/solver/.julia/v0.6/ApproxFun/src/Operators/adaptiveqr.jl:81
in #linsolve#136(::Float64, ::Int64, ::Function, ::Array{ApproxFun.Operator{Complex{Float64}},1}, ::Array{Complex{Float64},1}) at /Users/solver/.julia/v0.6/ApproxFun/src/Operators/linsolve.jl:35
in (::ApproxFun.#kw##linsolve)(::Array{Any,1}, ::ApproxFun.#linsolve, ::Array{ApproxFun.Operator{Complex{Float64}},1}, ::Array{Complex{Float64},1}) at ./<missing>:0
in #linsolve#137(::Float64, ::Int64, ::Function, ::Array{ApproxFun.Operator{Complex{Float64}},1}, ::Array{Any,1}) at /Users/solver/.julia/v0.6/ApproxFun/src/Operators/linsolve.jl:121
in (::ApproxFun.#kw##linsolve)(::Array{Any,1}, ::ApproxFun.#linsolve, ::Array{ApproxFun.Operator{Complex{Float64}},1}, ::Array{Any,1}) at ./<missing>:0
in exp(::ApproxFun.Fun{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Float64}},Complex{Float64}}) at /Users/solver/.julia/v0.6/ApproxFun/src/Extras/specialfunctions.jl:392
in include_from_node1(::String) at ./loading.jl:426 (repeats 2 times)
in process_options(::Base.JLOptions) at ./client.jl:262
in _start() at ./client.jl:318
while loading /Users/solver/.julia/v0.6/ApproxFun/test/PDETest.jl, in expression starting on line 11
WARNING: super(T::DataType) is deprecated, use supertype(T) instead.
in depwarn(::String, ::Symbol) at ./deprecated.jl:64
in super(::DataType) at ./deprecated.jl:50
in eltype at /Users/solver/.julia/v0.6/ApproxFun/src/Operators/Operator.jl:18 [inlined] (repeats 3 times)
in kron(::Array{ApproxFun.Evaluation{ApproxFun.Ultraspherical{0,ApproxFun.Interval{Float64}},Bool,Float64},1}, ::UniformScaling{Int64}) at /Users/solver/.julia/v0.6/ApproxFun/src/PDE/KroneckerOperator.jl:295
in dirichlet(::ApproxFun.ProductDomain{Tuple{ApproxFun.Interval{Float64},ApproxFun.Interval{Float64}},Float64,2}) at /Users/solver/.julia/v0.6/ApproxFun/src/PDE/PDE.jl:49
in include_from_node1(::String) at ./loading.jl:426 (repeats 2 times)
in process_options(::Base.JLOptions) at ./client.jl:262
in _start() at ./client.jl:318
while loading /Users/solver/.julia/v0.6/ApproxFun/test/PDETest.jl, in expression starting on line 16
signal (4): Illegal instruction: 4
while loading /Users/solver/.julia/v0.6/ApproxFun/test/PDETest.jl, in expression starting on line 16
copy! at ./abstractarray.jl:471
kron at /Users/solver/.julia/v0.6/ApproxFun/src/PDE/KroneckerOperator.jl:295
dirichlet at /Users/solver/.julia/v0.6/ApproxFun/src/PDE/PDE.jl:49
jl_call_method_internal at /Users/solver/Projects/julia5/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /Users/solver/Projects/julia5/src/gf.c:1930
do_call at /Users/solver/Projects/julia5/src/interpreter.c:66
eval at /Users/solver/Projects/julia5/src/interpreter.c:205
do_call at /Users/solver/Projects/julia5/src/interpreter.c:65
eval at /Users/solver/Projects/julia5/src/interpreter.c:205
eval_body at /Users/solver/Projects/julia5/src/interpreter.c:481
jl_interpret_call at /Users/solver/Projects/julia5/src/interpreter.c:585
jl_toplevel_eval_flex at /Users/solver/Projects/julia5/src/toplevel.c:572
jl_parse_eval_all at /Users/solver/Projects/julia5/src/ast.c:717
jl_load at /Users/solver/Projects/julia5/src/toplevel.c:596 [inlined]
jl_load_ at /Users/solver/Projects/julia5/src/toplevel.c:605
include_from_node1 at ./loading.jl:426
jl_call_method_internal at /Users/solver/Projects/julia5/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /Users/solver/Projects/julia5/src/gf.c:1930
do_call at /Users/solver/Projects/julia5/src/interpreter.c:66
eval at /Users/solver/Projects/julia5/src/interpreter.c:205
jl_toplevel_eval_flex at /Users/solver/Projects/julia5/src/toplevel.c:558
jl_parse_eval_all at /Users/solver/Projects/julia5/src/ast.c:717
jl_load at /Users/solver/Projects/julia5/src/toplevel.c:596 [inlined]
jl_load_ at /Users/solver/Projects/julia5/src/toplevel.c:605
include_from_node1 at ./loading.jl:426
jl_call_method_internal at /Users/solver/Projects/julia5/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /Users/solver/Projects/julia5/src/gf.c:1930
process_options at ./client.jl:262
_start at ./client.jl:318
jl_call_method_internal at /Users/solver/Projects/julia5/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /Users/solver/Projects/julia5/src/gf.c:1930
true_main at /Users/solver/Projects/julia5/usr/bin/julia (unknown line)
main at /Users/solver/Projects/julia5/usr/bin/julia (unknown line)
Allocations: 93930074 (Pool: 93926192; Big: 3882); GC: 164
Illegal instruction: 4 |
This is julia> Pkg.status()
1 required packages:
- ApproxFun 0.2.0- bug-illinstruct (dirty)
25 additional packages:
- BandedMatrices 0.0.4
- BinDeps 0.4.2
- Calculus 0.1.15
- ColorTypes 0.2.6
- Colors 0.6.6
- Compat 0.8.6
- DualNumbers 0.2.2
- FastGaussQuadrature 0.0.3
- FastTransforms 0.0.4
- FixedPointNumbers 0.1.4
- FixedSizeArrays 0.2.2
- Iterators 0.1.10
- Measures 0.0.3
- NaNMath 0.2.1
- PlotUtils 0.0.4
- Plots 0.9.0
- RecipesBase 0.0.6
- Reexport 0.0.3
- Rmath 0.1.2
- SHA 0.2.1
- Showoff 0.0.7
- StatsBase 0.9.0
- StatsFuns 0.3.0
- ToeplitzMatrices 0.1.1
- URIParser 0.1.6 |
Thanks for checking. Looks like #17003, so this change might have just pushed the problem elsewhere. |
Sorry, checked the wrong issue. I'll give this a try for #18046 |
#17932 is now fixed, thanks!! |
Will this be backported to 0.5? |
@JeffBezanson I'm going to try this out to see if backporting it would fix Lora and ValueHistories, ref #18156. Can we merge this? @nanosoldier |
Something went wrong when running your job: |
Yes, this change isn't ideal but we should probably go with it to prevent spurious breakage. There will probably be a lot more work on #265 in 0.6 anyway. |
This is a possible fix fo #17932. @dlfivefifty could you test this?
This error has been seen in several places and is worrying since it's very difficult to work around.