From 2e5cbe2b0a0d0cc26bbe0924f7fde538a0ac1c8c Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 6 Feb 2025 08:13:37 +1100 Subject: [PATCH 01/15] remove smoke tests --- recipe/meta.yaml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e1c2a2d6..a9a426c8 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -397,7 +397,6 @@ outputs: # tools/ is needed to optimise test run # as of pytorch=2.0.0, there is a bug when trying to run tests without the tools - tools - #- .ci/pytorch/smoke_test/smoke_test.py commands: # Run pip check so as to ensure that all pytorch packages are installed # https://github.com/conda-forge/pytorch-cpu-feedstock/issues/24 @@ -423,30 +422,6 @@ outputs: - if not exist %LIBRARY_BIN%\torch_python.dll exit 1 # [win] - if not exist %LIBRARY_LIB%\torch_python.lib exit 1 # [win] - # See here for environment variables needed by the smoke test script - # https://github.com/pytorch/pytorch/blob/266fd35c5842902f6304aa8e7713b252cbfb243c/.ci/pytorch/smoke_test/smoke_test.py#L16 - - set MATRIX_GPU_ARCH_VERSION="{{ '.'.join((cuda_compiler_version or "").split('.')[:2]) }}" # [(cuda_compiler_version != "None") and (win)] - - set MATRIX_GPU_ARCH_TYPE="cuda" # [(cuda_compiler_version != "None") and (win)] - - set MATRIX_GPU_ARCH_VERSION="none" # [(cuda_compiler_version == "None") and (win)] - - set MATRIX_GPU_ARCH_TYPE="none" # [(cuda_compiler_version == "None") and (win)] - - set MATRIX_CHANNEL="defaults" # [win] - - set MATRIX_STABLE_VERSION={{ version }} # [win] - - set MATRIX_PACKAGE_TYPE="conda" # [win] - - set TARGET_OS="windows" # [win] - - set OMP_NUM_THREADS=4 # [win] - - export MATRIX_GPU_ARCH_VERSION="{{ '.'.join((cuda_compiler_version or "").split('.')[:2]) }}" # [(cuda_compiler_version != "None") and (linux and x86_64)] - - export MATRIX_GPU_ARCH_TYPE="cuda" # [(cuda_compiler_version != "None") and (linux and x86_64)] - - export MATRIX_GPU_ARCH_VERSION="none" # [(cuda_compiler_version == "None") and (not win)] - - export MATRIX_GPU_ARCH_TYPE="none" # [(cuda_compiler_version == "None") and (not win)] - - export MATRIX_CHANNEL="defaults" # [not win] - - export MATRIX_STABLE_VERSION="{{ version }}" # [not win] - - export MATRIX_PACKAGE_TYPE="conda" # [not win] - - export TARGET_OS="linux" # [linux] - - export TARGET_OS="macos-arm64" # [(osx and arm64)] - - export TARGET_OS="macos-x86_64" # [(osx and x86_64)] - - export OMP_NUM_THREADS=4 # [not win] - #- python ./smoke_test/smoke_test.py --package torchonly - # a reasonably safe subset of tests that should run under 15 minutes {% set tests = " ".join([ "test/test_autograd.py", From 816820d5d2e5b18a4d5cdcbb63b20710b8b83eb1 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 6 Feb 2025 08:16:14 +1100 Subject: [PATCH 02/15] drop unsuccessful patch; now covered by skip see also ba2564b1a70011d975cb74c995cba5053fa083f3 --- recipe/meta.yaml | 1 - ...e-in-test_mutable_custom_op_fixed_la.patch | 57 ------------------- 2 files changed, 58 deletions(-) delete mode 100644 recipe/patches/0020-make-library-name-in-test_mutable_custom_op_fixed_la.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index a9a426c8..d68a3b70 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -70,7 +70,6 @@ source: - patches/0017-Add-conda-prefix-to-inductor-include-paths.patch - patches/0018-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch - patches/0019-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch # [win] - - patches/0020-make-library-name-in-test_mutable_custom_op_fixed_la.patch - patches/0021-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.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 diff --git a/recipe/patches/0020-make-library-name-in-test_mutable_custom_op_fixed_la.patch b/recipe/patches/0020-make-library-name-in-test_mutable_custom_op_fixed_la.patch deleted file mode 100644 index 17c54e33..00000000 --- a/recipe/patches/0020-make-library-name-in-test_mutable_custom_op_fixed_la.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 39041f5a78068d2cf58d99f76938aee95a3c7bb5 Mon Sep 17 00:00:00 2001 -From: "H. Vetinari" -Date: Thu, 30 Jan 2025 13:23:14 +1100 -Subject: [PATCH 20/21] make library name in - `test_mutable_custom_op_fixed_layout{,2}` unique - -Suggested-By: Daniel Petry ---- - test/inductor/test_torchinductor.py | 14 +++++++++----- - 1 file changed, 9 insertions(+), 5 deletions(-) - -diff --git a/test/inductor/test_torchinductor.py b/test/inductor/test_torchinductor.py -index 610f5d27332..99e2169febb 100644 ---- a/test/inductor/test_torchinductor.py -+++ b/test/inductor/test_torchinductor.py -@@ -10628,7 +10628,8 @@ class CommonTemplate: - @requires_gpu() - @config.patch(implicit_fallbacks=True) - def test_mutable_custom_op_fixed_layout2(self): -- with torch.library._scoped_library("mylib", "DEF") as lib: -+ unique_lib_name = f"mylib_{id(self)}" # Make unique name using test instance id -+ with torch.library._scoped_library(unique_lib_name, "DEF") as lib: - mod = nn.Conv2d(3, 128, 1, stride=1, bias=False).to(device=GPU_TYPE) - inp = torch.rand(2, 3, 128, 128, device=GPU_TYPE) - expected_stride = mod(inp).clone().stride() -@@ -10664,8 +10665,9 @@ class CommonTemplate: - def fn(x): - # Inductor changes the conv to be channels-last - z = mod(x) -- output = torch.ops.mylib.bar(z, torch._dynamo.is_compiling()) -- torch.ops.mylib.add_one(output) -+ mylib = importlib.import_module(f"torch.ops.{unique_lib_name}") -+ output = mylib.bar(z, torch._dynamo.is_compiling()) -+ mylib.add_one(output) - return output**2 - - with torch.no_grad(): -@@ -10681,7 +10683,8 @@ class CommonTemplate: - - @config.patch(implicit_fallbacks=True) - def test_mutable_custom_op_fixed_layout(self): -- with torch.library._scoped_library("mylib", "DEF") as lib: -+ unique_lib_name = f"mylib_{id(self)}" # Make unique name using test instance id -+ with torch.library._scoped_library(unique_lib_name, "DEF") as lib: - lib.define( - "copy_(Tensor(a!) dst, Tensor src) -> ()", - tags=torch.Tag.needs_fixed_stride_order, -@@ -10697,7 +10700,8 @@ class CommonTemplate: - - def f(x): - full_default_3 = torch.full([3], 7.0, device="cpu") -- chunk_cat_default_1 = torch.ops.mylib.copy_.default(full_default_3, x) -+ mylib = importlib.import_module(f"torch.ops.{unique_lib_name}") -+ chunk_cat_default_1 = mylib.copy_.default(full_default_3, x) - mul_out = torch.mul(full_default_3, full_default_3) - return mul_out - From 952a64b7973ce0f79932f86978b1e7b41e044346 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 7 Feb 2025 23:00:11 +1100 Subject: [PATCH 03/15] deactivate pytest-xdist for linux-64+CUDA+MKL --- recipe/meta.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d68a3b70..9b75e383 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -383,7 +383,7 @@ outputs: # Required by run_test.py - pytest-flakefinder - pytest-rerunfailures - - pytest-xdist + - pytest-xdist # [not (linux64 and blas_impl == "mkl" and cuda_compiler_version != "None")] # danpetry/TF: Pytorch includes their own edited version of pytest-shard and adding # it into the test deps as well results in the --shard-id option being added twice. # https://github.com/pytorch/pytorch/blob/main/test/pytest_shard_custom.py @@ -498,7 +498,10 @@ outputs: - export OMP_NUM_THREADS=4 # [unix] # reduced paralellism to avoid OOM; test only one python version on aarch because emulation is super-slow # disable hypothesis because it randomly yields health check errors - - python -m pytest -n 2 {{ tests }} -k "not ({{ skips }})" -m "not hypothesis" --durations=50 # [unix and (not aarch64 or py==312)] + # MKL+CUDA somehow crashes pytest, see https://github.com/conda-forge/pytorch-cpu-feedstock/issues/348 + - export jobs="" # [linux64 and blas_impl == "mkl" and cuda_compiler_version != "None"] + - export jobs="-n 2" # [not (linux64 and blas_impl == "mkl" and cuda_compiler_version != "None") and unix] + - python -m pytest $jobs {{ tests }} -k "not ({{ skips }})" -m "not hypothesis" --durations=50 # [unix and (not aarch64 or py==312)] - python -m pytest -v -s {{ tests }} -k "not ({{ skips }})" -m "not hypothesis" --durations=50 # [win] # regression test for https://github.com/conda-forge/pytorch-cpu-feedstock/issues/329, where we picked up From fc080fa15645e618c064d54857972f85f5f95b37 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 7 Feb 2025 23:06:50 +1100 Subject: [PATCH 04/15] temporary: skip known-passing builds to conserve resources --- recipe/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 9b75e383..4c9c6274 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -78,6 +78,8 @@ build: number: {{ build }} # cuda 11.8 was dropped due to maintenance effort, see discussion in #177 skip: true # [cuda_compiler_version == "11.8"] + # skip known-passing builds while bringing up GPU builds + skip: true # [cuda_compiler_version == "None" or win or aarch64] # This logic allows two rc variants to be defined in the conda_build_config, but only one to actually be built. # We want to be able to define two variants in the cbc so we can assign different labels to each in the upload channel # (by zipping is_rc with channel_targets). This prevents rc builds being used unless specifically requested. From 052a502c22b5c983fddabe664debdb0b167ce98f Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 8 Feb 2025 09:56:33 +1100 Subject: [PATCH 05/15] Revert "deactivate pytest-xdist for linux-64+CUDA+MKL" This reverts commit 952a64b7973ce0f79932f86978b1e7b41e044346. --- recipe/meta.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 4c9c6274..a277c5e5 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -385,7 +385,7 @@ outputs: # Required by run_test.py - pytest-flakefinder - pytest-rerunfailures - - pytest-xdist # [not (linux64 and blas_impl == "mkl" and cuda_compiler_version != "None")] + - pytest-xdist # danpetry/TF: Pytorch includes their own edited version of pytest-shard and adding # it into the test deps as well results in the --shard-id option being added twice. # https://github.com/pytorch/pytorch/blob/main/test/pytest_shard_custom.py @@ -500,10 +500,7 @@ outputs: - export OMP_NUM_THREADS=4 # [unix] # reduced paralellism to avoid OOM; test only one python version on aarch because emulation is super-slow # disable hypothesis because it randomly yields health check errors - # MKL+CUDA somehow crashes pytest, see https://github.com/conda-forge/pytorch-cpu-feedstock/issues/348 - - export jobs="" # [linux64 and blas_impl == "mkl" and cuda_compiler_version != "None"] - - export jobs="-n 2" # [not (linux64 and blas_impl == "mkl" and cuda_compiler_version != "None") and unix] - - python -m pytest $jobs {{ tests }} -k "not ({{ skips }})" -m "not hypothesis" --durations=50 # [unix and (not aarch64 or py==312)] + - python -m pytest -n 2 {{ tests }} -k "not ({{ skips }})" -m "not hypothesis" --durations=50 # [unix and (not aarch64 or py==312)] - python -m pytest -v -s {{ tests }} -k "not ({{ skips }})" -m "not hypothesis" --durations=50 # [win] # regression test for https://github.com/conda-forge/pytorch-cpu-feedstock/issues/329, where we picked up From 27cbb8f8d24c2c271a5dcd7c0d5c3589b20f59fb Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 8 Feb 2025 09:57:24 +1100 Subject: [PATCH 06/15] fix stray `)` that broke pytest --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index a277c5e5..305670c1 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -475,7 +475,7 @@ outputs: {% set skips = skips ~ " or (GPUTests and test_scatter_reduce2)" %} # [linux and cuda_compiler_version != "None"] # MKL problems {% set skips = skips ~ " or (TestLinalgCPU and test_inverse_errors_large_cpu)" %} # [linux and blas_impl == "mkl" and cuda_compiler_version != "None"] - {% set skips = skips ~ " or test_reentrant_parent_error_on_cpu_cuda)" %} # [linux and blas_impl == "mkl" and cuda_compiler_version != "None"] + {% set skips = skips ~ " or test_reentrant_parent_error_on_cpu_cuda" %} # [linux and blas_impl == "mkl" and cuda_compiler_version != "None"] # non-MKL problems {% set skips = skips ~ " or test_cross_entropy_loss_2d_out_of_bounds_class_index_cuda" %} # [linux and blas_impl != "mkl" and cuda_compiler_version != "None"] {% set skips = skips ~ " or test_cublas_config_nondeterministic_alert_cuda " %} # [linux and blas_impl != "mkl" and cuda_compiler_version != "None"] From 749e463779d10a2e49715353f6495900ad45eddf Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 8 Feb 2025 09:58:13 +1100 Subject: [PATCH 07/15] limit include-path manipulation patch to windows; unix can use symlinks --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 305670c1..d2e4058a 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -66,7 +66,7 @@ source: # backport https://github.com/pytorch/pytorch/pull/145480 - patches/0015-simplify-torch.utils.cpp_extension.include_paths-use.patch # point to headers that are now living in $PREFIX/include instead of $SP_DIR/torch/include - - patches/0016-point-include-paths-to-PREFIX-include.patch + - patches/0016-point-include-paths-to-PREFIX-include.patch # [win] - patches/0017-Add-conda-prefix-to-inductor-include-paths.patch - patches/0018-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch - patches/0019-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch # [win] From 0d2b1081236ec15613725ab6b7aa186d96166e42 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 8 Feb 2025 09:59:11 +1100 Subject: [PATCH 08/15] Revert "temporary: skip known-passing builds to conserve resources" This reverts commit fc080fa15645e618c064d54857972f85f5f95b37. --- recipe/meta.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d2e4058a..a80bcf26 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -78,8 +78,6 @@ build: number: {{ build }} # cuda 11.8 was dropped due to maintenance effort, see discussion in #177 skip: true # [cuda_compiler_version == "11.8"] - # skip known-passing builds while bringing up GPU builds - skip: true # [cuda_compiler_version == "None" or win or aarch64] # This logic allows two rc variants to be defined in the conda_build_config, but only one to actually be built. # We want to be able to define two variants in the cbc so we can assign different labels to each in the upload channel # (by zipping is_rc with channel_targets). This prevents rc builds being used unless specifically requested. From bc4f8b17cb9cdb8d86da9993ba09134a3d0033c5 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 8 Feb 2025 09:59:28 +1100 Subject: [PATCH 09/15] bump build number --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index a80bcf26..9a04ec20 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.5.1" %} -{% set build = 12 %} +{% set build = 13 %} # Use a higher build number for the CUDA variant, to ensure that it's # preferred by conda's solver, and it's preferentially From 044e93520d0c5cc96f0fdc3cf6d3f17e2bd300bc Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 8 Feb 2025 14:16:57 +1100 Subject: [PATCH 10/15] fix the way we look for `$PREFIX/include` in cross-compilation --- recipe/meta.yaml | 4 ++-- ...-of-python-3-and-error-without-numpy.patch | 2 +- recipe/patches/0002-Help-find-numpy.patch | 2 +- ...03-Add-USE_SYSTEM_NVTX-option-138287.patch | 2 +- .../patches/0004-Update-sympy-version.patch | 2 +- .../0005-Fix-duplicate-linker-script.patch | 2 +- ...kle-error-in-serialization.py-136034.patch | 2 +- ...verwrite-ld-with-environment-variabl.patch | 2 +- ...-Allow-overriding-CUDA-related-paths.patch | 2 +- ...st-test_linalg.py-for-NumPy-2-136800.patch | 2 +- ...est-failures-in-test_torch.py-137740.patch | 2 +- ...AS_USE_CBLAS_DOT-for-OpenBLAS-builds.patch | 2 +- recipe/patches/0012-fix-issue-142484.patch | 2 +- recipe/patches/0013-Fix-FindOpenBLAS.patch | 2 +- ...Enable-Python-3.13-on-windows-138095.patch | 2 +- ...tils.cpp_extension.include_paths-use.patch | 2 +- ...oint-include-paths-to-PREFIX-include.patch | 23 +++++++++++++------ ...nda-prefix-to-inductor-include-paths.patch | 4 ++-- ...E_DIR-relative-to-TORCH_INSTALL_PREF.patch | 4 ++-- ...ON-lib-from-CMake-install-TARGETS-di.patch | 4 ++-- ...find_package-CUDA-in-caffe2-CMake-m.patch} | 4 ++-- 21 files changed, 41 insertions(+), 32 deletions(-) rename recipe/patches/{0021-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch => 0020-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch} (99%) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 9a04ec20..e7280f01 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -66,11 +66,11 @@ source: # backport https://github.com/pytorch/pytorch/pull/145480 - patches/0015-simplify-torch.utils.cpp_extension.include_paths-use.patch # point to headers that are now living in $PREFIX/include instead of $SP_DIR/torch/include - - patches/0016-point-include-paths-to-PREFIX-include.patch # [win] + - patches/0016-point-include-paths-to-PREFIX-include.patch - patches/0017-Add-conda-prefix-to-inductor-include-paths.patch - patches/0018-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch - patches/0019-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch # [win] - - patches/0021-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch + - patches/0020-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.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 diff --git a/recipe/patches/0001-Force-usage-of-python-3-and-error-without-numpy.patch b/recipe/patches/0001-Force-usage-of-python-3-and-error-without-numpy.patch index fda50bcc..b5519b81 100644 --- a/recipe/patches/0001-Force-usage-of-python-3-and-error-without-numpy.patch +++ b/recipe/patches/0001-Force-usage-of-python-3-and-error-without-numpy.patch @@ -1,7 +1,7 @@ From f3a0f9aab6dce56eea590b946f60256014b61bf7 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Sun, 1 Sep 2024 17:35:40 -0400 -Subject: [PATCH 01/21] Force usage of python 3 and error without numpy +Subject: [PATCH 01/20] Force usage of python 3 and error without numpy --- cmake/Dependencies.cmake | 6 +++--- diff --git a/recipe/patches/0002-Help-find-numpy.patch b/recipe/patches/0002-Help-find-numpy.patch index d660deda..833af9f1 100644 --- a/recipe/patches/0002-Help-find-numpy.patch +++ b/recipe/patches/0002-Help-find-numpy.patch @@ -1,7 +1,7 @@ From 21c30036b5b86f403c0cf4426165d9a6a50edb1a Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Tue, 1 Oct 2024 00:28:40 -0400 -Subject: [PATCH 02/21] Help find numpy +Subject: [PATCH 02/20] Help find numpy --- tools/setup_helpers/cmake.py | 6 ++++++ diff --git a/recipe/patches/0003-Add-USE_SYSTEM_NVTX-option-138287.patch b/recipe/patches/0003-Add-USE_SYSTEM_NVTX-option-138287.patch index d44513d4..a4c44e01 100644 --- a/recipe/patches/0003-Add-USE_SYSTEM_NVTX-option-138287.patch +++ b/recipe/patches/0003-Add-USE_SYSTEM_NVTX-option-138287.patch @@ -1,7 +1,7 @@ From d1826af525db41eda5020a1404f5d5521d67a5dc Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Sat, 19 Oct 2024 04:26:01 +0000 -Subject: [PATCH 03/21] Add USE_SYSTEM_NVTX option (#138287) +Subject: [PATCH 03/20] Add USE_SYSTEM_NVTX option (#138287) ## Summary diff --git a/recipe/patches/0004-Update-sympy-version.patch b/recipe/patches/0004-Update-sympy-version.patch index a73a7399..81a66b3f 100644 --- a/recipe/patches/0004-Update-sympy-version.patch +++ b/recipe/patches/0004-Update-sympy-version.patch @@ -1,7 +1,7 @@ From e3219c5fe8834753b0cf9e92be4d1ef1e874f370 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 17 Oct 2024 15:04:05 -0700 -Subject: [PATCH 04/21] Update sympy version +Subject: [PATCH 04/20] Update sympy version --- setup.py | 2 +- diff --git a/recipe/patches/0005-Fix-duplicate-linker-script.patch b/recipe/patches/0005-Fix-duplicate-linker-script.patch index 49e6d72b..cb09dcdf 100644 --- a/recipe/patches/0005-Fix-duplicate-linker-script.patch +++ b/recipe/patches/0005-Fix-duplicate-linker-script.patch @@ -1,7 +1,7 @@ From 08a1f44fbc81324aa98d720dfb7b87a261923ac2 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Sun, 3 Nov 2024 01:12:36 -0700 -Subject: [PATCH 05/21] Fix duplicate linker script +Subject: [PATCH 05/20] Fix duplicate linker script --- setup.py | 4 +++- diff --git a/recipe/patches/0006-fix-3.13-pickle-error-in-serialization.py-136034.patch b/recipe/patches/0006-fix-3.13-pickle-error-in-serialization.py-136034.patch index 99baed0a..326e6285 100644 --- a/recipe/patches/0006-fix-3.13-pickle-error-in-serialization.py-136034.patch +++ b/recipe/patches/0006-fix-3.13-pickle-error-in-serialization.py-136034.patch @@ -1,7 +1,7 @@ From 15df314a41c69a31c0443254d5552aa1b39d708d Mon Sep 17 00:00:00 2001 From: William Wen Date: Fri, 13 Sep 2024 13:02:33 -0700 -Subject: [PATCH 06/21] fix 3.13 pickle error in serialization.py (#136034) +Subject: [PATCH 06/20] fix 3.13 pickle error in serialization.py (#136034) Error encountered when adding dynamo 3.13 support. Pull Request resolved: https://github.com/pytorch/pytorch/pull/136034 diff --git a/recipe/patches/0007-Allow-users-to-overwrite-ld-with-environment-variabl.patch b/recipe/patches/0007-Allow-users-to-overwrite-ld-with-environment-variabl.patch index ae6a94cd..ad215aa9 100644 --- a/recipe/patches/0007-Allow-users-to-overwrite-ld-with-environment-variabl.patch +++ b/recipe/patches/0007-Allow-users-to-overwrite-ld-with-environment-variabl.patch @@ -1,7 +1,7 @@ From 655f694854c3eafdd631235b60bc6c1b279218ed Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Thu, 3 Oct 2024 22:49:56 -0400 -Subject: [PATCH 07/21] Allow users to overwrite ld with environment variables +Subject: [PATCH 07/20] Allow users to overwrite ld with environment variables This should help in the case of cross compilation. diff --git a/recipe/patches/0008-Allow-overriding-CUDA-related-paths.patch b/recipe/patches/0008-Allow-overriding-CUDA-related-paths.patch index b52d1588..fbfe0560 100644 --- a/recipe/patches/0008-Allow-overriding-CUDA-related-paths.patch +++ b/recipe/patches/0008-Allow-overriding-CUDA-related-paths.patch @@ -1,7 +1,7 @@ From f03bf82d9da9cccb2cf4d4833c1a6349622dc37d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Wed, 27 Nov 2024 13:47:23 +0100 -Subject: [PATCH 08/21] Allow overriding CUDA-related paths +Subject: [PATCH 08/20] Allow overriding CUDA-related paths --- cmake/Modules/FindCUDAToolkit.cmake | 2 +- diff --git a/recipe/patches/0009-Fix-test-test_linalg.py-for-NumPy-2-136800.patch b/recipe/patches/0009-Fix-test-test_linalg.py-for-NumPy-2-136800.patch index 7d9d1ab5..580fe42a 100644 --- a/recipe/patches/0009-Fix-test-test_linalg.py-for-NumPy-2-136800.patch +++ b/recipe/patches/0009-Fix-test-test_linalg.py-for-NumPy-2-136800.patch @@ -1,7 +1,7 @@ From 4b1faf6ba142953ce2730766db44f8d98d161ef0 Mon Sep 17 00:00:00 2001 From: Haifeng Jin Date: Tue, 1 Oct 2024 07:53:24 +0000 -Subject: [PATCH 09/21] Fix test/test_linalg.py for NumPy 2 (#136800) +Subject: [PATCH 09/20] Fix test/test_linalg.py for NumPy 2 (#136800) Related to #107302. diff --git a/recipe/patches/0010-Fixes-NumPy-2-test-failures-in-test_torch.py-137740.patch b/recipe/patches/0010-Fixes-NumPy-2-test-failures-in-test_torch.py-137740.patch index c28fe93a..6495b150 100644 --- a/recipe/patches/0010-Fixes-NumPy-2-test-failures-in-test_torch.py-137740.patch +++ b/recipe/patches/0010-Fixes-NumPy-2-test-failures-in-test_torch.py-137740.patch @@ -1,7 +1,7 @@ From 032b9be9ca7f9ae174e75554cecc82600ea3ef54 Mon Sep 17 00:00:00 2001 From: Haifeng Jin Date: Sat, 12 Oct 2024 02:40:17 +0000 -Subject: [PATCH 10/21] Fixes NumPy 2 test failures in test_torch.py (#137740) +Subject: [PATCH 10/20] Fixes NumPy 2 test failures in test_torch.py (#137740) Related to #107302 diff --git a/recipe/patches/0011-Use-BLAS_USE_CBLAS_DOT-for-OpenBLAS-builds.patch b/recipe/patches/0011-Use-BLAS_USE_CBLAS_DOT-for-OpenBLAS-builds.patch index c7b201b6..193ce159 100644 --- a/recipe/patches/0011-Use-BLAS_USE_CBLAS_DOT-for-OpenBLAS-builds.patch +++ b/recipe/patches/0011-Use-BLAS_USE_CBLAS_DOT-for-OpenBLAS-builds.patch @@ -1,7 +1,7 @@ From 56f1528fa072023fb2724d5abf8790f2f6cc3aaa Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 18 Dec 2024 03:59:00 +0000 -Subject: [PATCH 11/21] Use BLAS_USE_CBLAS_DOT for OpenBLAS builds +Subject: [PATCH 11/20] Use BLAS_USE_CBLAS_DOT for OpenBLAS builds There are two calling conventions for *dotu functions diff --git a/recipe/patches/0012-fix-issue-142484.patch b/recipe/patches/0012-fix-issue-142484.patch index db13f7ac..00f1e3d2 100644 --- a/recipe/patches/0012-fix-issue-142484.patch +++ b/recipe/patches/0012-fix-issue-142484.patch @@ -1,7 +1,7 @@ From beba58d724cc1bd7ca73660b0a5ad9e61ae0c562 Mon Sep 17 00:00:00 2001 From: "Zheng, Zhaoqiong" Date: Fri, 27 Dec 2024 13:49:36 +0800 -Subject: [PATCH 12/21] fix issue 142484 +Subject: [PATCH 12/20] fix issue 142484 From https://github.com/pytorch/pytorch/pull/143894 --- diff --git a/recipe/patches/0013-Fix-FindOpenBLAS.patch b/recipe/patches/0013-Fix-FindOpenBLAS.patch index 49d43f90..f539d0a6 100644 --- a/recipe/patches/0013-Fix-FindOpenBLAS.patch +++ b/recipe/patches/0013-Fix-FindOpenBLAS.patch @@ -1,7 +1,7 @@ From 816a248a4425a97350959e412666e6db9012a52e Mon Sep 17 00:00:00 2001 From: Bas Zalmstra Date: Thu, 16 May 2024 10:46:49 +0200 -Subject: [PATCH 13/21] Fix FindOpenBLAS +Subject: [PATCH 13/20] Fix FindOpenBLAS --- cmake/Modules/FindOpenBLAS.cmake | 15 +++++++++------ diff --git a/recipe/patches/0014-CD-Enable-Python-3.13-on-windows-138095.patch b/recipe/patches/0014-CD-Enable-Python-3.13-on-windows-138095.patch index af808376..7a2df88f 100644 --- a/recipe/patches/0014-CD-Enable-Python-3.13-on-windows-138095.patch +++ b/recipe/patches/0014-CD-Enable-Python-3.13-on-windows-138095.patch @@ -1,7 +1,7 @@ From db896f927403f55a18f931b18a6469cb4e37d322 Mon Sep 17 00:00:00 2001 From: atalman Date: Tue, 12 Nov 2024 12:28:10 +0000 -Subject: [PATCH 14/21] CD Enable Python 3.13 on windows (#138095) +Subject: [PATCH 14/20] CD Enable Python 3.13 on windows (#138095) Adding CD windows. Part of: https://github.com/pytorch/pytorch/issues/130249 Builder PR landed with smoke test: https://github.com/pytorch/builder/pull/2035 diff --git a/recipe/patches/0015-simplify-torch.utils.cpp_extension.include_paths-use.patch b/recipe/patches/0015-simplify-torch.utils.cpp_extension.include_paths-use.patch index 6cf5ea9c..3736ca78 100644 --- a/recipe/patches/0015-simplify-torch.utils.cpp_extension.include_paths-use.patch +++ b/recipe/patches/0015-simplify-torch.utils.cpp_extension.include_paths-use.patch @@ -1,7 +1,7 @@ From 33790dfbf966e7d8ea4ff6798d2ff92474d84079 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 23 Jan 2025 22:46:58 +1100 -Subject: [PATCH 15/21] simplify torch.utils.cpp_extension.include_paths; use +Subject: [PATCH 15/20] simplify torch.utils.cpp_extension.include_paths; use it in cpp_builder The /TH headers have not existed since pytorch 1.11 diff --git a/recipe/patches/0016-point-include-paths-to-PREFIX-include.patch b/recipe/patches/0016-point-include-paths-to-PREFIX-include.patch index ed6b74f6..3b10823e 100644 --- a/recipe/patches/0016-point-include-paths-to-PREFIX-include.patch +++ b/recipe/patches/0016-point-include-paths-to-PREFIX-include.patch @@ -1,24 +1,33 @@ -From 799f6fa59dac93dabbbcf72d46f4e1334e3d65d9 Mon Sep 17 00:00:00 2001 +From aece69c6b3c19c9bfbe2a7b0a536832a1349130f Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 23 Jan 2025 22:58:14 +1100 -Subject: [PATCH 16/21] point include paths to $PREFIX/include +Subject: [PATCH 16/20] point include paths to $PREFIX/include --- - torch/utils/cpp_extension.py | 9 +++++++++ - 1 file changed, 9 insertions(+) + torch/utils/cpp_extension.py | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) diff --git a/torch/utils/cpp_extension.py b/torch/utils/cpp_extension.py -index 3f584ef5598..4210f62b6db 100644 +index 3f584ef5598..effee5ad420 100644 --- a/torch/utils/cpp_extension.py +++ b/torch/utils/cpp_extension.py -@@ -1155,10 +1155,19 @@ def include_paths(cuda: bool = False) -> List[str]: +@@ -1155,10 +1155,28 @@ def include_paths(cuda: bool = False) -> List[str]: A list of include path strings. """ lib_include = os.path.join(_TORCH_PATH, 'include') -+ if os.environ.get("CONDA_BUILD", None) is not None: ++ if (os.environ.get("CONDA_BUILD", None) is not None ++ and os.environ.get("CONDA_BUILD_CROSS_COMPILATION", None) is not None): ++ # to avoid problems in cross-compilation, we need to point to the same environment ++ # where the currently running pytorch is -- i.e. the BUILD_PREFIX. See ++ # https://github.com/conda-forge/pytorch-cpu-feedstock/issues/349 ++ pieces = [os.environ["BUILD_PREFIX"]] + IS_WINDOWS * ["Library"] + ["include"] ++ lib_include = os.path.join(*pieces) ++ elif os.environ.get("CONDA_BUILD", None) is not None: ++ # regular build (& testing) phase --> PREFIX is set + pieces = [os.environ["PREFIX"]] + IS_WINDOWS * ["Library"] + ["include"] + lib_include = os.path.join(*pieces) + elif os.environ.get("CONDA_PREFIX", None) is not None: ++ # final environment + pieces = [os.environ["CONDA_PREFIX"]] + IS_WINDOWS * ["Library"] + ["include"] + lib_include = os.path.join(*pieces) paths = [ diff --git a/recipe/patches/0017-Add-conda-prefix-to-inductor-include-paths.patch b/recipe/patches/0017-Add-conda-prefix-to-inductor-include-paths.patch index aff55f95..e8c197e7 100644 --- a/recipe/patches/0017-Add-conda-prefix-to-inductor-include-paths.patch +++ b/recipe/patches/0017-Add-conda-prefix-to-inductor-include-paths.patch @@ -1,7 +1,7 @@ -From 9f73a02bacf9680833ac64657fde6762d33ab200 Mon Sep 17 00:00:00 2001 +From fa2a4a321756067ebf9cbafa30807991f1c082ab Mon Sep 17 00:00:00 2001 From: Daniel Petry Date: Tue, 21 Jan 2025 17:45:23 -0600 -Subject: [PATCH 17/21] Add conda prefix to inductor include paths +Subject: [PATCH 17/20] Add conda prefix to inductor include paths Currently inductor doesn't look in conda's includes and libs. This results in errors when it tries to compile, if system versions are being used of diff --git a/recipe/patches/0018-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch b/recipe/patches/0018-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch index 426e6015..c57f05bf 100644 --- a/recipe/patches/0018-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch +++ b/recipe/patches/0018-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch @@ -1,7 +1,7 @@ -From b0cfa0f728e96a3a9d6f7434e2c02d74d6daa9a9 Mon Sep 17 00:00:00 2001 +From 660565fb69f4eb059f5dff29ebe98265af1ca903 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 28 Jan 2025 14:15:34 +1100 -Subject: [PATCH 18/21] make ATEN_INCLUDE_DIR relative to TORCH_INSTALL_PREFIX +Subject: [PATCH 18/20] make ATEN_INCLUDE_DIR relative to TORCH_INSTALL_PREFIX we cannot set CMAKE_INSTALL_PREFIX without the pytorch build complaining, but we can use TORCH_INSTALL_PREFIX, which is set correctly relative to our CMake files already: diff --git a/recipe/patches/0019-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch b/recipe/patches/0019-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch index 78950986..36dcf99a 100644 --- a/recipe/patches/0019-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch +++ b/recipe/patches/0019-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch @@ -1,7 +1,7 @@ -From f7db4cbfb0af59027ed8bdcd0387dba6fbcb1192 Mon Sep 17 00:00:00 2001 +From 6f9510cd0df315cc0a6122f50be0e1305c03e785 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 28 Jan 2025 10:58:29 +1100 -Subject: [PATCH 19/21] remove `DESTINATION lib` from CMake `install(TARGETS` +Subject: [PATCH 19/20] remove `DESTINATION lib` from CMake `install(TARGETS` directives Suggested-By: Silvio Traversaro diff --git a/recipe/patches/0021-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch b/recipe/patches/0020-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch similarity index 99% rename from recipe/patches/0021-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch rename to recipe/patches/0020-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch index a6f17c5d..790b86c5 100644 --- a/recipe/patches/0021-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch +++ b/recipe/patches/0020-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch @@ -1,7 +1,7 @@ -From 1780879024ea952f8591aa175a9787f93e697368 Mon Sep 17 00:00:00 2001 +From 28bcd1ee9543309281c784fff64d35db3abd414b Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 30 Jan 2025 08:33:44 +1100 -Subject: [PATCH 21/21] avoid deprecated `find_package(CUDA)` in caffe2 CMake +Subject: [PATCH 20/20] avoid deprecated `find_package(CUDA)` in caffe2 CMake metadata vendor the not-available-anymore function torch_cuda_get_nvcc_gencode_flag from CMake From 25fc472cb723c9d8c8868279ee6027bb31758be1 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 8 Feb 2025 18:50:47 +1100 Subject: [PATCH 11/15] skip test_mutable_custom_op_fixed_layout everywhere --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e7280f01..f1c2a93b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -459,7 +459,7 @@ outputs: {% set skips = skips ~ " or (TestAutograd and test_profiler_propagation)" %} # tests that fail due to resource clean-up issues (non-unique temporary libraries), see # https://github.com/conda-forge/pytorch-cpu-feedstock/pull/318#issuecomment-2620080859 - {% set skips = skips ~ " or test_mutable_custom_op_fixed_layout" %} # [cuda_compiler_version != "None"] + {% set skips = skips ~ " or test_mutable_custom_op_fixed_layout" %} # trivial accuracy problems {% set skips = skips ~ " or test_BCELoss_weights_no_reduce_cuda" %} # [unix and cuda_compiler_version != "None"] {% set skips = skips ~ " or test_ctc_loss_cudnn_tensor_cuda " %} # [unix and cuda_compiler_version != "None"] From c47b3eb57ce0fbf3f1bda3fb2f1aad1d4bff8eea Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 8 Feb 2025 19:12:36 +1100 Subject: [PATCH 12/15] robustify CONDA_BUILD_CROSS_COMPILATION handling --- .../0016-point-include-paths-to-PREFIX-include.patch | 6 +++--- .../0017-Add-conda-prefix-to-inductor-include-paths.patch | 2 +- ...ke-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch | 2 +- ...move-DESTINATION-lib-from-CMake-install-TARGETS-di.patch | 2 +- ...oid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/recipe/patches/0016-point-include-paths-to-PREFIX-include.patch b/recipe/patches/0016-point-include-paths-to-PREFIX-include.patch index 3b10823e..6b5d8b7e 100644 --- a/recipe/patches/0016-point-include-paths-to-PREFIX-include.patch +++ b/recipe/patches/0016-point-include-paths-to-PREFIX-include.patch @@ -1,4 +1,4 @@ -From aece69c6b3c19c9bfbe2a7b0a536832a1349130f Mon Sep 17 00:00:00 2001 +From 5266d900595715b58ab394a8102e722e17a6dd54 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 23 Jan 2025 22:58:14 +1100 Subject: [PATCH 16/20] point include paths to $PREFIX/include @@ -8,7 +8,7 @@ Subject: [PATCH 16/20] point include paths to $PREFIX/include 1 file changed, 18 insertions(+) diff --git a/torch/utils/cpp_extension.py b/torch/utils/cpp_extension.py -index 3f584ef5598..effee5ad420 100644 +index 3f584ef5598..22da37092aa 100644 --- a/torch/utils/cpp_extension.py +++ b/torch/utils/cpp_extension.py @@ -1155,10 +1155,28 @@ def include_paths(cuda: bool = False) -> List[str]: @@ -16,7 +16,7 @@ index 3f584ef5598..effee5ad420 100644 """ lib_include = os.path.join(_TORCH_PATH, 'include') + if (os.environ.get("CONDA_BUILD", None) is not None -+ and os.environ.get("CONDA_BUILD_CROSS_COMPILATION", None) is not None): ++ and os.environ.get("CONDA_BUILD_CROSS_COMPILATION", None) not in (None, "", "0")): + # to avoid problems in cross-compilation, we need to point to the same environment + # where the currently running pytorch is -- i.e. the BUILD_PREFIX. See + # https://github.com/conda-forge/pytorch-cpu-feedstock/issues/349 diff --git a/recipe/patches/0017-Add-conda-prefix-to-inductor-include-paths.patch b/recipe/patches/0017-Add-conda-prefix-to-inductor-include-paths.patch index e8c197e7..09a06bec 100644 --- a/recipe/patches/0017-Add-conda-prefix-to-inductor-include-paths.patch +++ b/recipe/patches/0017-Add-conda-prefix-to-inductor-include-paths.patch @@ -1,4 +1,4 @@ -From fa2a4a321756067ebf9cbafa30807991f1c082ab Mon Sep 17 00:00:00 2001 +From e8e76bd1733e1496ddb6818e26962964a508d39f Mon Sep 17 00:00:00 2001 From: Daniel Petry Date: Tue, 21 Jan 2025 17:45:23 -0600 Subject: [PATCH 17/20] Add conda prefix to inductor include paths diff --git a/recipe/patches/0018-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch b/recipe/patches/0018-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch index c57f05bf..648092c9 100644 --- a/recipe/patches/0018-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch +++ b/recipe/patches/0018-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch @@ -1,4 +1,4 @@ -From 660565fb69f4eb059f5dff29ebe98265af1ca903 Mon Sep 17 00:00:00 2001 +From 2b263d48975028456c3676ddf06ded74779e4a14 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 28 Jan 2025 14:15:34 +1100 Subject: [PATCH 18/20] make ATEN_INCLUDE_DIR relative to TORCH_INSTALL_PREFIX diff --git a/recipe/patches/0019-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch b/recipe/patches/0019-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch index 36dcf99a..9a72de5b 100644 --- a/recipe/patches/0019-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch +++ b/recipe/patches/0019-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch @@ -1,4 +1,4 @@ -From 6f9510cd0df315cc0a6122f50be0e1305c03e785 Mon Sep 17 00:00:00 2001 +From 63329f38fc6d2d29eb88802f40db51f7080e6d67 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 28 Jan 2025 10:58:29 +1100 Subject: [PATCH 19/20] remove `DESTINATION lib` from CMake `install(TARGETS` diff --git a/recipe/patches/0020-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch b/recipe/patches/0020-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch index 790b86c5..2b9d5158 100644 --- a/recipe/patches/0020-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch +++ b/recipe/patches/0020-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch @@ -1,4 +1,4 @@ -From 28bcd1ee9543309281c784fff64d35db3abd414b Mon Sep 17 00:00:00 2001 +From fe088e2690abd96fcbc7b8f1190b343b16c6e9ee Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 30 Jan 2025 08:33:44 +1100 Subject: [PATCH 20/20] avoid deprecated `find_package(CUDA)` in caffe2 CMake From d36c1b4bf0d7dea64b7c2b7cc37b15958687b544 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 9 Feb 2025 00:01:06 +1100 Subject: [PATCH 13/15] skip torchinductor failures on osx --- recipe/meta.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index f1c2a93b..d980243e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -481,6 +481,10 @@ outputs: {% set skips = skips ~ " or test_base_does_not_require_grad_mode_nothing" %} {% set skips = skips ~ " or test_base_does_not_require_grad_mode_warn" %} {% set skips = skips ~ " or test_composite_registered_to_cpu_mode_nothing" %} + # torchinductor failures on osx + {% set skips = skips ~ " or test_AllenaiLongformerBase_repro_cpu" %} # [osx] + {% set skips = skips ~ " or (test_torchinductor and test_full_dtype)" %} # [osx] + {% set skips = skips ~ " or (test_torchinductor and test_neg_index_cpu)" %} # [osx] # these tests are failing on windows {% set skips = skips ~ " or (TestNN and test_Conv1d_dilated)" %} # [win] {% set skips = skips ~ " or (TestNN and test_Conv1d_pad_same_dilated)" %} # [win] From 2af8e586b55684685063b4757165feac510c5680 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 9 Feb 2025 18:53:27 +1100 Subject: [PATCH 14/15] set CUDA_VERSION during build; test `torch.version.cuda` is correct --- recipe/bld.bat | 1 + recipe/build.sh | 1 + recipe/meta.yaml | 1 + 3 files changed, 3 insertions(+) diff --git a/recipe/bld.bat b/recipe/bld.bat index 4089b425..9684f7fd 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -93,6 +93,7 @@ if not "%cuda_compiler_version%" == "None" ( set MAGMA_HOME=%LIBRARY_PREFIX% set "PATH=%CUDA_BIN_PATH%;%PATH%" set CUDNN_INCLUDE_DIR=%LIBRARY_PREFIX%\include + set "CUDA_VERSION=%cuda_compiler_version%" @REM turn off very noisy nvcc warnings set "CUDAFLAGS=-w --ptxas-options=-w" ) else ( diff --git a/recipe/build.sh b/recipe/build.sh index 22dde8f0..f82d5d0a 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -219,6 +219,7 @@ elif [[ ${cuda_compiler_version} != "None" ]]; then export USE_STATIC_CUDNN=0 export MAGMA_HOME="${PREFIX}" export USE_MAGMA=1 + export CUDA_VERSION=$cuda_compiler_version # turn off noisy nvcc warnings export CMAKE_CUDA_FLAGS="-w --ptxas-options=-w" else diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d980243e..dc404f7a 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -411,6 +411,7 @@ outputs: - python -c "import torch; assert torch.backends.cuda.is_built()" # [linux64 and (cuda_compiler_version != "None")] - python -c "import torch; assert torch.backends.cudnn.is_available()" # [linux64 and (cuda_compiler_version != "None")] - python -c "import torch; assert torch.backends.cudnn.enabled" # [linux64 and (cuda_compiler_version != "None")] + - python -c "import torch; assert torch.version.cuda is not None" # [cuda_compiler_version != "None"] # At conda-forge, we target versions of OSX that are too old for MPS support # But if users install a newer version of OSX, they will have MPS support # https://github.com/conda-forge/pytorch-cpu-feedstock/pull/123#issuecomment-1186355073 From 1acfd43e6d20e9bbe8785c7d61b919a5812f67fa Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 9 Feb 2025 18:55:27 +1100 Subject: [PATCH 15/15] enable `torch.backends` tests also for win+CUDA --- recipe/meta.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index dc404f7a..a3899433 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -407,10 +407,10 @@ outputs: - python -c "import torch; import numpy" - python -c "import numpy; import torch" # distributed support is enabled by default on linux; for mac, we enable it manually in build.sh - - python -c "import torch; assert torch.distributed.is_available()" # [linux or osx] - - python -c "import torch; assert torch.backends.cuda.is_built()" # [linux64 and (cuda_compiler_version != "None")] - - python -c "import torch; assert torch.backends.cudnn.is_available()" # [linux64 and (cuda_compiler_version != "None")] - - python -c "import torch; assert torch.backends.cudnn.enabled" # [linux64 and (cuda_compiler_version != "None")] + - python -c "import torch; assert torch.distributed.is_available()" # [linux or osx] + - python -c "import torch; assert torch.backends.cuda.is_built()" # [cuda_compiler_version != "None"] + - python -c "import torch; assert torch.backends.cudnn.is_available()" # [cuda_compiler_version != "None"] + - python -c "import torch; assert torch.backends.cudnn.enabled" # [cuda_compiler_version != "None"] - python -c "import torch; assert torch.version.cuda is not None" # [cuda_compiler_version != "None"] # At conda-forge, we target versions of OSX that are too old for MPS support # But if users install a newer version of OSX, they will have MPS support