pytorch/cmake/Modules
atalman 22641f42b6 [Binary-builds]Use System NCCL by default in CI/CD. (#152835)
Use System NCCl by default. The correct nccl version is already built into the Manylinux docker image.

Will followup with PR on detecting if user has NCCL installed and enabling USE_SYSTEM_NCCL by default in this case.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/152835
Approved by: https://github.com/malfet
2025-05-30 18:51:48 +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 Fixes detection of ArmPL on Linux platform (#150031) 2025-05-07 19:47:21 +00:00
FindARM.cmake Extend vec backend with BF16 SVE intrinsics (#143666) 2025-04-28 18:25:44 +00:00
FindAtlas.cmake
FindAVX.cmake
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 Fixes detection of ArmPL on Linux platform (#150031) 2025-05-07 19:47:21 +00:00
FindMAGMA.cmake
FindMKL.cmake Skip search for MKL on ARM cpus (#145850) 2025-05-02 18:39:49 +00:00
FindMKLDNN.cmake Fix platform detection in MKLDNN CMake file (#142067) 2025-05-26 06:09:37 +00:00
FindNCCL.cmake [Binary-builds]Use System NCCL by default in CI/CD. (#152835) 2025-05-30 18:51:48 +00:00
FindNuma.cmake
FindOpenBLAS.cmake Avoid linking multiple OMP runtimes in libtorch_cpu.so if BLAS used is OpenBLAS. (#147725) 2025-04-29 23:39:48 +00:00
FindOpenMP.cmake Avoid linking multiple OMP runtimes in libtorch_cpu.so if BLAS used is OpenBLAS. (#147725) 2025-04-29 23:39:48 +00:00
FindOpenTelemetryApi.cmake
Findpybind11.cmake
FindSanitizer.cmake
FindSYCLToolkit.cmake Add default XPU toolkit path to CMake (#149270) 2025-03-24 14:41:24 +00:00
FindvecLib.cmake
FindVSX.cmake
FindZVECTOR.cmake
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.