Skip to content
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

getproperty doesn't satisfy the Tables.jl AbstractRow interface with Distributed #52

Closed
StevenWhitaker opened this issue Sep 14, 2023 · 1 comment
Labels
bug Something isn't working upstream

Comments

@StevenWhitaker
Copy link

StevenWhitaker commented Sep 14, 2023

I get the error mentioned in the title with the following example. I'm not sure if it's related to JuliaParallel/Dagger.jl#431, so I'm doing a separate issue.

Contents of mwe.jl:

using Distributed, DelimitedFiles
nworkers = 1
addprocs(nworkers - nprocs() + 1)

@everywhere using CSV, DTables, DataFrames

file = tempname() * ".csv"
writedlm(file, [1, 2])

# See issue JuliaParallel/Dagger.jl#431 for the purpose of this next line.
DTable(x -> CSV.File(x), [file]; tabletype = DataFrame)

remotecall_fetch(2, file) do f
    d = DTable(x -> CSV.File(x), [f]; tabletype = DataFrame)
    getproperty(d, Symbol("1"))
end

rm(file)

Results:

julia> include("mwe.jl")
Error in eager scheduler:
On worker 2:
ArgumentError: 'Tuple{Bool, Tables.Schema{(Symbol("1"),), Tuple{Int64}}}' iterates 'Bool' values, which doesn't satisfy the Tables.jl `AbstractRow` interface
Stacktrace:
  [1] invalidtable
    @ ~/.julia/packages/Tables/AcRIE/src/tofromdatavalues.jl:41
  [2] iterate
    @ ~/.julia/packages/Tables/AcRIE/src/tofromdatavalues.jl:47 [inlined]
  [3] buildcolumns
    @ ~/.julia/packages/Tables/AcRIE/src/fallbacks.jl:209 [inlined]
  [4] _columns
    @ ~/.julia/packages/Tables/AcRIE/src/fallbacks.jl:274 [inlined]
  [5] columns
    @ ~/.julia/packages/Tables/AcRIE/src/fallbacks.jl:258 [inlined]
  [6] getcolumn_chunk
    @ ~/.julia/packages/DTables/bA4g3/src/table/dtable_column.jl:12
  [7] JuliaParallel/DTables.jl#36
    @ ~/.julia/packages/DTables/bA4g3/src/table/dtable_column.jl:23
  [8] #invokelatest#2
    @ ./essentials.jl:819 [inlined]
  [9] invokelatest
    @ ./essentials.jl:816 [inlined]
 [10] JuliaParallel/DTables.jl#43
    @ ~/.julia/packages/Dagger/xGAvM/src/processor.jl:162
Stacktrace:
  [1] wait
    @ ./task.jl:349 [inlined]
  [2] fetch
    @ ./task.jl:369 [inlined]
  [3] #execute!#42
    @ ~/.julia/packages/Dagger/xGAvM/src/processor.jl:172
  [4] execute!
    @ ~/.julia/packages/Dagger/xGAvM/src/processor.jl:157
  [5] #156
    @ ~/.julia/packages/Dagger/xGAvM/src/sch/Sch.jl:1552 [inlined]
  [6] JuliaParallel/DTables.jl#21
    @ ~/.julia/packages/Dagger/xGAvM/src/options.jl:17
  [7] with_logstate
    @ ./logging.jl:514
  [8] with_logger
    @ ./logging.jl:626 [inlined]
  [9] with_task_ctxvars
    @ ~/.julia/packages/ContextVariablesX/ujYRr/src/payloadlogger.jl:16
 [10] with_context
    @ ~/.julia/packages/ContextVariablesX/ujYRr/src/ContextVariablesX.jl:336
 [11] with_options
    @ ~/.julia/packages/Dagger/xGAvM/src/options.jl:16
 [12] do_task
    @ ~/.julia/packages/Dagger/xGAvM/src/sch/Sch.jl:1550
 [13] macro expansion
    @ ~/.julia/packages/Dagger/xGAvM/src/sch/Sch.jl:1244 [inlined]
 [14] #130
    @ ./task.jl:134
Stacktrace:
 [1] (::Dagger.Sch.var"#91#92"{Dagger.Context, Dagger.Sch.ComputeState, Dagger.OSProc, NamedTuple{(:time_pressure, :storage_pressure, :storage_capacity, :loadavg, :threadtime, :gc_allocd, :transfer_rate), Tuple{UInt64, UInt64, UInt64, Tuple{Float64, Float64, Float64}, UInt64, Int64, UInt64}}, RemoteException, Int64, Dagger.ThreadProc, Int64})()
   @ Dagger.Sch ~/.julia/packages/Dagger/xGAvM/src/sch/Sch.jl:541
 [2] lock(f::Dagger.Sch.var"#91#92"{Dagger.Context, Dagger.Sch.ComputeState, Dagger.OSProc, NamedTuple{(:time_pressure, :storage_pressure, :storage_capacity, :loadavg, :threadtime, :gc_allocd, :transfer_rate), Tuple{UInt64, UInt64, UInt64, Tuple{Float64, Float64, Float64}, UInt64, Int64, UInt64}}, RemoteException, Int64, Dagger.ThreadProc, Int64}, l::ReentrantLock)
   @ Base ./lock.jl:229
 [3] scheduler_run(ctx::Dagger.Context, state::Dagger.Sch.ComputeState, d::Dagger.Thunk, options::Dagger.Sch.SchedulerOptions)
   @ Dagger.Sch ~/.julia/packages/Dagger/xGAvM/src/sch/Sch.jl:525
 [4] compute_dag(ctx::Dagger.Context, d::Dagger.Thunk; options::Dagger.Sch.SchedulerOptions)
   @ Dagger.Sch ~/.julia/packages/Dagger/xGAvM/src/sch/Sch.jl:449
 [5] compute_dag
   @ ~/.julia/packages/Dagger/xGAvM/src/sch/Sch.jl:414 [inlined]
 [6] compute(ctx::Dagger.Context, d::Dagger.Thunk; options::Dagger.Sch.SchedulerOptions)
   @ Dagger ~/.julia/packages/Dagger/xGAvM/src/compute.jl:23
 [7] compute
   @ ~/.julia/packages/Dagger/xGAvM/src/compute.jl:22 [inlined]
 [8] macro expansion
   @ ~/.julia/packages/Dagger/xGAvM/src/sch/eager.jl:28 [inlined]
 [9] (::Dagger.Sch.var"#50#51"{Dagger.Context})()
   @ Dagger.Sch ./threadingconstructs.jl:410
