Matrix-Matrix multiply is quite slow
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- julia
- Ambito
- distributed-systems, performance
Direzione di ricerca
Inizia eseguendo il benchmark Julia fornito con Distributed, DistributedArrays e LinearAlgebra, quindi segui il distribute path utilizzato dalla moltiplicazione di matrici. L’issue menziona problemi di comunicazione, allocazione temporanea, event-loop, socket e memoria condivisa, ma non indica file sorgente o test. Per considerarlo completato servirebbe una correzione circoscritta del collo di bottiglia con evidenze ottenute dai benchmark su dimensioni di matrici e sistemi pertinenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
While looking with @yingboma into getting a PDE solved just by using DArray we encountered that matrix-matrix multiply is quite slow in DArray.
From discussion with @andreasnoack
-
Distributedcurrently has nofetch!e.g. a fetch into a localarray, it is therefore hard to avoid temporaries when working across processes. This causes many copies and requires GC work which creates communication bottlenecks. -
Our communication layer doesn't support RDMA so there are copies happening in the network-stack, and we use sockets instead of shared memory for commincation on the same node.
-
There are some communications bottlenecks due to how we use the event-loop and it is feasible to to get into a situation where forward progress is hard to make due a machine being busy with computation and not communicating in a timely fashion.
using Distributed
addprocs(4)
using LinearAlgebra
# Set worker BLAS to one thread onlye
@sync for p in workers()
@async remotecall_wait(LinearAlgebra.BLAS.set_num_threads, p , 1)
end
using BenchmarkTools
using DistributedArrays
const suite = BenchmarkGroup()
suite["Array"] = BenchmarkGroup()
suite["distribute"] = BenchmarkGroup()
function benchmark(T=Array, N=10)
@benchmarkable A * B setup=(A = $T(rand($N, $N)); B = $T(rand($N, $N)))
end
for N in (2^i for i = 5:13)
suite["Array"][N] = benchmark(Array, N)
suite["distribute"][N] = benchmark(distribute, N)
end
tune!(suite)
results = run(suite)
I would be interested in gathering numbers from different systems here. My first set of results is from just my local laptop with 2 Cores - 4 Threads and using 4 Julia processes.
There is a lot of overhead for smallish problems, but the results aren't that bad once we get to interesting problem sizes...
julia> for (name, trial) in sort(collect(results["Array"]), by=x->time(x[2]))
t = time(trial) / 1e6
println(rpad(name, 25, "."), lpad(string(round(t, digits=2), " ms"), 20, "."))
end
32.....................................0.0 ms
64....................................0.02 ms
128...................................0.06 ms
256...................................0.41 ms
512...................................3.51 ms
1024.................................24.51 ms
2048................................249.21 ms
4096...............................2226.76 ms
8192..............................18990.07 ms
julia> for (name, trial) in sort(collect(results["distribute"]), by=x->time(x[2]))
t = time(trial) / 1e6
println(rpad(name, 25, "."), lpad(string(round(t, digits=2), " ms"), 20, "."))
end
32....................................2.01 ms
64....................................2.06 ms
128...................................2.32 ms
256...................................2.97 ms
512...................................6.63 ms
1024..................................34.2 ms
2048................................261.15 ms
4096...............................2295.89 ms
8192..............................17112.45 ms
- Lingua principale
- Julia
- Stelle
- 205
- Fork
- 34
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di JuliaParallel/DistributedArrays.jl
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
JuliaParallel/DistributedArrays.jl#255 · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
JuliaParallel/DistributedArrays.jl#239 · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
JuliaParallel/DistributedArrays.jl#238 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
Tutte le issue di JuliaParallel/DistributedArrays.jl
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
JuliaParallel/Hwloc.jl#93 ·
-
Affine transformations of `JohnsonSU` could return a `JohnsonSU`Forse già presa @devmotion l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
JuliaStats/Distributions.jl#2117 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
TomerAberbach/profiler-md#970 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
grame-cncm/faust#1409 ·
I maintainer di solito rispondono entro 1 giorno