OpenMathLib / OpenMathLib/OpenBLAS
cblas_simatcopy: poor performance/avx512 instructions not supported
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C
- Sterne
- 7.6k
- Forks
- 1.7k
- Ø Merge
- 1 T. 3 Std.
- Gemergte PRs (30 T.)
- 42
Beschreibung
Good afternoon,
I was trying to compare the cblas_simatcopy routine against intel-mkl equivalent and noticed this routine is performing very poorly. I would like to understand if these performance issues were caused by me or if they are inherent to this BLAS implementation.
I've called the routine as defined in intel-mkl documentation:
cblas_simatcopy(CblasRowMajor /* row-major ordering /,
CblasTrans / A will be transposed /,
n / rows /,
n / cols /,
1. / scales the input matrix /,
src / source matrix /,
n / src_stride /,
n / dst_stride */);
I performed some tests on a Intel(R) Core(TM) i9-10980XE CPU @ 3.00GHz with GCC version 9.3.1 20200408 (Red Hat 9.3.1-2).
The following sequential execution times were obtained for input matrices of size 8000x8000:
cblas_simatcopy -> 0.117561 seconds
mkl_simatcopy -> 0.047644 seconds
The performance of cblas_simatcopy seems to worsen in a multi-threaded environment (same input matrix):
2 cores -> 0.117933 seconds
4 cores -> 0.166409 seconds
8 cores -> 0.198745 seconds
The number of threads was selected using openblas_set_num_threads(num_threads).
Furthermore I've analyzed the asm file generated by cblas_simatcopy and no zmm register was found, which implies no avx512 instruction was used. My processor, however, can support avx512 instruction and so does my compiler version.
My source code follows in attachment.
Thanks in advance for any insight!
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit der angehängten Datei simat_cblas.txt und dem Aufruf von cblas_simatcopy, und reproduzieren Sie anschließend die gemeldeten Laufzeiten auf dem Intel i9-10980XE mit unterschiedlichen OpenBLAS-Threadanzahlen. Untersuchen Sie die generierte Assembly auf AVX512-Instruktionen und vergleichen Sie die Ergebnisse mit einem und mit mehreren Threads. Als abgeschlossen gilt die Aufgabe, wenn die Ursache für die fehlende AVX512-Nutzung und die schlechte Skalierung identifiziert und dokumentiert oder behoben wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c
- Bereich
- performance
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100