OpenMathLib / OpenMathLib/OpenBLAS
Splitting gotoblas_t into parameters and kernels to re-use kernels between dynamic targets
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
This would greatly help with the competing demand of re-using our kernels between different cores with different parameters whilst not overly bloating the dynamic binary.
Looking at gotoblas_t (https://github.com/OpenMathLib/OpenBLAS/blob/develop/common_param.h#L1211), there are two parts, parameters such as:
int sgemm_p, sgemm_q, sgemm_r;
int sgemm_unroll_m, sgemm_unroll_n, sgemm_unroll_mn;
And function pointers, such as:
int (*sgemm_kernel )(BLASLONG, BLASLONG, BLASLONG, float, float *, float *, float *, BLASLONG);
int (*sgemm_beta )(BLASLONG, BLASLONG, BLASLONG, float, float *, BLASLONG, float *, BLASLONG, float *, BLASLONG);
The parameters take up far less space than all of the compiled kernels, so I'm proposing splitting gotoblas_t into openblas_kernels and openblas_params data structures. That would allow our dynamic logic to do something like this:
case NEOVERSEV1:
openblas_kernels = openblas_kernels_ARMV8SVE;
openblas_params = openblas_params_NEOVERSEV1;
This allows sensible defaults (such as the minimum cache size for a particular core should it not be queriable dynamically) without duplicating the kernels multiple times.
We can mark these with DYNAMIC_KERNELS and DYNAMIC_PARAMS in the Makefile, DYNAMIC_LIST would build both for all and DYNAMIC_ARCH would be our current favourites.
@martin-frbg, what do you think?
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
Beginne in common_param.h bei gotoblas_t und verfolge die Logik für dynamische Targets, die Kernel und Parameter auswählt. Untersuche anschließend die Makefile-Definitionen für DYNAMIC_KERNELS, DYNAMIC_PARAMS, DYNAMIC_LIST und DYNAMIC_ARCH. Als erledigt gilt die Aufgabe, wenn Parameter und Funktionszeiger separate Strukturen sind, dynamische Targets gemeinsam genutzte Kernel mit target-spezifischen Parametern kombinieren können und die vorhandenen Build-Modi weiterhin unterstützt werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c
- Bereich
- build-system, performance
- Issue-Typ
- Refactoring
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 25/100