ERROR: LoadError: On worker 2:
SchedulingException (Scheduler exited)
Stacktrace:
  [1] #fetch#70
    @ ~/.julia/packages/Dagger/xGAvM/src/eager_thunk.jl:16
  [2] fetch
    @ ~/.julia/packages/Dagger/xGAvM/src/eager_thunk.jl:11 [inlined]
  [3] #fetch#75
    @ ~/.julia/packages/Dagger/xGAvM/src/eager_thunk.jl:58 [inlined]
  [4] fetch
    @ ~/.julia/packages/Dagger/xGAvM/src/eager_thunk.jl:54 [inlined]
  [5] DTableColumn
    @ ~/.julia/packages/DTables/bA4g3/src/table/dtable_column.jl:21
  [6] DTableColumn
    @ ~/.julia/packages/DTables/bA4g3/src/table/dtable_column.jl:35
  [7] DTableColumn
    @ ~/.julia/packages/DTables/bA4g3/src/table/dtable_column.jl:37 [inlined]
  [8] getproperty
    @ ~/.julia/packages/DTables/bA4g3/src/table/dtable.jl:291 [inlined]
  [9] JuliaParallel/DTables.jl#7
    @ ~/tmp/mwe.jl:15
 [10] #invokelatest#2
    @ ./essentials.jl:819
 [11] invokelatest
    @ ./essentials.jl:816
 [12] #110
    @ ~/programs/julia/julia-1.9.3/share/julia/stdlib/v1.9/Distributed/src/process_messages.jl:285
 [13] run_work_thunk
    @ ~/programs/julia/julia-1.9.3/share/julia/stdlib/v1.9/Distributed/src/process_messages.jl:70
 [14] macro expansion
    @ ~/programs/julia/julia-1.9.3/share/julia/stdlib/v1.9/Distributed/src/process_messages.jl:285 [inlined]
 [15] #109
    @ ./task.jl:514
Stacktrace:
 [1] remotecall_fetch(f::Function, w::Distributed.Worker, args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Distributed ~/programs/julia/julia-1.9.3/share/julia/stdlib/v1.9/Distributed/src/remotecall.jl:465
 [2] remotecall_fetch(f::Function, w::Distributed.Worker, args::String)
   @ Distributed ~/programs/julia/julia-1.9.3/share/julia/stdlib/v1.9/Distributed/src/remotecall.jl:454
 [3] #remotecall_fetch#162
   @ ~/programs/julia/julia-1.9.3/share/julia/stdlib/v1.9/Distributed/src/remotecall.jl:492 [inlined]
 [4] remotecall_fetch(f::Function, id::Int64, args::String)
   @ Distributed ~/programs/julia/julia-1.9.3/share/julia/stdlib/v1.9/Distributed/src/remotecall.jl:492
 [5] top-level scope
   @ ~/tmp/mwe.jl:13
 [6] include(fname::String)
   @ Base.MainInclude ./client.jl:478
 [7] top-level scope
   @ REPL[1]:1
in expression starting at /home/steven/tmp/mwe.jl:13

(tmp) pkg> st
Status `~/tmp/Project.toml`
  [336ed68f] CSV v0.10.11
  [20c56dc6] DTables v0.4.1
  [a93c6f00] DataFrames v1.6.1
  [8bb1440f] DelimitedFiles v1.9.1
  [8ba89e20] Distributed

Note that the above error message only shows if I change line 543 in src/sch/Sch.jl in Dagger.jl from thunk_failed = true to throw(res). (I filed JuliaParallel/Dagger.jl#430 about this.)

Let me know if I'm missing anything or if I'm doing something wrong.

@StevenWhitaker StevenWhitaker changed the title getproperty doesn't satisfy the Tables.jl AbstractRow interface with Distributed getproperty doesn't satisfy the Tables.jl \AbstractRow\ interface with Distributed Sep 14, 2023
@StevenWhitaker StevenWhitaker changed the title getproperty doesn't satisfy the Tables.jl \AbstractRow\ interface with Distributed getproperty doesn't satisfy the Tables.jl AbstractRow interface with Distributed Sep 14, 2023
@jpsamaroo
Copy link
Member

This now works for me with Dagger 0.18.3 (just released); it appears it was the Dagger bug that was fixed by JuliaParallel/Dagger.jl#436. Thanks for all the issue reports!

@jpsamaroo jpsamaroo added bug Something isn't working upstream labels Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

2 participants