Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 9 additions & 12 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
31 changes: 31 additions & 0 deletions recipe/patches/0018-Use-Intel-LLVM-openmp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From ffbdd8bb8fa38397ad6d7958a8c4ddd80ff738eb Mon Sep 17 00:00:00 2001
From: Isuru Fernando <[email protected]>
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

Loading