Skip to content

OpenBLAS has issues solving triangular matrices on win32 #1270

Closed

Description

Using the 32 bit openblas causes timeouts while running the scipy tests:

Activity

  1. martin-frbg commented on Aug 7, 2017

    @martin-frbg
    Collaborator

    Do I read that correctly - you are using a binary distribution of 0.2.19 from some third party site (which could be one of the sourceforge mirrors sites, but then again could be something else) ? Could you retest with the current "develop" snapshot which has a bunch of fixes vs. 0.2.19 (or at least build 0.2.19 yourself on your platform to see if it passes the built-in tests) ? In any case I guess a minimal example run on a well-defined system would be preferable to a big unedited dump from an appveyor vm.

  2. martin-frbg commented on Aug 7, 2017

    @martin-frbg
    Collaborator

    not sure if 0.2.20 will build in your environment (depending on how and where you build - a cross-compile on linux like the binaries provided on sourceforge will probably go okay. the issue is a botched commit that breaks things on non-glibc systems, waiting for xianyi to release 0.2.21) which is why I suggested taking a snapshot of "develop" (easily done by clicking on the green "Clone or download" button on the "Code" tab here). Normal build from source should run a few tests at the end automatically (though as a Linux guy I am not completely sure it does this on Windows as well.

  3. martin-frbg commented on Aug 7, 2017

    @martin-frbg
    Collaborator

    Thanks for the link to the scipy issue. From reading that, it seems your tests were (at least at some point in the history of that PR) already done with 0.2.20 (?)
    Do you still believe the problematic behaviour is with potrf specifically ?

  4. martin-frbg commented on Aug 7, 2017

    @martin-frbg
    Collaborator

    Cross compiling with gcc will currently get you the hand-optimized assembly functions (which use inline assembly and AT&T notation that MSVC does not support), building with MSVC will use generic C implementations instead (which are possibly still a bit faster than the netlib reference implementation).
    Latest commits to "develop" allow compiling with clang which supports the optimized assembly (but will need a windows flang compiler for completeness)

  5. brada4 commented on Aug 7, 2017

    @brada4
    Contributor

    Specifically what lapack is imported by arpack?

  6. brada4 commented on Aug 7, 2017

    @brada4
    Contributor

    Sure, and your binary numpy too, ten times.
    Some backtrace would be nice....

  7. 45 remaining items

  8. martin-frbg commented on Aug 15, 2017

    @martin-frbg
    Collaborator

    I take it you are suggesting that compiling interface/lapack/potrf.c with -O0 instead of the default -O2 would solve the problem with older mingw versions ? Not sure how easy it would be to cater for that in the Makefiles (not sure if -march=native is actually what they are using or intending to use, if my understanding is correct they are preparing a distribution package of some sort).

  9. brada4 commented on Aug 15, 2017

    @brada4
    Contributor

    -march=pentium4 -msse2 -fpmath=sse ...
    It is miscompilation by C compiler, not something to work around. Since build logs/options are not around for each and every 'build' and 'gcc version' i would take gcc7 claim with a big grain of salt.

  10. martin-frbg commented on Aug 15, 2017

    @martin-frbg
    Collaborator

    Once again I am not sure I can follow your cryptic messages. My suggestion was to omit compilation of the problematic potrf interface if there is reason to believe the compiler is not up to that task.

  11. brada4 commented on Aug 15, 2017

    @brada4
    Contributor

    It compiles just fine with gcc 4.6 included with windows rtools (compilers for r packages).
    I am quite certain aggressive/unpopolar compiler options lead to miscompilation in this case.

  12. carlkl commented on Aug 15, 2017

    @carlkl

    I'm not going to create a PR to OpenBLAS with a patch to something without further diagnosis and debugging. However, using mingw-w64 with gcc-7.1 seems to be a workaround to this issue right now,

  13. brada4 commented on Aug 16, 2017

    @brada4
    Contributor

    You dont even have exact compiler options for each failed case.
    Your PR will be wrong, as old gcc can compile OpenBLAS without any problems. Please find problematic compiler option and report a compiler bug first.

  14. martin-frbg commented on Aug 16, 2017

    @martin-frbg
    Collaborator

    @brada4 alienating developers of other projects helps noone. Even if your gcc 4.6 from rtools happens to be identical to the mingw-w64 build of the same version number this does nothing to refute the claim that at least the 4.9 and 5.3 versions miscompile potrf.c . If we really want to get to the bottom of this I guess we would need the intermediate assembler (gcc -S) output for this file from both "good" and "bad" compilers and someone who is capable of spotting the relevant differences.
    For now, adding a note to the wiki (and perhaps ensuring that any future pre-compiled binaries for win32 made available on the project page at sourceforge are built with a recent gcc cross-compiler "just in case the problem carries over to cross-compilations") may be sufficient ?

  15. brada4 commented on Aug 16, 2017

    @brada4
    Contributor

    I dont have compiler on windows. I can try to cross-compile with old and new crosscompiler and run test case on 64bit windows...
    My speculation is based on assumption that typical distribution compiler option sets (-O2 -march=early-i686 -msome-memory-protector ) are million times better tested in GCC than -march=better-cpu

  16. martin-frbg commented on Aug 16, 2017

    @martin-frbg
    Collaborator

    Please note that this issue appears to be specifically about mingw-w64 on Windows 32bit then.

  17. brada4 commented on Aug 16, 2017

    @brada4
    Contributor

    Yes, yes, 32bit dll+exe running on 64bit windows.
    It is very important to have it running at top quality since all alternatives are fading away.

  18. carlkl commented on Aug 16, 2017

    @carlkl

    I'm willing to dig into this. However, This takes some time as there are some topics with higher priority for me right now.

  19. brada4 commented on Aug 16, 2017

    @brada4
    Contributor

    You are not alone. As a minimum find a linux distribution with good and recent gcc that produces production quality 32bit DLL

  20. martin-frbg commented on Sep 26, 2017

    @martin-frbg
    Collaborator

    Have there been any new insights since then ? I tried to track any seemingly related numpy/scipy issues but as far as I could tell the discussions there seem to have moved on to inadvertent use of the 80bit extended precision Intel FPU mode causing problems in cdflib. So should we add a warning in the wiki to use at least version 7.1 of the mingw gcc for 32bit builds on Windows, or are there any indications that the problem may be bigger and in OpenBLAS itself ?

  21. ghost closed this as completedon Oct 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions