-
Notifications
You must be signed in to change notification settings - Fork 1.6k
OpenBLAS built with USE_OPENMP=1 for windows 64 bit #1989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It is just adding USE_OPENMP=1 to make command line. It will use gomp , not native omp, so other programs need to use gomp |
Hi! maybe you can explain what I'm doing wrong...I did the following:
What am I doing wrong? Thank you! |
You do everything correctly. |
The essence of problem is tat perl.exe invoked from make.exe finds different versions of core perl modules because of PERL5LIB vatiable pointing to other perl installation and justly rejects to load those. |
What is the easiest way to resolve this issue? don't understand what you mean when you say "try to make it appear before mingw/cygwin perl in path". |
This is my PATH (printed with cmd): C:\msys\1.0\bin and C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_ v6-rev0\mingw64\bin appear twice...C:\Windows\System32\WindowsPowerShell\v1.0 appears three times... |
What is inside PERL5LIB variable? |
What was done for sf.net libraries: |
@brada4 reverting that is not so easy now that the temporary file is also needed on x86_64 (AVX512 compatibility test). I will check later if conditional loading is possible (tried it once and did not get it to work, but my perl is a bit rusty), but I suspect File::Basename (used in the cross-compile check) will be equally problematic when PERL5LIB points to a conflicting or incomplete module collection. |
@martin-frbg I know it. Though no idea how to detect problem "safely" |
What is the MSYS command to print the PERL5LIB variable? this is my perl include path: $ perl -e "print qq(@inc)" Thank you! |
If I clear the user PATH variable and put C:\msys\1.0\bin before C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_ v6-rev0\mingw64\bin in Path system variable I get the same error...my Path system variable is now: PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\msys\1.0\bin;C: |
|
This is perl, v5.6.1 built for msys Copyright 1987-2001, Larry Wall Perl may be copied only under the terms of either the Artistic License or the Complete documentation for Perl, including FAQ lists, should be found on
Thank you! |
Sorry, I guess I should have been more verbose - the idea with the c_check file is to replace the c_check file in the OpenBLAS folder with it and retry the build. (c_check is called by one of the Makefiles and expects a number of arguments, including the name of the C compiler, so running it on its own is not really expected to work) |
Replaced the c_check file and this is the new error with make: |
Weird. Apparently it managed to load the File::Temp module, but for some reason it does not work. |
Disabled the function that needs the File::Temp module on Cygwin (this is "only" needed on Skylake X |
New error: |
Hm. Same error, just pushed down one line by the added "if". My mistake, should have tested for OS_CYGWIN_NT rather than just CYGWIN_NT... |
New error (I think it is the same error): |
Disabling the test on "OS_WINNT" (anything Microsoft) now |
Wait, should have been "WiNNT" in the code... |
No error, finally it is doing something :) if it builds with no errors should I try $ make USE_OPENMP=1? Thank you! |
Yes, but please do |
It just finished building, this is the final lines of the output: OS ... WINNT To install the library, you can run "make PREFIX=/path/to/your/installation inst Trying again with $ make clean and then $ make USE_OPENMP=1... |
Finished building with $ make USE_OPENMP=1, these are the final lines of the output: OS ... WINNT Use OpenMP in the multithreading. Because of ignoring OPENBLAS_NUM_THREADS and To install the library, you can run "make PREFIX=/path/to/your/installation inst When I compiled it said that it did not find cblas_mangling.h (this file was not generated with the build, it only generated lapacke_mangling.h, lapacke_mangling_with_flags.h.in & cblas_mangling_with_flags.h.in). I fixed the problem by renaming cblas_mangling_with_flags.h.in to cblas_mangling.h (added cblas_mangling.h to include folder). Everything works now...compiled with: The academy is happy to announce that you have just won the Windows Golden Build award :) Final question, is OpenBLAS now single threaded with USE_OPENMP=1 build? goto_set_num_threads() & openblas_set_num_threads() are disabled? Thank you for your help!!! |
The thread management functions are still there, just that one swallows parameter and other returns number one, so that libs are drop-in replacement for eachother. |
@thedude2019 the USE_OPENMP=1 just tells it to use OpenMP for thread management, it will still be multithreaded (with the number of threads autodetected from the number of cores in the system you built it on). Only the environment variable for setting the number of threads has changed. |
@martin-frbg suggestion is to stick to generic BLAS API-s only. |
Test case is sufficient to try to profile on Linux either way. |
Can you run a test with your Linux system? I only have a windows system...with the default settings of the latest BLAS & OpenBLAS releases I get a better result with BLAS, LAPACK, & LAPACKE (with OpenMP). I will run another test with openblas_set_num_threads(1) & num_threads(4) with the OpenBLAS USE_OPENMP=1 build. Thank you! |
2 variables just a tip how you may speed it up, sure i will try your test case |
When I add openblas_set_num_threads(1) and compile with: Thank you! |
That is defined in (openblas header) cblas.h, since you do not include the file, I suggested to use external variables. |
computation is dominated (60-70%) by dsymv, there is no difference if blas or caller is threaded or not. About 1% thread management overhead adds if threaded without significant change in total run time. |
If I add the header cblas.h to the code I get the same warning...I'm attaching the cblas.h of your latest release built with USE_OPENMP=1 (OpenBLAS 0.3.5). So what your saying is that because dsymv is a LAPACK function and OpenBLAS is a BLAS optimization I don't see better results? Thank you! |
I think I understand what you mean, LAPACK calls BLAS (or OpenBLAS) but dsymv is still the bottleneck of the computation. |
... _symv which does not do much computation and essentially bottlenecks against memory bandwidth on modern machines.... |
I've replaced LAPACKE_dsyev with LAPACKE_dsyev_2stage (doesn't have dsymv) and it finished in 619.5 s instead of 2361.8 s (OpenBLAS with OpenMP). will compare the three again...have you looked at the cblas header of the latest release? |
What you uploaded appears to be the cblas.h of the reference implementation, not the one that comes with OpenBLAS ? (The OpenBLAS source contains both, as it incorporates all of "lapack-netlib" although it does not build or use the BLAS or CBLAS parts - the one that gets installed should be from the toplevel folder, not from lapack-netlib/CBLAS/include) |
Yes, replaced the build cblas.h with the package cblas.h and also added all the header files from the package to the include folder and I get a very long error output...attached the error. Thank you! |
That is your problem right there - most of these headers are internal and not meant to be included from other programs. Only cblas.h, f77blas.h, lapacke.h, lapacke_config.h, lapacke_mangling.h, lapacke_utils.h and openblas_config.h should get installed. |
After I renamed openblas_config_template.h to openblas_config.h (it also compiles after renaming config.h to openblas_config.h) it compiles without errors with the files you mentioned. I also had to add cblas_mangling.h to the include folder as mentioned previously. Which file should I rename to openblas_config.h, openblas_config_template.h or config.h? Thank you! |
Normally that would happen in the
|
And the cblas_mangling.h is only required by the (unused) netlib version of cblas.h, not by the OpenBLAS cblas.h so you would not normally need to copy it to the include folder. |
I made a mistake...I can't compile with the package cblas.h, I can only compile with lapack-netlib cblas.h & cblas_mangling.h...the build does not generate openblas_config.h and if I paste config.h & openblas_config_template.h in one file and rename to openblas_config.h (and compile with package cblas.h) there is still a header error. Attached config.h & openblas_config_template.h build files. Thank you! |
Finished to compare LAPACKE_dsyev_2stage with the three builds:
OpenBLAS is definitely faster...is it crucial to work with the package cblas.h? results with lapack-netlib cblas.h & cblas_mangling.h (without openblas_config.h) are very good. |
The only relevant difference in the OpenBLAS cblas.h is the addition of the prototypes for the openblas-specific utility functions like openblas_set_num_threads(), if you do not use them your current setup should be sufficient. (Not sure why copying the two files together to create openblas_config.h did not work for you though, perhaps you did not add the OPENBLAS_VERSION line ?) |
Can you send me the combined openblas_config.h file so I can test? this is what I put in the include folder: Thank you! |
Ah, I forgot that the constants from the initial config.h get "OPENBLAS_" prepended when copied to openblas_config.h |
I get the same error: |
That should be openblas_config.h instead of common.h in the cblas.h (normally converted in the |
Replaced f77blas.h and It gives the same error... |
Err, the f77blas.h was just mentioned in passing as it is the last of the header files that are normally generated rather than copied. |
Compiles without errors with your openblas_config.txt & after changing "common.h" in cblas.h to "openblas_config.h" :) Thank you both for your help!!! |
I've dropped a line in general threading issue so that if there is a measurable improvement reached with _symv it can be verified in this context of deep lapack calls too. |
Dear OpenBLAS team,
Can you please send me OpenBLAS latest release built with USE_OPENMP=1 for windows 64 bit (Intel Haswell processor)? I don't have a lot of experience building for windows and was unsuccessful...the standard release on your site works but I want to work with OpenBLAS & OpenMP.
gcc version: gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0.
gfortran version: GNU Fortran (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0.
Thank you!
The text was updated successfully, but these errors were encountered: