This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen

Bug 1306

Summary: Add support for AVX512 to Eigen
Product: Eigen Reporter: Benoit Steiner <benoit.steiner.goog>
Component: Core - vectorizationAssignee: Benoit Steiner <benoit.steiner.goog>
Status: RESOLVED FIXED    
Severity: Unknown CC: chtz, gael.guennebaud, jacob.benoit.1, markos
Priority: Normal    
Version: 3.4 (development)   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 814    

Description Benoit Steiner 2016-09-23 21:59:35 UTC
Most of the required additions are already available in https://bitbucket.org/benoitsteiner/eigen-avx512.
Comment 1 Gael Guennebaud 2016-09-24 07:04:46 UTC
Great.

You said "most of the required additions are already available", do you remember what's missing?

I did not looked thoroughly, but have a few comments:

- predux_half -> I would rename it to predux_half_downto4
- Eigen/src/Core/arch/AVX512/CMakeLists.txt can be removed
- regarding the conflit in Eigen/src/Core/products/GeneralBlockPanelKernel.h, we should keep the actual version and discard the version of the clone.


I guess it's really time to merge the implementations of plog, pexp, and the likes...!
Comment 2 Christoph Hertzberg 2016-09-24 07:54:57 UTC
(In reply to Gael Guennebaud from comment #1)
> I guess it's really time to merge the implementations of plog, pexp, and the
> likes...!

I agree. I would strongly prefer not to copy MathFunctions.h again for this.
I made a proof-of-concept implementation for meta packets once (Bug 692 comment 10), unfortunatelety I never got back to it.
Comment 3 Gael Guennebaud 2016-09-24 10:28:44 UTC
I don't think we need meta-packet for math-functions, for instance I've already made a generic implementation of tanh that works for float and any Packet?f type:

https://bitbucket.org/eigen/eigen/src/f6382682565c946d46612fe0e36e486bba1371ce/Eigen/src/Core/MathFunctionsImpl.h?at=default&fileviewer=file-view-default
Comment 4 Christoph Hertzberg 2016-09-24 13:24:11 UTC
(In reply to Gael Guennebaud from comment #3)
> I don't think we need meta-packet for math-functions, [...]
Yes, I agree we don't need them as long as no conversions to int and back to float/double are required. Otherwise, it gets complicated, especially for AVX vs AVX2 (where only the latter support 256 bit integer operations).

We might get away with some bit-twiddling in some cases, though (e.g., adding float(1<<23) to round to the next integer).
Comment 5 Benoit Steiner 2016-09-26 21:17:32 UTC
> You said "most of the required additions are already available", do you
> remember what's missing?

From the top of my mind (I haven't touched the code in a while), we still need to implement pblend to be feature complete. I also remember that some of the math functions aren't implemented, but then this might not be an issue if we merge the implementations of plog, pexp, and friends.

 
> I did not looked thoroughly, but have a few comments:
> 
> - predux_half -> I would rename it to predux_half_downto4
> - Eigen/src/Core/arch/AVX512/CMakeLists.txt can be removed
> - regarding the conflit in
> Eigen/src/Core/products/GeneralBlockPanelKernel.h, we should keep the actual
> version and discard the version of the clone.

These are good suggestions. I'll sync the avx512 branch with the latest version of the Eigen codebase and start working on this as soon as the 3.3 release is out.
Comment 6 Benoit Steiner 2016-11-05 02:19:31 UTC
The code is now merged but turned off by default (https://bitbucket.org/eigen/eigen/pull-requests/235/added-support-for-avx512-to-eigen/diff#comment-None). Once we have more experience with it, we should turn it on by default provided that the compile flags allow the use of AVX512 instructions.
Comment 7 Gael Guennebaud 2018-10-08 21:09:51 UTC
AVX512 is operational for a while.
Comment 8 Gael Guennebaud 2018-12-07 13:44:40 UTC
Support for AVX512 is now on par with SSE/AVX, including complexes.
Comment 9 Nobody 2019-12-04 16:18:31 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1306.