diff --git a/.ci_support/win_64_channel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml b/.ci_support/win_64_channel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml index f427c263..29e44c48 100644 --- a/.ci_support/win_64_channel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml +++ b/.ci_support/win_64_channel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml @@ -44,10 +44,6 @@ pin_run_as_build: max_pin: x.x python: - 3.10.* *_cpython -- 3.11.* *_cpython -- 3.12.* *_cpython -- 3.13.* *_cp313 -- 3.9.* *_cpython pytorch: - '2.6' target_platform: diff --git a/recipe/bld.bat b/recipe/bld.bat index 965a1178..862b3266 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -152,6 +152,9 @@ set "CXXFLAGS=%CXXFLAGS% %CUDA_CFLAGS%" echo "CUDA_CFLAGS=%CUDA_CFLAGS%" echo "CXXFLAGS=%CXXFLAGS%" +set "CMAKE_C_COMPILER=clang-cl" +set "CMAKE_CXX_COMPILER=clang-cl" + @REM Configure sccache set "CMAKE_C_COMPILER_LAUNCHER=sccache" set "CMAKE_CXX_COMPILER_LAUNCHER=sccache" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 87a4de6a..e8374a5e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,6 +1,6 @@ # if you wish to build release candidate number X, append the version string with ".rcX" {% set version = "2.7.1" %} -{% set build = 4 %} +{% set build = 5 %} # Use a higher build number for the CUDA variant, to ensure that it's # preferred by conda's solver, and it's preferentially @@ -69,6 +69,7 @@ source: - patches/0016-skip-test_norm_matrix_degenerate_shapes-on-numpy-2.3.patch # backport https://github.com/pytorch/pytorch/pull/127702 - patches/0017-Define-PY_SSIZE_T_CLEAN-before-include-Python.h.patch + - patches/0018-Use-Intel-LLVM-openmp.patch - patches_submodules/fbgemm/0001-remove-DESTINATION-lib-from-CMake-install-directives.patch # [win] - patches_submodules/tensorpipe/0001-switch-away-from-find_package-CUDA.patch @@ -82,6 +83,7 @@ build: {% else %} skip: true # [is_rc] {% endif %} + skip: true # [not win or cuda_compiler_version != "None"] string: cuda{{ cuda_compiler_version | replace('.', '') }}_{{ blas_impl }}_h{{ PKG_HASH }}_{{ build }} # [cuda_compiler_version != "None"] string: cpu_{{ blas_impl }}_h{{ PKG_HASH }}_{{ build }} # [cuda_compiler_version == "None"] detect_binary_files_with_prefix: false @@ -110,8 +112,8 @@ requirements: - {{ compiler('c') }} - {{ compiler('cxx') }} - {{ compiler('cuda') }} # [cuda_compiler_version != "None"] - - llvm-openmp # [unix] - - intel-openmp {{ mkl }} # [win] + - clang # [win] + - llvm-openmp - libuv # [win] - cmake <4 - ninja @@ -162,8 +164,7 @@ requirements: - libblas # [blas_impl != "mkl"] - libcblas # [blas_impl != "mkl"] - liblapack # [blas_impl != "mkl"] - - llvm-openmp # [unix] - - intel-openmp {{ mkl }} # [win] + - llvm-openmp - libabseil - libprotobuf - sleef @@ -176,7 +177,6 @@ requirements: run: # GPU requirements without run_exports - {{ pin_compatible('cudnn') }} # [cuda_compiler_version != "None"] - - intel-openmp {{ mkl }} # [win] - libblas * *{{ blas_impl }} # [blas_impl == "mkl"] run_constrained: # These constraints ensure conflict between pytorch and @@ -264,8 +264,7 @@ outputs: - {{ compiler('c') }} - {{ compiler('cxx') }} - {{ compiler('cuda') }} # [cuda_compiler_version != "None"] - - llvm-openmp # [unix] - - intel-openmp {{ mkl }} # [win] + - llvm-openmp - cmake <4 - ninja # Keep libprotobuf here so that a compatibile version @@ -311,8 +310,7 @@ outputs: - libcblas * *_mkl # [blas_impl == "mkl"] - libcblas # [blas_impl != "mkl"] - liblapack # [blas_impl != "mkl"] - - llvm-openmp # [unix] - - intel-openmp {{ mkl }} # [win] + - llvm-openmp - libabseil - libprotobuf - pybind11 @@ -326,8 +324,7 @@ outputs: - {{ pin_subpackage('libtorch', exact=True) }} # [megabuild] # for non-megabuild, allow libtorch from any python version - libtorch {{ version }}.* *_{{ build }} # [not megabuild] - - llvm-openmp # [unix] - - intel-openmp {{ mkl }} # [win] + - llvm-openmp - libblas * *{{ blas_impl }} # [blas_impl == "mkl"] - nomkl # [blas_impl != "mkl"] # GPU requirements without run_exports diff --git a/recipe/patches/0018-Use-Intel-LLVM-openmp.patch b/recipe/patches/0018-Use-Intel-LLVM-openmp.patch new file mode 100644 index 00000000..624a9764 --- /dev/null +++ b/recipe/patches/0018-Use-Intel-LLVM-openmp.patch @@ -0,0 +1,31 @@ +From ffbdd8bb8fa38397ad6d7958a8c4ddd80ff738eb Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Thu, 31 Jul 2025 12:34:30 -0500 +Subject: [PATCH] Use Intel/LLVM openmp + +This make MSVC use __kmp_* symbols available in both libiomp.dll +and libiomp5md.dll instead of vcomp* symbols which are only in +vcomp140.dll and libiomp5md.dll, but are missing in libiomp.dll +--- + cmake/Modules/FindOpenMP.cmake | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/cmake/Modules/FindOpenMP.cmake b/cmake/Modules/FindOpenMP.cmake +index 8a9abff398..336a9a927a 100644 +--- a/cmake/Modules/FindOpenMP.cmake ++++ b/cmake/Modules/FindOpenMP.cmake +@@ -122,9 +122,9 @@ function(_OPENMP_FLAG_CANDIDATES LANG) + set(OMP_FLAG_MIPSpro "-mp") + if(__header_dir MATCHES ".*Microsoft Visual Studio.*") + # MSVC header. No need to pass it as additional include. +- set(OMP_FLAG_MSVC "-openmp:experimental" "-openmp") ++ set(OMP_FLAG_MSVC "-openmp:llvm" "-openmp:experimental" "-openmp") + else() +- set(OMP_FLAG_MSVC "-openmp:experimental -I${__header_dir}" "-openmp -I${__header_dir}") ++ set(OMP_FLAG_MSVC "-openmp:llvm" "-openmp:experimental -I${__header_dir}" "-openmp -I${__header_dir}") + endif() + set(OMP_FLAG_PathScale "-openmp") + set(OMP_FLAG_NAG "-openmp") +-- +2.45.2 +