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

openblas: re-enable AVX512 support #97306

Merged
merged 1 commit into from Dec 29, 2020
Merged

Conversation

danieldk
Copy link
Contributor

@danieldk danieldk commented Sep 6, 2020

Motivation for this change

AVX512 support was disabled due to an issue in the AVX512 DGEMM
kernel:

#59708

However, this kernel has been replaced upstream a while ago:

https://github.com/xianyi/OpenBLAS/releases/tag/v0.3.8

And they have enabled AVX512 kernels since then.

cc @markuskowa

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 nixpkgs-review --run "nixpkgs-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.

AVX512 support was disabled due to an issue in the AVX512 DGEMM
kernel:

NixOS#59708

However, this kernel has been replaced upstream a while ago:

https://github.com/xianyi/OpenBLAS/releases/tag/v0.3.8

And they have enabled AVX512 kernels since then.
@markuskowa
Copy link
Member

The main reason I disabled it was the negative performance impact. Did you do you a benchmark on a AVX512 enabled CPU?

@danieldk
Copy link
Contributor Author

danieldk commented Sep 7, 2020

The main reason I disabled it was the negative performance impact. Did you do you a benchmark on a AVX512 enabled CPU?

For one of my models (a transformer network), enabling AVX512 kernels gives a 22% improvement on a Xeon Gold 6138.

@markuskowa
Copy link
Member

OK, I see. The Xeon Gold 6138 has FMA/AVX512 units but the a lot of smaller models only have a single unit (which were the ones that had a worse performance than just using only AVX2). AVX512 is really a mixed bag. I'll try to run a test in the next days on a Xeon Silver to see how it behaves there.

Is it possible to turn off at run-time?

@danieldk
Copy link
Contributor Author

danieldk commented Sep 7, 2020

OK, I see. The Xeon Gold 6138 has FMA/AVX512 units but the a lot of smaller models only have a single unit (which were the ones that had a worse performance than just using only AVX2). AVX512 is really a mixed bag. I'll try to run a test in the next days on a Xeon Silver to see how it behaves there.

I will also try benchmarking my MacBook Air, which only has a single unit.

Is it possible to turn off at run-time?

Seems like not on a per-feature bases, but it can be done on a core type basis with the OPENBLAS_CORETYPE environment variable, e.g. OPENBLAS_CORETYPE=Haswell.

@SuperSandro2000
Copy link
Member

@ofborg eval

Copy link
Member

@ttuegel ttuegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to keep our configuration as close to upstream as possible.

@ttuegel ttuegel changed the base branch from master to staging December 29, 2020 11:42
@ttuegel ttuegel merged commit c3356a6 into NixOS:staging Dec 29, 2020
@danieldk danieldk deleted the openblas-avx512 branch December 29, 2020 11:51
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

4 participants