Matrix-Matrix multiply is quite slow
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- julia
研究方向
先使用 Distributed、DistributedArrays 和 LinearAlgebra 執行提供的 Julia benchmark,然後追蹤矩陣乘法所使用的 distribute path。該 issue 提到 communication、temporary allocation、event-loop、socket 和 shared-memory 方面的問題,但沒有指出原始碼檔案或測試。若要視為完成,必須針對瓶頸進行範圍明確的修正,並提供涵蓋相關矩陣大小與系統的 benchmark 證據。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- Julia
- 星號
- 205
- 分支
- 34
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
JuliaParallel/DistributedArrays.jl 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 35/100
JuliaParallel/DistributedArrays.jl#255 · 1 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 45/100
JuliaParallel/DistributedArrays.jl#239 · 1 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 45/100
JuliaParallel/DistributedArrays.jl#238 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 35/100
-
難度 4/5 3-5 天 新手友好度 30/100
查看 JuliaParallel/DistributedArrays.jl 的全部 Issue
相似的 Issue
-
docs
難度 1/5 1 小時以內 新手友好度 88/100
-
path: splitext treats directory references and leading dots as extensions可能已有人在做 @Hiten0305l 今天認領。 未關閉
難度 2/5 半天 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
JuliaRegistries/RegistryCI.jl#758 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
JuliaParallel/Hwloc.jl#93 ·
-
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