Skip to content
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

sundials: replace liblapack by openblas #75823

Merged
merged 1 commit into from Dec 18, 2019
Merged

Conversation

smaret
Copy link
Member

@smaret smaret commented Dec 17, 2019

Motivation for this change

Use OpenBLAS instead of the reference liblapack in SUNDIALS. This results in a significant performance improvement for CVODE.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @flokli @idontgetoutmuch

@idontgetoutmuch
Copy link
Contributor

@smaret I googled and found nothing to suggest that openblas gives performance improvements over lapack. I am sure you are right but do you have some evidence? A suite of performance tests? A reference? I found this: https://github.com/bmcage/odes/blob/master/ipython_examples/Performance%20tests.ipynb but have not tried running it yet. Maybe you know something better? Or maybe we can email the SUNDIALS mailing list?

@smaret
Copy link
Member Author

smaret commented Dec 18, 2019

@idontgetoutmuch You can find a comparison between the reference LAPACK (liblapack in nixpkgs), OpenBLAS and Intel MKL here:
https://markus-beuckelmann.de/blog/boosting-numpy-blas.html

For SUNDIALS/CVODE specifically, I did a benchmark with this code. For a system of 500 ODEs, it runs four times faster when SUNDIALS is linked against OpenBLAS rather than the reference LAPACK.

@smaret
Copy link
Member Author

smaret commented Dec 18, 2019

@GrahamcOfBorg build sundials

@flokli
Copy link
Contributor

flokli commented Dec 18, 2019

Using OpenBLAS for performance sounds reasonable.

In terms of building and passing tests: The sundials pass on both linux amd64 and aarch64 - for some reasons ofborg hasn't reported back about macos yet, and I lack the hardware to properly test this.

@smaret
Copy link
Member Author

smaret commented Dec 18, 2019

ofborg hasn't reported back about macos

It does not build on macos unless you are a trusted user. However I've built and tested the package on my local macos machine.

@flokli
Copy link
Contributor

flokli commented Dec 18, 2019 via email

@idontgetoutmuch
Copy link
Contributor

I am going to try building on macos now.

@idontgetoutmuch
Copy link
Contributor

Builds for me on macos so 👍

@flokli flokli merged commit c8c7398 into NixOS:master Dec 18, 2019
@smaret smaret deleted the sundials-openblas branch December 18, 2019 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants