It seems impossible to pin the threads
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- c
- Domaine
- performance
Piste de recherche
Commencez par reproduire le rapport avec OpenBLAS 0.3.30 et la configuration hwloc présentée, en vous concentrant sur openblas_setaffinity et openblas_set_num_threads. Vérifiez comment NO_AFFINITY, OPENBLAS_NUM_THREADS et les appels d’affinité interagissent dans la configuration indiquée. Le travail est considéré comme terminé lorsqu’il est déterminé si le comportement résulte d’une mauvaise utilisation ou d’un bug et que le comportement attendu de l’affinité des threads est documenté, ou lorsqu’un défaut reproductible est identifié.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
I have tried many methods to pin OpenBLAS threads (for microbenchmark purpose), but none of the implied methods work. I have tried every combination of:
NO_AFFINITY=1orNO_AFFINITY=0OPENBLAS_NUM_THREADSGOTOBLAS_MAIN_FREE,OPENBLAS_MAIN_FREEopenblas_set_num_threadsbefore any call, right before set affinity, and after set affinity.openblas_setaffinitywithcpuset_tthat are known to be correct on other microbenchmarks.- Whether I pin the main thread or not.
No matter what I do, OpenBLAS uses more threads than I allow it, except in the one case of setting OPENBLAS_NUM_THREADS. It seems like it just automatically increases the amount of threads to use all hyperthreads on the physical cores, sometimes more.
How exactly does the OpenBlas thread affinity work? Am I supposed to set NO_AFFINITY to 1 or 0? Does openblas_set_num_threads have any effects in run time?
Here's my config:
OpenBLAS 0.3.30 NO_AFFINITY HASWELL MAX_THREADS=28
This is how I pin the threads (using hwloc):
for (int i = 0; i < threads; ++i) {
int core = i;
int ht = pin_offset;
hwloc_obj_t core_obj = hwloc_get_obj_by_type(topo, HWLOC_OBJ_CORE, core);
if (!core_obj) {
fprintf(stderr, "Failed to get core\n");
exit(1);
}
hwloc_obj_t ht_obj = hwloc_get_obj_below_by_type(topo, HWLOC_OBJ_CORE,
core, HWLOC_OBJ_PU, ht);
if (!ht_obj) {
fprintf(stderr, "Failed to get thread\n");
exit(1);
}
fprintf(stderr, "Logical core [%d:%d] is physical [%d:%d]\n", core, ht,
core_obj->os_index, ht_obj->os_index);
cpu_set_t cpu_set;
CPU_ZERO(&cpu_set);
hwloc_cpuset_to_glibc_sched_affinity(topo, ht_obj->cpuset, &cpu_set,
sizeof(cpu_set));
if (openblas_setaffinity(i, sizeof(cpu_set_t), &cpu_set)) {
perror("openblas_setaffinity()");
exit(1);
}
}
Is this a bug? A misuse? I have no idea.
- Langage dominant
- C
- Étoiles
- 7.6k
- Forks
- 1.7k
- Merge moyen
- 1 j 11 h
- PR mergées (30 j)
- 53
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de OpenMathLib/OpenBLAS
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
OpenMathLib/OpenBLAS#6119 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
openblas_set_threads_callback_function is a silent no-op on WindowsPeut-être pris @martin-frbg l’a pris il y a 6 jours. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 43/100
OpenMathLib/OpenBLAS#6108 · 2 commentaires · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 43/100
OpenMathLib/OpenBLAS#6107 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
OpenMathLib/OpenBLAS#6104 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 58/100
OpenMathLib/OpenBLAS#6103 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de OpenMathLib/OpenBLAS
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
FriendsofECCE/ECCE#336 · 1 commentaire ·
-
mediatek/filogic: OpenFi 6C (openfi,6c): func key has wrong polarity, event class and key codeOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
immortalwrt/immortalwrt#2501 ·
-
Taisei fails to build on BSD because the bundled openlibm is compiled with `-D_ANSI_SOURCE`.Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
taisei-project/taisei#454 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100