OpenMathLib / OpenMathLib/OpenBLAS

Denormal floats handling

Ouverte
#1,237 42 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
C
Étoiles
7.6k
Forks
1.7k
Merge moyen
1 j 3 h
PR mergées (30 j)
42

Description

Dear @xianyi and everyone!

Is there a way to forbid denormals in the OpenBLAS?

I tried to execute the following code (MSVC2015) before calling any OpenBLAS routines:

	unsigned int current_word = 0;
	_controlfp_s(&current_word, _DN_FLUSH, _MCW_DN);
	_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
	_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);

and it looked like it worked for some time (about a year)... Does it really affect OpenBLAS denormals handling (especially inside worker threads)?

I started to use some additional OpenBLAS functions and noticed that denormals started to reappear in results again and that extremely slows down computations. I'm heavily suspecting that it is the OpenBLAS, who is responsible for them. Probably, the worker threads might still have enabled denormals?...

How to get rid of them?

I'm using precompiled OpenBLAS-v0.2.19-Win64-int32.

Here is the complete list of used functions (if it helps):

  • cblas_sgemm
  • cblas_ssyrk
  • cblas_ssymm
  • LAPACKE_sgesvd

UPD: indeed, cblas_ssyrk() is a first function which produces the first denormalized float during execution... :-(

How to change denormals behaviour?

May be there is a (reachable from outside) way to execute custom code in context of OpenBLAS's worker threads if there's no predefined way to control denormals?

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par cblas_ssyrk(), identifiée comme la première fonction produisant un float dénormalisé, et examinez comment les threads workers d’OpenBLAS sont initialisés. Reproduisez le comportement avec les appels CBLAS et LAPACKE indiqués dans le build Windows précompilé, puis déterminez si la gestion des valeurs dénormalisées est conservée dans les threads workers. Le travail est terminé lorsque le comportement est expliqué et qu’une méthode documentée ou testée pour le contrôler a été identifiée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
c
Domaine
hpc
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.