Dagger.jl icon indicating copy to clipboard operation
Dagger.jl copied to clipboard

Method ambiguity for simple Thunks

Open DrChainsaw opened this issue 4 years ago • 1 comments

Maybe this is a bug in Base? I will try look into it some more later tonight.

julia> t = Dagger.@par (() -> 1)()
Thunk[6](#17, ())

julia> collect(t)
ERROR: MethodError: defalg(::Vector{Union{}}) is ambiguous. Candidates:
  defalg(v::AbstractArray{<:Union{Missing, Number}}) in Base.Sort at sort.jl:658
  defalg(::AbstractArray{<:Union{Missing, InlineStrings.String1, InlineStrings.String15, InlineStrings.String3, InlineStrings.String7}}) in InlineStrings at \.julia\packages\InlineStrings\C5tOh\src\InlineStrings.jl:656
Possible fix, define
  defalg(::AbstractArray{<:Missing})
Stacktrace:
 [1] order(node::Thunk, ndeps::Dict{Thunk, Int64})
   @ Dagger \.julia\packages\Dagger\tbgym\src\compute.jl:169
 [2] compute_dag(ctx::Context, d::Thunk; options::Nothing)
   @ Dagger.Sch \.julia\packages\Dagger\tbgym\src\sch\Sch.jl:346
 [3] compute(ctx::Context, d::Thunk; options::Nothing)
   @ Dagger \.julia\packages\Dagger\tbgym\src\compute.jl:31
 [4] collect(ctx::Context, t::Thunk; options::Nothing)
   @ Dagger \.julia\packages\Dagger\tbgym\src\compute.jl:8
 [5] #collect#136
   @ \.julia\packages\Dagger\tbgym\src\compute.jl:10 [inlined]
 [6] collect(d::Thunk)
   @ Dagger \.julia\packages\Dagger\tbgym\src\compute.jl:10
 [7] top-level scope
   @ REPL[21]:1

julia> versioninfo()
Julia Version 1.7.0
Commit 3bf9d17731 (2021-11-30 12:12 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 8

DrChainsaw avatar Dec 07 '21 14:12 DrChainsaw

This still happens in other places in the Dagger codebase, but it's a Base/InlineStrings thing to resolve. Mostly happens due to having CSV.jl loaded

Reopening until fully resolved https://github.com/JuliaLang/julia/pull/43426

krynju avatar Dec 18 '21 16:12 krynju