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

aarch64: cd: switch from libomp to libgomp #1803

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

snadampal
Copy link
Contributor

@snadampal snadampal commented Apr 25, 2024

In the current version of the CD scripts, torch libraries are linked to llvm openmp because conda openblas-openmp is linked to it. To switch to gnu libgomp, we are building the openblas from sources instead of installing from conda.
Building openBLAS shared library instead of static library to be able to discover LAPACK support in OpenBLAS.

fixes #1774
relands #1787

this is the output from the wheel built with this change, where LAPACK is enabled.

2.4.0a0+gitacbf888 PyTorch built with:
  - GCC 10.2
  - C++ Version: 201703
  - Intel(R) MKL-DNN v3.3.6 (Git Hash 86e6af5974177e513fd3fee58425e1063e7f1361)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - LAPACK is enabled (usually provided by MKL)
  - NNPACK is enabled
  - CPU capability usage: NO AVX
  - Build settings: BLAS_INFO=open, BUILD_TYPE=Release, CXX_COMPILER=/opt/rh/devtoolset-10/root/usr/bin/c++, CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 -fabi-version=11 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DTMP_LIBKINETO_NANOSECOND -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-stringop-overflow -Wsuggest-override -Wno-psabi -Wno-error=pedantic -Wno-error=old-style-cast -Wno-missing-braces -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=open, TORCH_VERSION=2.4.0, USE_CUDA=OFF, USE_CUDNN=OFF, USE_CUSPARSELT=OFF, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_GLOO=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, USE_ROCM_KERNEL_ASSERT=OFF, 

In the current version of the CD scripts, torch libraries are
linked to llvm openmp because conda openblas-openmp is linked to it.
To switch to gnu libgomp, we are building the openblas from sources
instead of installing from conda.
Building openBLAS shared library instead of static library to
be able to discover LAPACK support in OpenBLAS.
@snadampal
Copy link
Contributor Author

cc: @atalman , @malfet

snadampal added a commit to snadampal/pytorch that referenced this pull request Apr 25, 2024
@malfet
Copy link
Contributor

malfet commented Apr 25, 2024

@snadampal can you please mentions what's the difference between this one and previous attempt?

@snadampal
Copy link
Contributor Author

sure, I've added it in the commit description.

Building openBLAS shared library instead of static library to be able to discover LAPACK support in OpenBLAS.

the difference is:
"NO_SHARED=0",

@malfet malfet merged commit d8a3ebd into pytorch:main Apr 26, 2024
2 checks passed
snadampal added a commit to snadampal/builder that referenced this pull request Apr 28, 2024
In the current version of the CD scripts, torch libraries are
linked to llvm openmp because conda openblas-openmp is linked to it.
To switch to gnu libgomp, we are building the openblas from sources
instead of installing from conda.
Building openBLAS shared library instead of static library to
be able to discover LAPACK support in OpenBLAS.

cherrypicked from pytorch#1803
fixes: pytorch#1774
atalman pushed a commit that referenced this pull request May 8, 2024
In the current version of the CD scripts, torch libraries are
linked to llvm openmp because conda openblas-openmp is linked to it.
To switch to gnu libgomp, we are building the openblas from sources
instead of installing from conda.
Building openBLAS shared library instead of static library to
be able to discover LAPACK support in OpenBLAS.

cherrypicked from #1803
fixes: #1774
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants