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
TF fails to build on CPU when compiled with "-march=skylake-avx512" flag #56731
Comments
Tagging @cantonios and @penpornk to take a look at this issue. |
@bhavani-subramanian can you try hacking this at the top of
I think this should solve it temporarily to unblock you, but I'm having trouble actually building this on our end. |
A recent addition from intel into Eigen ([!972](https://gitlab.com/libeigen/eigen/-/merge_requests/972)) added new specialized GEMM kernels for AVX512. Unfortunately, these conflict with and are incompatible with specializations in `eigen_spatial_convolutions.h` in TensorFlow. Here we put in a hack to disable them. See issue #56731. PiperOrigin-RevId: 460342434
@cantonios thank for the quick response. We tried the change, it looks like it is still failing with ambiguous template instantiation error.
|
A recent addition from intel into Eigen (!972) added new specialized GEMM kernels for AVX512. Unfortunately, these conflict with and are incompatible with specializations in `eigen_spatial_convolutions.h` in TensorFlow. Here we put in a hack to disable them. The last attempt to fix this failed, since other headers are sometimes included before this the `eigen_spatial_convolutions.h` one, which end up including the conflicting specialized gemm kernel before we have the chance to disable it. The only option is to disable via `defines` in the BUILD file so that all dependent targets inherit this option. See issue #56731. PiperOrigin-RevId: 460533762
@cantonios the commit a92b702 fixes the issue, TF builds with AVX512. Thanks. |
Click to expand!
Issue Type
Build/Install
Source
source
Tensorflow Version
tf 2.9
Custom Code
No
OS Platform and Distribution
Linux Ubuntu 20.04
Mobile device
No response
Python version
3.9.12
Bazel version
5.1.1
GCC/Compiler version
9.3.0
CUDA/cuDNN version
No response
GPU model and memory
No response
Current Behaviour?
Starting from 74059203de9c21ca26b27ea7609d49b3c87f2c19 commit, TF fails to build when compiled with `--copt=-march=skylake=avx512` flag on Cascade Lake (CLX) CPU systems or higher. The compilation succeeds when this flag is not passed.
Standalone code to reproduce the issue
Command-line to trigger the build failure (on 74059203de9c21ca26b27ea7609d49b3c87f2c19 or newer commit): bazel build --copt="-O3" --copt=-march=skylake-avx512 -c opt //tensorflow/tools/pip_package:build_pip_package
Relevant log output
The text was updated successfully, but these errors were encountered: