pytorch/cmake/Modules
Fadi Arafeh d1f21d8ec3 Enable Direct Use of Arm Compute Library (ACL) in ATen (#148584)
ACL is already built with PyTorch as a shared library when USE_MKLDNN_ACL is set.
Currently, it is only used indirectly in ATen via oneDNN for AArch64 targets. However there are cases where it makes sense to utilize ACL directly without  oneDNN as an intermediary - e.g. quantization. See #145942, #147337, #146620.
This patch enables such use cases by exposing ACL to ATen

Pull Request resolved: https://github.com/pytorch/pytorch/pull/148584
Approved by: https://github.com/malfet
2025-03-10 18:29:51 +00:00
..
FindACL.cmake Enable Direct Use of Arm Compute Library (ACL) in ATen (#148584) 2025-03-10 18:29:51 +00:00
FindAPL.cmake solve apl dependency issue (#145215) 2025-01-27 13:02:16 +00:00
FindARM.cmake Extending the Pytorch vec backend for SVE (ARM) (#119571) 2024-09-18 18:59:10 +00:00
FindAtlas.cmake
FindAVX.cmake Simplify CMake code (#127683) 2024-06-05 15:17:31 +00:00
FindBenchmark.cmake
FindBLAS.cmake [BE] Include CheckFunctionExists in FindBLAS.cmake (#145849) 2025-01-28 19:47:05 +00:00
FindBLIS.cmake
FindCUB.cmake
FindCUDAToolkit.cmake [Reland] Add wrappers for synchronous GPUDirect Storage APIs (#133489) 2024-08-15 17:11:52 +00:00
FindCUDSS.cmake SparseCsrCUDA: cuDSS backend for linalg.solve (#129856) 2024-08-22 07:57:30 +00:00
FindCUSPARSELT.cmake
FindFlexiBLAS.cmake
FindGloo.cmake
FindITT.cmake
FindLAPACK.cmake Enable Windows Arm64 (#133088) 2024-10-24 16:10:44 +00:00
FindMAGMA.cmake
FindMKL.cmake Fix mkl-static issue for Windows. (#130697) 2024-07-15 19:28:11 +00:00
FindMKLDNN.cmake Use oneDNN v3.7.1 for Intel GPU (#148403) 2025-03-07 08:03:49 +00:00
FindNCCL.cmake
FindNuma.cmake
FindOpenBLAS.cmake
FindOpenMP.cmake [CMake] Find HomeBrew OpenMP on MacOS (#145870) 2025-01-30 03:19:51 +00:00
FindOpenTelemetryApi.cmake [rfc] opentelemetry in pytorch (#122999) 2024-04-21 15:20:21 +00:00
Findpybind11.cmake
FindSanitizer.cmake
FindSYCLToolkit.cmake Fix xpu cmake typo (#140374) 2024-11-13 00:26:35 +00:00
FindvecLib.cmake
FindVSX.cmake
FindZVECTOR.cmake s390x: use runtime detection for vectorization support (#123936) 2024-05-03 21:34:37 +00:00
README.md

This folder contains various custom cmake modules for finding libraries and packages. Details about some of them are listed below.

FindOpenMP.cmake

This is modified from the file included in CMake 3.13 release, with the following changes:

  • Replace VERSION_GREATER_EQUAL with NOT ... VERSION_LESS as VERSION_GREATER_EQUAL is not supported in CMake 3.5 (our min supported version).

  • Update the separate_arguments commands to not use NATIVE_COMMAND which is not supported in CMake 3.5 (our min supported version).

  • Make it respect the QUIET flag so that, when it is set, try_compile failures are not reported.

  • For AppleClang compilers, use -Xpreprocessor instead of -Xclang as the later is not documented.

  • For AppleClang compilers, an extra flag option is tried, which is -Xpreprocessor -openmp -I${DIR_OF_omp_h}, where ${DIR_OF_omp_h} is a obtained using find_path on omp.h with brew's default include directory as a hint. Without this, the compiler will complain about missing headers as they are not natively included in Apple's LLVM.

  • For non-GNU compilers, whenever we try a candidate OpenMP flag, first try it with directly linking MKL's libomp if it has one. Otherwise, we may end up linking two libomps and end up with this nasty error:

    OMP: Error #15: Initializing libomp.dylib, but found libiomp5.dylib already
    initialized.
    
    OMP: Hint This means that multiple copies of the OpenMP runtime have been
    linked into the program. That is dangerous, since it can degrade performance
    or cause incorrect results. The best thing to do is to ensure that only a
    single OpenMP runtime is linked into the process, e.g. by avoiding static
    linking of the OpenMP runtime in any library. As an unsafe, unsupported,
    undocumented workaround you can set the environment variable
    KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but
    that may cause crashes or silently produce incorrect results. For more
    information, please see http://openmp.llvm.org/
    

    See NOTE [ Linking both MKL and OpenMP ] for details.