Skip to content

Method ambiguity for simple Thunks #314

@DrChainsaw

Description

@DrChainsaw

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions