OpenMathLib / OpenMathLib/OpenBLAS

OpenBLAS bottlenecks multithreading benefits in `symv.c` interface at 8 working threads due to memory allocator lock conflict

Aperta
#5,589 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C
Stelle
7.6k
Fork
1.7k
Merge medio
1g 3h
PR unite (30g)
42

Descrizione

I have code that heavily makes use of the LAPACK syevr functions via Julia. They're relatively small matrices (at most 15x15). I'm processing chunks of video frames across multiple threads, and each thread will perform millions of these operations. I've set BLAS threads to 1, which I understand to mean that OpenBLAS just uses the parent thread calling it. (Setting it to anything more than 1 tanks performance generally.)

However, what I've found is that no matter what size computer I run on, performance gains stop once I reach 8 working threads; even worsening with many more. Somehow it seems that OpenBLAS, without itself doing multithreaded computation, is interfering with higher-level multithreading?

If I switch to MKL with 1 thread, I see continued performance improvements through 48 CPUs.

I'm willing to poke around at this as much as I can myself, I'm just not sure where to begin. Where might the bottleneck be?

Image

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Iniziare dall’interfaccia symv.c e riprodurre il carico di lavoro segnalato usando LAPACK syevr su matrici piccole, con BLAS limitato a un solo thread. Confrontare la scalabilità al variare del numero di thread di lavoro con OpenBLAS e MKL, quindi determinare se un lock dell’allocatore o un altro collo di bottiglia di OpenBLAS spiega il plateau a otto thread.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c
Ambito
performance
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.