JuliaGPU / DaggerGPU.jl

GPU integrations for Dagger.jl
Other
50 stars 11 forks source link

`UndefVarError: ThreadProc not defined` #6

Closed ali-ramadhan closed 4 years ago

ali-ramadhan commented 4 years ago

Was trying to set up a small benchmark to see if I can launch a bunch of Oceananigans.jl simulations using DaggerGPU.jl, but encountered an error when calling DaggerGPU.processor(:CUDA), something I took from the runtests.jl file that seemed necessary.

Script:

using Distributed

n_procs = 16
procs = Distributed.addprocs(n_procs)

@everywhere begin
    using CUDA
    using Dagger
    using DaggerGPU
    using Oceananigans
end

@everywhere function vast_empty_ocean(arch, N, Nt, Δt)
    @info "Worker $(myid()) is spinning up..."
    grid = RegularCartesianGrid(size=(N, N, N), extent=(1, 1, 1))
    model = IncompressibleModel(architecture=arch, grid=grid)
    [time_step!(model, Δt) for _ in 1:Nt]
    return model.clock.time
end

cuproc = DaggerGPU.processor(:CUDA)
opts = Dagger.Sch.ThunkOptions(;proctypes=[cuproc])

ctx = Dagger.Context()
addprocs!(ctx, procs)
thunk = Dagger.delayed(vcat, options=opts)((Dagger.delayed(vast_empty_ocean, options=opts)(GPU(), 128, 10000, n) for n in 1:n_procs)...)
job = @async collect(ctx, thunk)
@time result = fetch(job)

Distributed.workers() |> Distributed.rmprocs

Error:

ERROR: LoadError: UndefVarError: ThreadProc not defined
Stacktrace:
 [1] getproperty at ./Base.jl:26 [inlined]
 [2] processor at /home/alir/.julia/packages/DaggerGPU/NiekK/src/DaggerGPU.jl:19 [inlined]
 [3] processor(::Symbol) at /home/alir/.julia/packages/DaggerGPU/NiekK/src/DaggerGPU.jl:18
 [4] top-level scope at /home/alir/tmp/dagger/daggergpu_oceananigans.jl:21
 [5] include(::String) at ./client.jl:457
 [6] top-level scope at REPL[1]:1
in expression starting at /home/alir/tmp/dagger/daggergpu_oceananigans.jl:21

Version info:

julia> versioninfo()
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) Silver 4214 CPU @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, cascadelake)

Environment:

  [fbb218c0] BSON v0.2.6
  [6e4b80f9] BenchmarkTools v0.5.0
  [052768ef] CUDA v1.3.3
  [8f4d0f93] Conda v1.4.1
  [d58978e5] Dagger v0.8.0
  [68e73e28] DaggerGPU v0.1.0
  [a93c6f00] DataFrames v0.21.8
  [85f8d34a] NCDatasets v0.10.4
  [9e8cae18] Oceananigans v0.43.0
  [08abe8d2] PrettyTables v0.9.1 `https://github.com/ronisbr/PrettyTables.jl.git#master`
  [438e738f] PyCall v1.92.1
  [d330b81b] PyPlot v2.9.0
  [a759f4b9] TimerOutputs v0.5.6
ali-ramadhan commented 4 years ago

Just had to update to DaggerGPU v0.1.1 (via ] add DaggerGPU#master). Thanks @jpsamaroo!