diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml deleted file mode 100755 index 45682f922..000000000 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ /dev/null @@ -1,70 +0,0 @@ -# This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- - -jobs: -- job: osx - pool: - vmImage: macOS-15 - strategy: - matrix: - osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython: - CONFIG: osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython - UPLOAD_PACKAGES: 'True' - osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython: - CONFIG: osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython - UPLOAD_PACKAGES: 'True' - osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython: - CONFIG: osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython - UPLOAD_PACKAGES: 'True' - osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313: - CONFIG: osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313 - UPLOAD_PACKAGES: 'True' - osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython: - CONFIG: osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython - UPLOAD_PACKAGES: 'True' - osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython: - CONFIG: osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython - UPLOAD_PACKAGES: 'True' - osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython: - CONFIG: osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython - UPLOAD_PACKAGES: 'True' - osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313: - CONFIG: osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313 - UPLOAD_PACKAGES: 'True' - osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython: - CONFIG: osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython - UPLOAD_PACKAGES: 'True' - osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython: - CONFIG: osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython - UPLOAD_PACKAGES: 'True' - osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython: - CONFIG: osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython - UPLOAD_PACKAGES: 'True' - osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313: - CONFIG: osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313 - UPLOAD_PACKAGES: 'True' - timeoutInMinutes: 360 - variables: {} - - steps: - # TODO: Fast finish on azure pipelines? - - script: | - export CI=azure - export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) - export remote_url=$(Build.Repository.Uri) - export sha=$(Build.SourceVersion) - export OSX_FORCE_SDK_DOWNLOAD="1" - export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME - export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) - if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then - export IS_PR_BUILD="True" - else - export IS_PR_BUILD="False" - fi - ./.scripts/run_osx_build.sh - displayName: Run OSX build - env: - BINSTAR_TOKEN: $(BINSTAR_TOKEN) - FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) diff --git a/.ci_support/linux_64_blas_implgenericchannel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse.yaml b/.ci_support/linux_64_blas_implgenericchannel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse.yaml index df86cfd65..128dd0f14 100644 --- a/.ci_support/linux_64_blas_implgenericchannel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse.yaml +++ b/.ci_support/linux_64_blas_implgenericchannel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse.yaml @@ -17,13 +17,15 @@ cuda_compiler: cuda_compiler_version: - '12.9' cudnn: -- '9.10' +- '9' cxx_compiler: - gxx cxx_compiler_version: - '14' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma9 +fmt: +- '12.0' github_actions_labels: - cirun-openstack-gpu-2xlarge is_rc: @@ -44,8 +46,6 @@ libtorch: - '2.7' magma: - '2.9' -megabuild: -- true mkl: - '2025' mkl_devel: @@ -61,7 +61,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x pybind11_abi: -- '4' +- '11' python: - 3.10.* *_cpython - 3.11.* *_cpython @@ -76,7 +76,6 @@ zip_keys: - cxx_compiler_version - c_stdlib_version - cuda_compiler_version - - cudnn - - channel_targets - is_rc zlib: diff --git a/.ci_support/linux_64_blas_implgenericchannel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml b/.ci_support/linux_64_blas_implgenericchannel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml index 1518e21be..96be2927b 100644 --- a/.ci_support/linux_64_blas_implgenericchannel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml +++ b/.ci_support/linux_64_blas_implgenericchannel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml @@ -24,6 +24,8 @@ cxx_compiler_version: - '14' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma9 +fmt: +- '12.0' github_actions_labels: - cirun-openstack-gpu-2xlarge is_rc: @@ -44,8 +46,6 @@ libtorch: - '2.7' magma: - '2.9' -megabuild: -- true mkl: - '2025' mkl_devel: @@ -61,7 +61,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x pybind11_abi: -- '4' +- '11' python: - 3.10.* *_cpython - 3.11.* *_cpython @@ -76,7 +76,6 @@ zip_keys: - cxx_compiler_version - c_stdlib_version - cuda_compiler_version - - cudnn - - channel_targets - is_rc zlib: diff --git a/.ci_support/linux_64_blas_implmklchannel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse.yaml b/.ci_support/linux_64_blas_implmklchannel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse.yaml index 38c27f7d9..1134e6b03 100644 --- a/.ci_support/linux_64_blas_implmklchannel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse.yaml +++ b/.ci_support/linux_64_blas_implmklchannel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse.yaml @@ -17,13 +17,15 @@ cuda_compiler: cuda_compiler_version: - '12.9' cudnn: -- '9.10' +- '9' cxx_compiler: - gxx cxx_compiler_version: - '14' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma9 +fmt: +- '12.0' github_actions_labels: - cirun-openstack-gpu-2xlarge is_rc: @@ -44,8 +46,6 @@ libtorch: - '2.7' magma: - '2.9' -megabuild: -- true mkl: - '2025' mkl_devel: @@ -61,7 +61,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x pybind11_abi: -- '4' +- '11' python: - 3.10.* *_cpython - 3.11.* *_cpython @@ -76,7 +76,6 @@ zip_keys: - cxx_compiler_version - c_stdlib_version - cuda_compiler_version - - cudnn - - channel_targets - is_rc zlib: diff --git a/.ci_support/linux_64_blas_implmklchannel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml b/.ci_support/linux_64_blas_implmklchannel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml index 22425b7bd..7ea16ec20 100644 --- a/.ci_support/linux_64_blas_implmklchannel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml +++ b/.ci_support/linux_64_blas_implmklchannel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml @@ -24,6 +24,8 @@ cxx_compiler_version: - '14' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma9 +fmt: +- '12.0' github_actions_labels: - cirun-openstack-gpu-2xlarge is_rc: @@ -44,8 +46,6 @@ libtorch: - '2.7' magma: - '2.9' -megabuild: -- true mkl: - '2025' mkl_devel: @@ -61,7 +61,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x pybind11_abi: -- '4' +- '11' python: - 3.10.* *_cpython - 3.11.* *_cpython @@ -76,7 +76,6 @@ zip_keys: - cxx_compiler_version - c_stdlib_version - cuda_compiler_version - - cudnn - - channel_targets - is_rc zlib: diff --git a/.ci_support/linux_aarch64_channel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse.yaml b/.ci_support/linux_aarch64_channel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse.yaml index 2f89bcc36..693408283 100644 --- a/.ci_support/linux_aarch64_channel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse.yaml +++ b/.ci_support/linux_aarch64_channel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse.yaml @@ -17,13 +17,15 @@ cuda_compiler: cuda_compiler_version: - '12.9' cudnn: -- '9.10' +- '9' cxx_compiler: - gxx cxx_compiler_version: - '13' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma9 +fmt: +- '12.0' github_actions_labels: - cirun-openstack-gpu-2xlarge is_rc: @@ -44,8 +46,6 @@ libtorch: - '2.7' magma: - '2.9' -megabuild: -- true mkl: - '2025' nccl: @@ -59,7 +59,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x pybind11_abi: -- '4' +- '11' python: - 3.10.* *_cpython - 3.11.* *_cpython @@ -74,7 +74,6 @@ zip_keys: - cxx_compiler_version - c_stdlib_version - cuda_compiler_version - - cudnn - - channel_targets - is_rc zlib: diff --git a/.ci_support/linux_aarch64_channel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml b/.ci_support/linux_aarch64_channel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml index 6798e33df..1721a78b1 100644 --- a/.ci_support/linux_aarch64_channel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml +++ b/.ci_support/linux_aarch64_channel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse.yaml @@ -24,6 +24,8 @@ cxx_compiler_version: - '13' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma9 +fmt: +- '12.0' github_actions_labels: - cirun-openstack-gpu-2xlarge is_rc: @@ -44,8 +46,6 @@ libtorch: - '2.7' magma: - '2.9' -megabuild: -- true mkl: - '2025' nccl: @@ -59,7 +59,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x pybind11_abi: -- '4' +- '11' python: - 3.10.* *_cpython - 3.11.* *_cpython @@ -74,7 +74,6 @@ zip_keys: - cxx_compiler_version - c_stdlib_version - cuda_compiler_version - - cudnn - - channel_targets - is_rc zlib: diff --git a/.ci_support/migrations/cuda129.yaml b/.ci_support/migrations/cuda129.yaml index 42ccc7596..20f6fb21f 100644 --- a/.ci_support/migrations/cuda129.yaml +++ b/.ci_support/migrations/cuda129.yaml @@ -51,9 +51,6 @@ cuda_compiler_version: # [((linux and (x86_64 or aarch64)) or win64) and cuda_compiler_version_min: # [((linux and (x86_64 or aarch64)) or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] - 12.9 # [((linux and (x86_64 or aarch64)) or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] -cudnn: # [((linux and (x86_64 or aarch64)) or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] - - 9 # [((linux and (x86_64 or aarch64)) or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] - c_stdlib_version: # [(linux and (x86_64 or aarch64)) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] - 2.17 # [(linux and (x86_64 or aarch64)) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] diff --git a/.ci_support/migrations/cudnn910.yaml b/.ci_support/migrations/cudnn910.yaml deleted file mode 100644 index 0a657ef15..000000000 --- a/.ci_support/migrations/cudnn910.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# needs to be ordered before CUDA 13.0 migrator -migrator_ts: 1755016000 -__migrator: - kind: - version - migration_number: - 1 - build_number: - 1 - ordering: - cudnn: - - None - - 9 - - 9.10 - commit_message: | - Rebuild for cudnn 9.10 - - Conda-forge assumed cudnn 9.x builds would stay compatible with each other. - This is the case for the API/ABI of the library, but nvidia dropped support - for older GPU architectures in cudnn 9.11. Since we have no package-level - metadata about compatibility with specific GPU architectures, this effectively - breaks all packages built atop cudnn for users on affected older GPUs. - - In order to remedy this situation, we need to rebuild all cudnn-dependent - feedstocks against cudnn 9.10 (the last version with full architecture support), - before we mark all those newer cudnn builds as broken. This only affects artefacts - for CUDA 12.x; those for CUDA 13.x are not affected, since CUDA 13 never supported - those older architectures in the first place. - - For more details see: https://github.com/conda-forge/cudnn-feedstock/issues/124 - -cudnn: - - None - - 9.10 # [((linux and not ppc64le) or win64) and os.environ.get("CF_CUDA_ENABLED", "False") == "True"] diff --git a/.ci_support/migrations/fmt12_spdlog116.yaml b/.ci_support/migrations/fmt12_spdlog116.yaml new file mode 100644 index 000000000..87c31a2ba --- /dev/null +++ b/.ci_support/migrations/fmt12_spdlog116.yaml @@ -0,0 +1,10 @@ +__migrator: + build_number: 1 + commit_message: Rebuild for fmt 12.0 and spdlog 1.16 + kind: version + migration_number: 1 +migrator_ts: 1760196591.995821 +fmt: +- '12.0' +spdlog: +- '1.16' diff --git a/.ci_support/migrations/pybind11_abi11.yaml b/.ci_support/migrations/pybind11_abi11.yaml new file mode 100644 index 000000000..172a6d909 --- /dev/null +++ b/.ci_support/migrations/pybind11_abi11.yaml @@ -0,0 +1,8 @@ +__migrator: + build_number: 1 + commit_message: Rebuild for pybind11 3 and pybind11_abi 11 + kind: version + migration_number: 1 +migrator_ts: 1752454025.946169 +pybind11_abi: +- '11' diff --git a/.ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython.yaml b/.ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalse.yaml similarity index 88% rename from .ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython.yaml rename to .ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalse.yaml index 0d29c876a..2ff370171 100644 --- a/.ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython.yaml +++ b/.ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalse.yaml @@ -24,6 +24,10 @@ cxx_compiler: - clangxx cxx_compiler_version: - '19' +fmt: +- '12.0' +github_actions_labels: +- cirun-macos-m4-large is_rc: - 'False' libabseil: @@ -44,8 +48,6 @@ llvm_openmp: - '19' macos_machine: - x86_64-apple-darwin13.4.0 -megabuild: -- false mkl: - '2023' mkl_devel: @@ -59,9 +61,12 @@ pin_run_as_build: min_pin: x.x max_pin: x.x pybind11_abi: -- '4' +- '11' python: +- 3.10.* *_cpython +- 3.11.* *_cpython - 3.12.* *_cpython +- 3.13.* *_cp313 pytorch: - '2.7' target_platform: diff --git a/.ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython.yaml b/.ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython.yaml deleted file mode 100644 index 8faa65acb..000000000 --- a/.ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython.yaml +++ /dev/null @@ -1,75 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' -MACOSX_SDK_VERSION: -- '13.3' -blas_impl: -- generic -c_compiler: -- clang -c_compiler_version: -- '19' -c_stdlib: -- macosx_deployment_target -c_stdlib_version: -- '11.0' -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- None -cxx_compiler: -- clangxx -cxx_compiler_version: -- '19' -is_rc: -- 'False' -libabseil: -- '20250512' -libblas: -- 3.9.* *netlib -libcblas: -- 3.9.* *netlib -liblapack: -- 3.9.* *netlib -libmagma_sparse: -- '2.9' -libprotobuf: -- 6.31.1 -libtorch: -- '2.7' -llvm_openmp: -- '19' -macos_machine: -- x86_64-apple-darwin13.4.0 -megabuild: -- false -mkl: -- '2023' -mkl_devel: -- '2023' -numpy: -- '2' -orc: -- 2.2.1 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -pybind11_abi: -- '4' -python: -- 3.10.* *_cpython -pytorch: -- '2.7' -target_platform: -- osx-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version -- - channel_targets - - is_rc -zlib: -- '1' diff --git a/.ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython.yaml b/.ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython.yaml deleted file mode 100644 index 4b2a1cd81..000000000 --- a/.ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython.yaml +++ /dev/null @@ -1,75 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' -MACOSX_SDK_VERSION: -- '13.3' -blas_impl: -- generic -c_compiler: -- clang -c_compiler_version: -- '19' -c_stdlib: -- macosx_deployment_target -c_stdlib_version: -- '11.0' -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- None -cxx_compiler: -- clangxx -cxx_compiler_version: -- '19' -is_rc: -- 'False' -libabseil: -- '20250512' -libblas: -- 3.9.* *netlib -libcblas: -- 3.9.* *netlib -liblapack: -- 3.9.* *netlib -libmagma_sparse: -- '2.9' -libprotobuf: -- 6.31.1 -libtorch: -- '2.7' -llvm_openmp: -- '19' -macos_machine: -- x86_64-apple-darwin13.4.0 -megabuild: -- false -mkl: -- '2023' -mkl_devel: -- '2023' -numpy: -- '2' -orc: -- 2.2.1 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -pybind11_abi: -- '4' -python: -- 3.11.* *_cpython -pytorch: -- '2.7' -target_platform: -- osx-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version -- - channel_targets - - is_rc -zlib: -- '1' diff --git a/.ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313.yaml b/.ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313.yaml deleted file mode 100644 index 10c928df5..000000000 --- a/.ci_support/osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313.yaml +++ /dev/null @@ -1,75 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' -MACOSX_SDK_VERSION: -- '13.3' -blas_impl: -- generic -c_compiler: -- clang -c_compiler_version: -- '19' -c_stdlib: -- macosx_deployment_target -c_stdlib_version: -- '11.0' -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- None -cxx_compiler: -- clangxx -cxx_compiler_version: -- '19' -is_rc: -- 'False' -libabseil: -- '20250512' -libblas: -- 3.9.* *netlib -libcblas: -- 3.9.* *netlib -liblapack: -- 3.9.* *netlib -libmagma_sparse: -- '2.9' -libprotobuf: -- 6.31.1 -libtorch: -- '2.7' -llvm_openmp: -- '19' -macos_machine: -- x86_64-apple-darwin13.4.0 -megabuild: -- false -mkl: -- '2023' -mkl_devel: -- '2023' -numpy: -- '2' -orc: -- 2.2.1 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -pybind11_abi: -- '4' -python: -- 3.13.* *_cp313 -pytorch: -- '2.7' -target_platform: -- osx-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version -- - channel_targets - - is_rc -zlib: -- '1' diff --git a/.ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython.yaml b/.ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalse.yaml similarity index 88% rename from .ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython.yaml rename to .ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalse.yaml index 631548db1..e08cae1bb 100644 --- a/.ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython.yaml +++ b/.ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalse.yaml @@ -24,6 +24,10 @@ cxx_compiler: - clangxx cxx_compiler_version: - '19' +fmt: +- '12.0' +github_actions_labels: +- cirun-macos-m4-large is_rc: - 'False' libabseil: @@ -44,8 +48,6 @@ llvm_openmp: - '19' macos_machine: - x86_64-apple-darwin13.4.0 -megabuild: -- false mkl: - '2023' mkl_devel: @@ -59,9 +61,12 @@ pin_run_as_build: min_pin: x.x max_pin: x.x pybind11_abi: -- '4' +- '11' python: +- 3.10.* *_cpython - 3.11.* *_cpython +- 3.12.* *_cpython +- 3.13.* *_cp313 pytorch: - '2.7' target_platform: diff --git a/.ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython.yaml b/.ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython.yaml deleted file mode 100644 index babce382c..000000000 --- a/.ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython.yaml +++ /dev/null @@ -1,75 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' -MACOSX_SDK_VERSION: -- '13.3' -blas_impl: -- mkl -c_compiler: -- clang -c_compiler_version: -- '19' -c_stdlib: -- macosx_deployment_target -c_stdlib_version: -- '11.0' -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- None -cxx_compiler: -- clangxx -cxx_compiler_version: -- '19' -is_rc: -- 'False' -libabseil: -- '20250512' -libblas: -- 3.9.* *netlib -libcblas: -- 3.9.* *netlib -liblapack: -- 3.9.* *netlib -libmagma_sparse: -- '2.9' -libprotobuf: -- 6.31.1 -libtorch: -- '2.7' -llvm_openmp: -- '19' -macos_machine: -- x86_64-apple-darwin13.4.0 -megabuild: -- false -mkl: -- '2023' -mkl_devel: -- '2023' -numpy: -- '2' -orc: -- 2.2.1 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -pybind11_abi: -- '4' -python: -- 3.10.* *_cpython -pytorch: -- '2.7' -target_platform: -- osx-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version -- - channel_targets - - is_rc -zlib: -- '1' diff --git a/.ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython.yaml b/.ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython.yaml deleted file mode 100644 index 4dc222c82..000000000 --- a/.ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython.yaml +++ /dev/null @@ -1,75 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' -MACOSX_SDK_VERSION: -- '13.3' -blas_impl: -- mkl -c_compiler: -- clang -c_compiler_version: -- '19' -c_stdlib: -- macosx_deployment_target -c_stdlib_version: -- '11.0' -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- None -cxx_compiler: -- clangxx -cxx_compiler_version: -- '19' -is_rc: -- 'False' -libabseil: -- '20250512' -libblas: -- 3.9.* *netlib -libcblas: -- 3.9.* *netlib -liblapack: -- 3.9.* *netlib -libmagma_sparse: -- '2.9' -libprotobuf: -- 6.31.1 -libtorch: -- '2.7' -llvm_openmp: -- '19' -macos_machine: -- x86_64-apple-darwin13.4.0 -megabuild: -- false -mkl: -- '2023' -mkl_devel: -- '2023' -numpy: -- '2' -orc: -- 2.2.1 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -pybind11_abi: -- '4' -python: -- 3.12.* *_cpython -pytorch: -- '2.7' -target_platform: -- osx-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version -- - channel_targets - - is_rc -zlib: -- '1' diff --git a/.ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313.yaml b/.ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313.yaml deleted file mode 100644 index edd33ec18..000000000 --- a/.ci_support/osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313.yaml +++ /dev/null @@ -1,75 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' -MACOSX_SDK_VERSION: -- '13.3' -blas_impl: -- mkl -c_compiler: -- clang -c_compiler_version: -- '19' -c_stdlib: -- macosx_deployment_target -c_stdlib_version: -- '11.0' -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- None -cxx_compiler: -- clangxx -cxx_compiler_version: -- '19' -is_rc: -- 'False' -libabseil: -- '20250512' -libblas: -- 3.9.* *netlib -libcblas: -- 3.9.* *netlib -liblapack: -- 3.9.* *netlib -libmagma_sparse: -- '2.9' -libprotobuf: -- 6.31.1 -libtorch: -- '2.7' -llvm_openmp: -- '19' -macos_machine: -- x86_64-apple-darwin13.4.0 -megabuild: -- false -mkl: -- '2023' -mkl_devel: -- '2023' -numpy: -- '2' -orc: -- 2.2.1 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -pybind11_abi: -- '4' -python: -- 3.13.* *_cp313 -pytorch: -- '2.7' -target_platform: -- osx-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version -- - channel_targets - - is_rc -zlib: -- '1' diff --git a/.ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython.yaml b/.ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalse.yaml similarity index 88% rename from .ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython.yaml rename to .ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalse.yaml index 95299b40f..9815c8bd2 100644 --- a/.ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython.yaml +++ b/.ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalse.yaml @@ -24,6 +24,10 @@ cxx_compiler: - clangxx cxx_compiler_version: - '19' +fmt: +- '12.0' +github_actions_labels: +- cirun-macos-m4-large is_rc: - 'False' libabseil: @@ -44,8 +48,6 @@ llvm_openmp: - '19' macos_machine: - arm64-apple-darwin20.0.0 -megabuild: -- false mkl: - '2023' numpy: @@ -57,9 +59,12 @@ pin_run_as_build: min_pin: x.x max_pin: x.x pybind11_abi: -- '4' +- '11' python: +- 3.10.* *_cpython - 3.11.* *_cpython +- 3.12.* *_cpython +- 3.13.* *_cp313 pytorch: - '2.7' target_platform: diff --git a/.ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython.yaml b/.ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython.yaml deleted file mode 100644 index 6dce277f9..000000000 --- a/.ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython.yaml +++ /dev/null @@ -1,73 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' -MACOSX_SDK_VERSION: -- '13.3' -blas_impl: -- generic -c_compiler: -- clang -c_compiler_version: -- '19' -c_stdlib: -- macosx_deployment_target -c_stdlib_version: -- '11.0' -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- None -cxx_compiler: -- clangxx -cxx_compiler_version: -- '19' -is_rc: -- 'False' -libabseil: -- '20250512' -libblas: -- 3.9.* *netlib -libcblas: -- 3.9.* *netlib -liblapack: -- 3.9.* *netlib -libmagma_sparse: -- '2.9' -libprotobuf: -- 6.31.1 -libtorch: -- '2.7' -llvm_openmp: -- '19' -macos_machine: -- arm64-apple-darwin20.0.0 -megabuild: -- false -mkl: -- '2023' -numpy: -- '2' -orc: -- 2.2.1 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -pybind11_abi: -- '4' -python: -- 3.10.* *_cpython -pytorch: -- '2.7' -target_platform: -- osx-arm64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version -- - channel_targets - - is_rc -zlib: -- '1' diff --git a/.ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython.yaml b/.ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython.yaml deleted file mode 100644 index c8f097ee7..000000000 --- a/.ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython.yaml +++ /dev/null @@ -1,73 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' -MACOSX_SDK_VERSION: -- '13.3' -blas_impl: -- generic -c_compiler: -- clang -c_compiler_version: -- '19' -c_stdlib: -- macosx_deployment_target -c_stdlib_version: -- '11.0' -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- None -cxx_compiler: -- clangxx -cxx_compiler_version: -- '19' -is_rc: -- 'False' -libabseil: -- '20250512' -libblas: -- 3.9.* *netlib -libcblas: -- 3.9.* *netlib -liblapack: -- 3.9.* *netlib -libmagma_sparse: -- '2.9' -libprotobuf: -- 6.31.1 -libtorch: -- '2.7' -llvm_openmp: -- '19' -macos_machine: -- arm64-apple-darwin20.0.0 -megabuild: -- false -mkl: -- '2023' -numpy: -- '2' -orc: -- 2.2.1 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -pybind11_abi: -- '4' -python: -- 3.12.* *_cpython -pytorch: -- '2.7' -target_platform: -- osx-arm64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version -- - channel_targets - - is_rc -zlib: -- '1' diff --git a/.ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313.yaml b/.ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313.yaml deleted file mode 100644 index 714684015..000000000 --- a/.ci_support/osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313.yaml +++ /dev/null @@ -1,73 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' -MACOSX_SDK_VERSION: -- '13.3' -blas_impl: -- generic -c_compiler: -- clang -c_compiler_version: -- '19' -c_stdlib: -- macosx_deployment_target -c_stdlib_version: -- '11.0' -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -cuda_compiler: -- cuda-nvcc -cuda_compiler_version: -- None -cxx_compiler: -- clangxx -cxx_compiler_version: -- '19' -is_rc: -- 'False' -libabseil: -- '20250512' -libblas: -- 3.9.* *netlib -libcblas: -- 3.9.* *netlib -liblapack: -- 3.9.* *netlib -libmagma_sparse: -- '2.9' -libprotobuf: -- 6.31.1 -libtorch: -- '2.7' -llvm_openmp: -- '19' -macos_machine: -- arm64-apple-darwin20.0.0 -megabuild: -- false -mkl: -- '2023' -numpy: -- '2' -orc: -- 2.2.1 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -pybind11_abi: -- '4' -python: -- 3.13.* *_cp313 -pytorch: -- '2.7' -target_platform: -- osx-arm64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version -- - channel_targets - - is_rc -zlib: -- '1' diff --git a/.ci_support/win_64_channel_targetsconda-forge_maincuda_compiler_version12.8is_rcFalse.yaml b/.ci_support/win_64_channel_targetsconda-forge_maincuda_compiler_version12.8is_rcFalse.yaml index 6742b21df..61349d925 100644 --- a/.ci_support/win_64_channel_targetsconda-forge_maincuda_compiler_version12.8is_rcFalse.yaml +++ b/.ci_support/win_64_channel_targetsconda-forge_maincuda_compiler_version12.8is_rcFalse.yaml @@ -13,9 +13,11 @@ cuda_compiler: cuda_compiler_version: - '12.8' cudnn: -- '9.10' +- '9' cxx_compiler: - vs2022 +fmt: +- '12.0' github_actions_labels: - cirun-azure-windows-4xlarge is_rc: @@ -30,8 +32,6 @@ libtorch: - '2.7' magma: - '2.9' -megabuild: -- true mkl: - '2025' mkl_devel: @@ -45,7 +45,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x pybind11_abi: -- '4' +- '11' python: - 3.10.* *_cpython - 3.11.* *_cpython @@ -58,7 +58,5 @@ target_platform: zip_keys: - - channel_targets - is_rc -- - cuda_compiler_version - - cudnn zlib: - '1' 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 5a4749d18..8f4871b4d 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 @@ -16,6 +16,8 @@ cudnn: - '9' cxx_compiler: - vs2022 +fmt: +- '12.0' github_actions_labels: - cirun-azure-windows-4xlarge is_rc: @@ -30,8 +32,6 @@ libtorch: - '2.7' magma: - '2.9' -megabuild: -- true mkl: - '2025' mkl_devel: @@ -45,7 +45,7 @@ pin_run_as_build: min_pin: x.x max_pin: x.x pybind11_abi: -- '4' +- '11' python: - 3.10.* *_cpython - 3.11.* *_cpython @@ -58,7 +58,5 @@ target_platform: zip_keys: - - channel_targets - is_rc -- - cuda_compiler_version - - cudnn zlib: - '1' diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 6e7bede8a..d89b5d080 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -63,6 +63,21 @@ jobs: runs_on: ['cirun-openstack-gpu-2xlarge--${{ github.run_id }}-linux_aarch64_channel_targetsconda-forge_h56c2c839', 'linux', 'x64', 'self-hosted'] DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 CONDA_FORGE_DOCKER_RUN_ARGS: "--gpus all" + - CONFIG: osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalse + SHORT_CONFIG: osx_64_blas_implgenericchannel_targetsco_h709642d7 + UPLOAD_PACKAGES: True + os: macos + runs_on: ['cirun-macos-m4-large--${{ github.run_id }}-osx_64_blas_implgenericchannel_targetsco_h709642d7', 'macOS', 'arm64', 'self-hosted'] + - CONFIG: osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalse + SHORT_CONFIG: osx_64_blas_implmklchannel_targetsconda-_h747b3c68 + UPLOAD_PACKAGES: True + os: macos + runs_on: ['cirun-macos-m4-large--${{ github.run_id }}-osx_64_blas_implmklchannel_targetsconda-_h747b3c68', 'macOS', 'arm64', 'self-hosted'] + - CONFIG: osx_arm64_channel_targetsconda-forge_mainis_rcFalse + SHORT_CONFIG: osx_arm64_channel_targetsconda-forge_mai_h5f57e26b + UPLOAD_PACKAGES: True + os: macos + runs_on: ['cirun-macos-m4-large--${{ github.run_id }}-osx_arm64_channel_targetsconda-forge_mai_h5f57e26b', 'macOS', 'arm64', 'self-hosted'] - CONFIG: win_64_channel_targetsconda-forge_maincuda_compiler_version12.8is_rcFalse SHORT_CONFIG: win_64_channel_targetsconda-forge_maincu_hca575dce UPLOAD_PACKAGES: True @@ -259,4 +274,4 @@ jobs: name: ${{ steps.prepare-artifacts.outputs.ENV_ARTIFACT_NAME }} path: ${{ steps.prepare-artifacts.outputs.ENV_ARTIFACT_PATH }} retention-days: 14 - continue-on-error: true + continue-on-error: true \ No newline at end of file diff --git a/.scripts/download_osx_sdk.sh b/.scripts/download_osx_sdk.sh new file mode 100644 index 000000000..de175122e --- /dev/null +++ b/.scripts/download_osx_sdk.sh @@ -0,0 +1,89 @@ +set -e + +# We don't change the default here to a newer SDK to ensure that old, non-rerendered feedstock keep working. +if [ -f ${CI_SUPPORT}/${CONFIG}.yaml ]; then + export MACOSX_DEPLOYMENT_TARGET=$(cat ${CI_SUPPORT}/${CONFIG}.yaml | shyaml get-value MACOSX_DEPLOYMENT_TARGET.0 10.9) +fi + +export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-10.9} + +# Some project require a new SDK version even though they can target older versions +if [ -f ${CI_SUPPORT}/${CONFIG}.yaml ]; then + export MACOSX_SDK_VERSION=$(cat ${CI_SUPPORT}/${CONFIG}.yaml | shyaml get-value MACOSX_SDK_VERSION.0 0) + export WITH_LATEST_OSX_SDK=$(cat ${CI_SUPPORT}/${CONFIG}.yaml | shyaml get-value WITH_LATEST_OSX_SDK.0 0) + if [[ "${WITH_LATEST_OSX_SDK}" != "0" ]]; then + echo "Setting WITH_LATEST_OSX_SDK is removed. Use MACOSX_SDK_VERSION to specify an explicit version for the SDK." + export MACOSX_SDK_VERSION=10.15 + fi +fi + +if [[ "${MACOSX_SDK_VERSION:-0}" == "0" ]]; then + export MACOSX_SDK_VERSION=$MACOSX_DEPLOYMENT_TARGET +fi + +export CONDA_BUILD_SYSROOT="${OSX_SDK_DIR}/MacOSX${MACOSX_SDK_VERSION}.sdk" + +if [[ ! -d ${CONDA_BUILD_SYSROOT} ]]; then + echo "Downloading ${MACOSX_SDK_VERSION} sdk" + + if [[ "${MACOSX_SDK_VERSION:-0}" == "currently_unused" ]]; then + # not all versions get tagged, see https://github.com/alexey-lysiuk/macos-sdk/issues/2 + url="https://github.com/alexey-lysiuk/macos-sdk/archive/e96f557d53a0282abc7c93a76a802605b20e4282.tar.gz" + elif [[ $(echo "${MACOSX_SDK_VERSION}" | cut -d "." -f 1) -gt 11 ]]; then + url="https://github.com/alexey-lysiuk/macos-sdk/releases/download/${MACOSX_SDK_VERSION}/MacOSX${MACOSX_SDK_VERSION}.tar.xz" + else + url="https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz" + fi + curl -L --output MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz "${url}" + # As of 2024-04-02, hashes are coming from: + # - SDKs 12+ list a hash in the descriptions on https://github.com/alexey-lysiuk/macos-sdk/releases + # - SDKs <12 were generated by running `openssl sha256` on artifacts at https://github.com/phracker/MacOSX-SDKs/releases/tag/11.3 + sdk_sha256=$( + case "${MACOSX_SDK_VERSION}" in + ("15.5") echo "5096f730e9935adbd99d4bb082c3c6c01c077d966405ee4ae45705521476332e" ;; + ("14.5") echo "f6acc6209db9d56b67fcaf91ec1defe48722e9eb13dc21fb91cfeceb1489e57e" ;; + ("13.3") echo "71ae3a78ab1be6c45cf52ce44cb29a3cc27ed312c9f7884ee88e303a862a1404" ;; + ("12.3") echo "91c03be5399be04d8f6b773da13045525e01298c1dfff273b4e1f1e904ee5484" ;; + ("11.3") echo "cd4f08a75577145b8f05245a2975f7c81401d75e9535dcffbb879ee1deefcbf4" ;; + ("11.1") echo "68797baaacb52f56f713400de306a58a7ca00b05c3dc6d58f0a8283bcac721f8" ;; + ("11.0") echo "d3feee3ef9c6016b526e1901013f264467bb927865a03422a9cb925991cc9783" ;; + ("10.15") echo "ac75d9e0eb619881f5aa6240689fce862dcb8e123f710032b7409ff5f4c3d18b" ;; + ("10.14") echo "123dcd2e02051bed8e189581f6eea1b04eddd55a80f98960214421404aa64b72" ;; + ("10.13") echo "1d2984acab2900c73d076fbd40750035359ee1abe1a6c61eafcd218f68923a5a" ;; + ("10.12") echo "b314704d85934481c9927a0450db1768baf9af9efe649562fcb1a503bb44512f" ;; + ("10.11") echo "d080fc672d94f95eb54651c37ede80f61761ce4c91f87061e11a20222c8d00c8" ;; + ("10.10") echo "3839b875df1f2bc98893b8502da456cc0b022c4666bc6b7eb5764a5f915a9b00" ;; + ("10.9") echo "fcf88ce8ff0dd3248b97f4eb81c7909f2cc786725de277f4d05a2b935cc49de0" ;; + (*) echo "Unknown version & hash, please update conda-forge-ci-setup's download_osx_sdk.sh" ;; + esac) + echo "${sdk_sha256} *MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz" | shasum -a 256 -c + sudo mkdir -p "$(dirname "$CONDA_BUILD_SYSROOT")" + # delete symlink that may exist already, e.g. MacOSX15.5.sdk -> MacOSX.sdk + sudo rm -rf $CONDA_BUILD_SYSROOT + if [[ "${MACOSX_SDK_VERSION:-0}" == "currently_unused" ]]; then + tar -xf MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz + # we've downloaded the whole https://github.com/alexey-lysiuk/macos-sdk repo, go into the right folder; + # github names the folder in the tarball based on the hash of the commit we're using; rename for ease of use + mv macos-sdk-* repo + sudo mv repo/MacOSX${MACOSX_SDK_VERSION}.sdk "$(dirname "$CONDA_BUILD_SYSROOT")/" + else + sudo tar -xf MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz -C "$(dirname "$CONDA_BUILD_SYSROOT")" + fi +fi + +if [ ! -z "$CONFIG" ]; then + echo "" >> ${CI_SUPPORT}/${CONFIG}.yaml + echo "CONDA_BUILD_SYSROOT:" >> ${CI_SUPPORT}/${CONFIG}.yaml + echo "- ${CONDA_BUILD_SYSROOT}" >> ${CI_SUPPORT}/${CONFIG}.yaml + echo "" >> ${CI_SUPPORT}/${CONFIG}.yaml +fi + +echo "export CONDA_BUILD_SYSROOT='${CONDA_BUILD_SYSROOT}'" >> "${CONDA_PREFIX}/etc/conda/activate.d/conda-forge-ci-setup-activate.sh" +echo "export MACOSX_DEPLOYMENT_TARGET='${MACOSX_DEPLOYMENT_TARGET}'" >> "${CONDA_PREFIX}/etc/conda/activate.d/conda-forge-ci-setup-activate.sh" + +if [[ -d "${CONDA_BUILD_SYSROOT}" ]]; then + echo "Found CONDA_BUILD_SYSROOT: ${CONDA_BUILD_SYSROOT}" +else + echo "Missing CONDA_BUILD_SYSROOT: ${CONDA_BUILD_SYSROOT}" + exit 1 +fi diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 361edeb2c..4bba44792 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -63,6 +63,9 @@ if [[ "${sha:-}" == "" ]]; then sha=$(git rev-parse HEAD) fi +# HACK +cp .scripts/download_osx_sdk.sh $CONDA_PREFIX/bin/ + echo -e "\n\nRunning the build setup script." source run_conda_forge_build_setup diff --git a/README.md b/README.md index 0bde8a067..84e94ab74 100644 --- a/README.md +++ b/README.md @@ -24,164 +24,6 @@ Current build status - - - - -
Azure -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
VariantStatus
linux_64_blas_implgenericchannel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse - - variant - -
linux_64_blas_implgenericchannel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse - - variant - -
linux_64_blas_implmklchannel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse - - variant - -
linux_64_blas_implmklchannel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse - - variant - -
linux_aarch64_channel_targetsconda-forge_maincuda_compiler_version12.9is_rcFalse - - variant - -
linux_aarch64_channel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse - - variant - -
osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython - - variant - -
osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython - - variant - -
osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython - - variant - -
osx_64_blas_implgenericchannel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313 - - variant - -
osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython - - variant - -
osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython - - variant - -
osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython - - variant - -
osx_64_blas_implmklchannel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313 - - variant - -
osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.10.____cpython - - variant - -
osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.11.____cpython - - variant - -
osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.12.____cpython - - variant - -
osx_arm64_channel_targetsconda-forge_mainis_rcFalsepython3.13.____cp313 - - variant - -
win_64_channel_targetsconda-forge_maincuda_compiler_version12.8is_rcFalse - - variant - -
win_64_channel_targetsconda-forge_maincuda_compiler_versionNoneis_rcFalse - - variant - -
-
-
Current release info diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index a13f0ae28..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- - -stages: -- stage: Check - jobs: - - job: Skip - pool: - vmImage: 'ubuntu-22.04' - variables: - DECODE_PERCENTS: 'false' - RET: 'true' - steps: - - checkout: self - fetchDepth: '2' - - bash: | - git_log=`git log --max-count=1 --skip=1 --pretty=format:"%B" | tr "\n" " "` - echo "##vso[task.setvariable variable=log]$git_log" - displayName: Obtain commit message - - bash: echo "##vso[task.setvariable variable=RET]false" - condition: and(eq(variables['Build.Reason'], 'PullRequest'), or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]'))) - displayName: Skip build? - - bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET" - name: result - displayName: Export result -- stage: Build - condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) - dependsOn: Check - jobs: - - template: ./.azure-pipelines/azure-pipelines-osx.yml \ No newline at end of file diff --git a/conda-forge.yml b/conda-forge.yml index 75cf66954..a5fd47bdf 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -7,7 +7,7 @@ bot: - v2.7.x build_platform: linux_aarch64: linux_64 - osx_arm64: osx_64 + osx_64: osx_arm64 conda_build: pkg_format: '2' conda_forge_output_validation: true @@ -25,5 +25,6 @@ github_actions: provider: linux_64: github_actions linux_aarch64: azure + osx_arm64: github_actions win_64: github_actions test: native_and_emulated diff --git a/recipe/bld.bat b/recipe/bld.bat index e5e215ede..06e6fcb3f 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -80,6 +80,7 @@ set "USE_OPENMP=ON" set USE_SYSTEM_EIGEN_INSTALL=1 set USE_SYSTEM_PYBIND11=1 set USE_SYSTEM_SLEEF=1 +set USE_SYSTEM_FMT=1 @REM workaround to stop setup.py from trying to check whether we checked out @REM all submodules (we don't use all of them) @@ -95,7 +96,7 @@ if not "%cuda_compiler_version%" == "None" ( @REM set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%desired_cuda% @REM set CUDA_BIN_PATH=%CUDA_PATH%\bin - set "TORCH_CUDA_ARCH_LIST=5.0;6.0;7.0;7.5;8.0;8.6;9.0;10.0;12.0+PTX" + set "TORCH_CUDA_ARCH_LIST=7.0+PTX" set "TORCH_NVCC_FLAGS=-Xfatbin -compress-all" set MAGMA_HOME=%LIBRARY_PREFIX% @@ -198,9 +199,8 @@ if "%PKG_NAME%" == "libtorch" ( if %ERRORLEVEL% neq 0 exit 1 @REM Move the binaries into the packages site-package directory - @REM the only content of torch\bin, {asmjit,fbgemm}.dll, also exists in torch\lib - robocopy /NP /NFL /NDL /NJH /E torch\bin\ %LIBRARY_BIN%\ torch*.dll c10.dll shm.dll asmjit.dll fbgemm.dll - robocopy /NP /NFL /NDL /NJH /E torch\lib\ %LIBRARY_LIB%\ torch*.lib c10.lib shm.lib asmjit.lib fbgemm.lib + robocopy /NP /NFL /NDL /NJH /E torch\bin\ %LIBRARY_BIN%\ torch*.dll c10.dll shm.dll + robocopy /NP /NFL /NDL /NJH /E torch\lib\ %LIBRARY_LIB%\ torch*.lib c10.lib shm.lib if not "%cuda_compiler_version%" == "None" ( robocopy /NP /NFL /NDL /NJH /E torch\bin\ %LIBRARY_BIN%\ c10_cuda.dll caffe2_nvrtc.dll robocopy /NP /NFL /NDL /NJH /E torch\lib\ %LIBRARY_LIB%\ c10_cuda.lib caffe2_nvrtc.lib diff --git a/recipe/build.sh b/recipe/build.sh index ab9444680..52a508ebb 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -98,8 +98,13 @@ export BUILD_CUSTOM_PROTOBUF=OFF rm -rf $PREFIX/bin/protoc export USE_SYSTEM_PYBIND11=1 export USE_SYSTEM_EIGEN_INSTALL=1 +export USE_SYSTEM_FMT=1 export Python_ROOT_DIR=$PREFIX +# force using cblas_dot when cross-compiling +# (this matches the behavior to our patches) +export PYTORCH_BLAS_USE_CBLAS_DOT=ON + # workaround to stop setup.py from trying to check whether we checked out # all submodules (we don't use all of them) rm -f .gitmodules @@ -195,15 +200,17 @@ elif [[ ${cuda_compiler_version} != "None" ]]; then export CUDAToolkit_ROOT=${PREFIX} case ${target_platform} in linux-64) - export CUDAToolkit_TARGET_DIR=${PREFIX}/targets/x86_64-linux + CUDA_TARGET=x86_64-linux ;; linux-aarch64) - export CUDAToolkit_TARGET_DIR=${PREFIX}/targets/sbsa-linux + CUDA_TARGET=sbsa-linux ;; *) echo "unknown CUDA arch, edit build.sh" exit 1 esac + export CUDAToolkit_TARGET_DIR=${PREFIX}/targets/${CUDA_TARGET} + sed -i -e "s,@CUDA_TARGET@,${CUDA_TARGET}," torch/_inductor/cpp_builder.py # Compatibility matrix for update: https://en.wikipedia.org/wiki/CUDA#GPUs_supported # Warning from pytorch v1.12.1: In the future we will require one to @@ -218,7 +225,7 @@ elif [[ ${cuda_compiler_version} != "None" ]]; then # https://github.com/pytorch/pytorch/blob/main/.ci/manywheel/build_cuda.sh case ${cuda_compiler_version} in 12.[89]) - export TORCH_CUDA_ARCH_LIST="5.0;6.0;7.0;7.5;8.0;8.6;9.0;10.0;12.0+PTX" + export TORCH_CUDA_ARCH_LIST="7.0+PTX" ;; *) echo "No CUDA architecture list exists for CUDA v${cuda_compiler_version}. See build.sh for information on adding one." diff --git a/recipe/cmake_test/CMakeLists.txt b/recipe/cmake_test/CMakeLists.txt index 4632bbb62..36f65c660 100644 --- a/recipe/cmake_test/CMakeLists.txt +++ b/recipe/cmake_test/CMakeLists.txt @@ -36,7 +36,14 @@ if(WITH_TORCH_PYTHON) ${torch_python} ) + set(MSVC_UTF8_FLAG) + if(MSVC) + # The source code is in utf-8 encoding + set(MSVC_UTF8_FLAG "/utf-8") + endif() + target_compile_options(cmake_test PRIVATE ${TORCH_CXX_FLAGS} + ${MSVC_UTF8_FLAG} ) endif() diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index d1b0da63f..75d8bfde4 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -26,11 +26,7 @@ blas_impl: - generic # [unix] # https://github.com/conda-forge/.cirun -github_actions_labels: # [linux or win] +github_actions_labels: - cirun-openstack-gpu-2xlarge # [linux] +- cirun-macos-m4-large # [osx] - cirun-azure-windows-4xlarge # [win] - -megabuild: -- true # [linux] -- false # [osx] -- true # [win] diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 17d5903b2..ca9125e4f 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.8.0" %} -{% set build = 2 %} +{% set version = "2.9.1" %} +{% set build = 0 %} # Use a higher build number for the CUDA variant, to ensure that it's # preferred by conda's solver, and it's preferentially @@ -16,7 +16,7 @@ # see https://github.com/pytorch/pytorch/blame/v{{ version }}/.ci/docker/ci_commit_pins/triton.txt # pytorch and triton are released in tandem, see notes in their release process # https://github.com/pytorch/pytorch/blob/main/RELEASE.md#triton-dependency-for-the-release -{% set triton = "3.4.0" %} +{% set triton = "3.5.1" %} package: name: libtorch @@ -35,35 +35,34 @@ source: {% else %} # The "pytorch-v" tarballs contain submodules; the "pytorch-" ones don't. - url: https://github.com/pytorch/pytorch/releases/download/v{{ version }}/pytorch-v{{ version }}.tar.gz - sha256: c70a2c9488f6f6e8af5982a10d1cc2c37b7df5e6506d839daa5d5e250953d7b5 + sha256: e17504700ebc4c87f9b57059df1c4d790b769458c04db144c7a92aea90f2c92b {% endif %} patches: - patches/0001-Force-usage-of-python-3-and-error-without-numpy.patch - # backport https://github.com/pytorch/pytorch/pull/137084 - - patches/0002-Help-find-numpy.patch - - patches/0003-Fix-duplicate-linker-script.patch # [cuda_compiler_version != "None" and aarch64] + - patches/0002-Fix-duplicate-linker-script.patch # [cuda_compiler_version != "None" and aarch64] # conda-specific patch, lets us override CUDA paths - - patches/0004-Allow-overriding-CUDA-related-paths.patch + - patches/0003-Allow-overriding-CUDA-related-paths.patch # fix BLAS calling convention for openblas - - patches/0005-Use-BLAS_USE_CBLAS_DOT-for-OpenBLAS-builds.patch - # fix mkl-2024 issue - # https://github.com/pytorch/pytorch/pull/143894 - - patches/0006-fix-issue-142484.patch - - patches/0007-Fix-FindOpenBLAS.patch + - patches/0004-Use-BLAS_USE_CBLAS_DOT-for-OpenBLAS-builds.patch + - patches/0005-Fix-FindOpenBLAS.patch # point to headers that are now living in $PREFIX/include instead of $SP_DIR/torch/include - - patches/0008-point-include-paths-to-Conda-prefix-include-dir.patch - - patches/0009-Add-conda-prefix-to-inductor-include-paths.patch - - patches/0010-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch - - patches/0011-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch # [win] - - patches/0012-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch + - patches/0006-point-include-paths-to-Conda-prefix-include-dir.patch + - patches/0007-Add-conda-prefix-to-inductor-include-lib-paths.patch + - patches/0008-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch + - patches/0009-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch # [win] + - patches/0010-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch # backport https://github.com/pytorch/pytorch/pull/148668 - - patches/0013-Fix-CUPTI-lookup-to-include-target-directory.patch + - patches/0011-Fix-CUPTI-lookup-to-include-target-directory.patch # skip a test that fails with numpy 2.3; can be dropped for pytorch>2.7 - - patches/0014-skip-test_norm_matrix_degenerate_shapes-on-numpy-2.3.patch + - patches/0012-skip-test_norm_matrix_degenerate_shapes-on-numpy-2.3.patch # backport https://github.com/pytorch/pytorch/pull/127702 - - patches/0015-Define-PY_SSIZE_T_CLEAN-before-include-Python.h.patch + - patches/0013-Define-PY_SSIZE_T_CLEAN-before-include-Python.h.patch + # backport https://github.com/pytorch/pytorch/pull/166824 + - patches/0014-Add-USE_SYSTEM-options-for-KLEIDI-CUDNN_FRONTEND-CUT.patch + - patches/0015-Fix-building-kineto-against-system-fmt.patch + # backport https://github.com/pytorch/pytorch/pull/159828 + - patches/0016-Attempt-to-fix-torch.backends.cudnn.rnn-import.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 build: @@ -76,18 +75,19 @@ build: {% else %} skip: true # [is_rc] {% endif %} + skip: true # [not (osx and arm64)] 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 run_exports: - {{ pin_subpackage('libtorch', max_pin='x.x') }} ignore_run_exports_from: - - python * # [megabuild] - - numpy * # [megabuild] - - cross-python_{{ target_platform }} # [megabuild and build_platform != target_platform] + - python * + - numpy * + - cross-python_{{ target_platform }} # [build_platform != target_platform] ignore_run_exports: - - python * # [megabuild] - - numpy * # [megabuild] + - python * + - numpy * - libmagma_sparse requirements: @@ -95,11 +95,9 @@ requirements: # We use python to build libtorch as well because it is easier build: # When you change 3.12 here, change it in build.sh/bld.bat as well - - python 3.12 # [megabuild and build_platform != target_platform] - - python # [not megabuild and build_platform != target_platform] + - python 3.12 # [build_platform != target_platform] - cross-python_{{ target_platform }} # [build_platform != target_platform] - - numpy * # [megabuild and build_platform != target_platform] - - numpy # [not megabuild and build_platform != target_platform] + - numpy * # [build_platform != target_platform] - {{ stdlib('c') }} - {{ compiler('c') }} - {{ compiler('cxx') }} @@ -141,10 +139,8 @@ requirements: - libcusparse-dev {% endif %} # other requirements - - python 3.12 # [megabuild] - - python # [not megabuild] - - numpy * # [megabuild] - - numpy # [not megabuild] + - python 3.12 + - numpy * - pip - setuptools - pyyaml @@ -166,6 +162,7 @@ requirements: - pybind11-abi - eigen - zlib + - fmt run: - libblas * *{{ blas_impl }} # [blas_impl == "mkl"] run_constrained: @@ -210,8 +207,6 @@ test: "torch_cuda_linalg" ] + (cuda_compiler_version != "None") * [ "c10_cuda", "caffe2_nvrtc", "torch_cuda" - ] + target_platform.startswith("win") * [ - "asmjit", "fbgemm" ] %} {% for each_lib in torch_libs %} @@ -312,10 +307,9 @@ outputs: - pkg-config # [unix] - typing_extensions - zlib + - fmt run: - - {{ pin_subpackage('libtorch', exact=True) }} # [megabuild] - # for non-megabuild, allow libtorch from any python version - - libtorch {{ version }}.* *_{{ build }} # [not megabuild] + - {{ pin_subpackage('libtorch', exact=True) }} - llvm-openmp - libblas * *{{ blas_impl }} # [blas_impl == "mkl"] - nomkl # [blas_impl != "mkl"] @@ -363,7 +357,9 @@ outputs: - ninja - boto3 - hypothesis - - pytest + # pytest-9 causes failure due to PytestRemovedIn9Warning + # https://github.com/conda-forge/pytorch-cpu-feedstock/pull/448#issuecomment-3529016115 + - pytest <9 - tabulate - pydot - pip @@ -409,7 +405,7 @@ outputs: # We have had issues with openmp .dylibs being doubly loaded in certain cases. These two tests catch the (observed) issue - python -c "import torch; import numpy" - python -c "import numpy; import torch" - - python -c "import numpy as np;import torch;x = torch.tensor([2], dtype=torch.complex128);assert torch.dot(x, x).real == 4.0" + - python -c "import numpy as np;import torch;x = torch.tensor([2], dtype=torch.complex128);res = torch.dot(x, x); assert res.real == 4.0, res" # 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()" # [cuda_compiler_version != "None"] @@ -519,6 +515,10 @@ outputs: {% set skips = skips ~ " or (TestNN and test_Conv3d_stride_padding)" %} # [win] # flaky test, fragile to GC behavior {% set skips = skips ~ " or (TestTorch and test_tensor_cycle_via_slots)" %} + # unexpected success + {% set skips = skips ~ " or test_forward_nn_Bilinear_mps_float16" %} # [osx and arm64] + # "quantized engine NoQEngine is not supported" + {% set skips = skips ~ " or test_qengine " %} # [osx and arm64] # the whole test suite takes forever, but we should get a good enough coverage # for potential packaging problems by running a fixed subset @@ -550,15 +550,13 @@ outputs: {% set pytorch_cpu_gpu = "pytorch-gpu" %} # [cuda_compiler_version != "None"] - name: {{ pytorch_cpu_gpu }} build: - string: cuda{{ cuda_compiler_version | replace('.', '') }}_{{ blas_impl }}_h{{ PKG_HASH }}_{{ build }} # [megabuild and cuda_compiler_version != "None"] - string: cpu_{{ blas_impl }}_h{{ PKG_HASH }}_{{ build }} # [megabuild and cuda_compiler_version == "None"] - string: cpu_{{ blas_impl }}_py{{ CONDA_PY }}_h{{ PKG_HASH }}_{{ build }} # [not megabuild] + 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 requirements: run: - - pytorch {{ version }} cuda*_{{ blas_impl }}*{{ build }} # [megabuild and cuda_compiler_version != "None"] - - pytorch {{ version }} cpu_{{ blas_impl }}*{{ build }} # [megabuild and cuda_compiler_version == "None"] - - {{ pin_subpackage("pytorch", exact=True) }} # [not megabuild] + - pytorch {{ version }} cuda*_{{ blas_impl }}*{{ build }} # [cuda_compiler_version != "None"] + - pytorch {{ version }} cpu_{{ blas_impl }}*{{ build }} # [cuda_compiler_version == "None"] test: imports: - torch 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 ee2975f67..0b209063f 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,17 +1,17 @@ -From 8afc8dc7eaf960071d95cb62a5c5138b17af20b4 Mon Sep 17 00:00:00 2001 +From 7eeddc8b77fbcb44ce4c5d97c4962efc242a3f75 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Sun, 1 Sep 2024 17:35:40 -0400 -Subject: [PATCH 01/15] Force usage of python 3 and error without numpy +Subject: [PATCH 01/13] Force usage of python 3 and error without numpy --- cmake/Dependencies.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake -index a93386c27f8..96988e89d09 100644 +index ef5c2fd4e97..72d9e298dcc 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake -@@ -819,9 +819,9 @@ if(BUILD_PYTHON) +@@ -804,9 +804,9 @@ if(BUILD_PYTHON) if(USE_NUMPY) list(APPEND PYTHON_COMPONENTS NumPy) endif() @@ -23,7 +23,7 @@ index a93386c27f8..96988e89d09 100644 endif() if(NOT Python_Interpreter_FOUND) -@@ -838,7 +838,7 @@ if(BUILD_PYTHON) +@@ -823,7 +823,7 @@ if(BUILD_PYTHON) if(Python_Development.Module_FOUND) if(USE_NUMPY) if(NOT Python_NumPy_FOUND) diff --git a/recipe/patches/0003-Fix-duplicate-linker-script.patch b/recipe/patches/0002-Fix-duplicate-linker-script.patch similarity index 79% rename from recipe/patches/0003-Fix-duplicate-linker-script.patch rename to recipe/patches/0002-Fix-duplicate-linker-script.patch index 6af3ac580..d4adbe562 100644 --- a/recipe/patches/0003-Fix-duplicate-linker-script.patch +++ b/recipe/patches/0002-Fix-duplicate-linker-script.patch @@ -1,17 +1,17 @@ -From 2e913176f2b8ff4a5fd0cb8e8f24ed4850ac9474 Mon Sep 17 00:00:00 2001 +From 532682e899bed8cb97b922e0d1ff92664100e521 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Sun, 3 Nov 2024 01:12:36 -0700 -Subject: [PATCH 03/15] Fix duplicate linker script +Subject: [PATCH 02/13] Fix duplicate linker script --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py -index b4ebc92f592..7f88ade34bf 100644 +index 11ca48482a7..1c5b75897df 100644 --- a/setup.py +++ b/setup.py -@@ -1198,7 +1198,9 @@ def main(): +@@ -1632,7 +1632,9 @@ def main() -> None: filein="cmake/prioritized_text.txt", fout="cmake/linker_script.ld" ) linker_script_path = os.path.abspath("cmake/linker_script.ld") diff --git a/recipe/patches/0002-Help-find-numpy.patch b/recipe/patches/0002-Help-find-numpy.patch deleted file mode 100644 index 15ed3b51f..000000000 --- a/recipe/patches/0002-Help-find-numpy.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 078d8b4be2adbf8a8d20ec1ab69922d534afe6e7 Mon Sep 17 00:00:00 2001 -From: Mark Harfouche -Date: Tue, 1 Oct 2024 00:28:40 -0400 -Subject: [PATCH 02/15] Help find numpy - ---- - tools/setup_helpers/cmake.py | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/tools/setup_helpers/cmake.py b/tools/setup_helpers/cmake.py -index 678ba7ab207..92052f9bc5c 100644 ---- a/tools/setup_helpers/cmake.py -+++ b/tools/setup_helpers/cmake.py -@@ -313,9 +313,15 @@ class CMake: - sys.exit(1) - build_options.update(cmake__options) - -+ Python_NumPy_INCLUDE_DIR = os.environ.get("Python_NumPy_INCLUDE_DIR") -+ if Python_NumPy_INCLUDE_DIR is None: -+ import numpy as np -+ Python_NumPy_INCLUDE_DIR = np.get_include() -+ - CMake.defines( - args, - Python_EXECUTABLE=sys.executable, -+ Python_NumPy_INCLUDE_DIR=Python_NumPy_INCLUDE_DIR, - TORCH_BUILD_VERSION=version, - **build_options, - ) diff --git a/recipe/patches/0004-Allow-overriding-CUDA-related-paths.patch b/recipe/patches/0003-Allow-overriding-CUDA-related-paths.patch similarity index 89% rename from recipe/patches/0004-Allow-overriding-CUDA-related-paths.patch rename to recipe/patches/0003-Allow-overriding-CUDA-related-paths.patch index c010d8f69..2fbe631ff 100644 --- a/recipe/patches/0004-Allow-overriding-CUDA-related-paths.patch +++ b/recipe/patches/0003-Allow-overriding-CUDA-related-paths.patch @@ -1,7 +1,7 @@ -From 69647852ad6bfa0f0d9f22f88a981496a71225df Mon Sep 17 00:00:00 2001 +From afa9e9bc6e2f6db7af3b3a46e608bc8d2833f18d 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 04/15] Allow overriding CUDA-related paths +Subject: [PATCH 03/13] Allow overriding CUDA-related paths --- cmake/Modules/FindCUDAToolkit.cmake | 2 +- @@ -22,10 +22,10 @@ index ec9ae530aa6..b7c0bd9fc51 100644 set(CUDAToolkit_LIBRARY_ROOT "${CMAKE_CUDA_COMPILER_LIBRARY_ROOT}") set(CUDAToolkit_VERSION "${CMAKE_CUDA_COMPILER_TOOLKIT_VERSION}") diff --git a/tools/setup_helpers/cmake.py b/tools/setup_helpers/cmake.py -index 92052f9bc5c..bd2a8db5b3b 100644 +index 02ab011dd48..447628cc4c1 100644 --- a/tools/setup_helpers/cmake.py +++ b/tools/setup_helpers/cmake.py -@@ -254,7 +254,7 @@ class CMake: +@@ -314,7 +314,7 @@ class CMake: true_var = additional_options.get(var) if true_var is not None: build_options[true_var] = val diff --git a/recipe/patches/0005-Use-BLAS_USE_CBLAS_DOT-for-OpenBLAS-builds.patch b/recipe/patches/0004-Use-BLAS_USE_CBLAS_DOT-for-OpenBLAS-builds.patch similarity index 84% rename from recipe/patches/0005-Use-BLAS_USE_CBLAS_DOT-for-OpenBLAS-builds.patch rename to recipe/patches/0004-Use-BLAS_USE_CBLAS_DOT-for-OpenBLAS-builds.patch index 1e88de702..c3a933b6f 100644 --- a/recipe/patches/0005-Use-BLAS_USE_CBLAS_DOT-for-OpenBLAS-builds.patch +++ b/recipe/patches/0004-Use-BLAS_USE_CBLAS_DOT-for-OpenBLAS-builds.patch @@ -1,7 +1,7 @@ -From e1355fa88c355aa90c7179b4708a9de52cb7d5a2 Mon Sep 17 00:00:00 2001 +From 6af9801059f087440b2a756884d6f1fe3d91d865 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 18 Dec 2024 03:59:00 +0000 -Subject: [PATCH 05/15] Use BLAS_USE_CBLAS_DOT for OpenBLAS builds +Subject: [PATCH 04/13] Use BLAS_USE_CBLAS_DOT for OpenBLAS builds There are two calling conventions for *dotu functions @@ -31,18 +31,18 @@ functional calls. 1 file changed, 2 insertions(+) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake -index 96988e89d09..1dee5889d34 100644 +index 72d9e298dcc..f7e56828bdf 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake -@@ -182,6 +182,7 @@ elseif(BLAS STREQUAL "OpenBLAS") - set(BLAS_INFO "open") +@@ -186,6 +186,7 @@ elseif(BLAS STREQUAL "OpenBLAS") set(BLAS_FOUND 1) set(BLAS_LIBRARIES ${OpenBLAS_LIB}) + set(BLAS_CHECK_F2C 1) + set(BLAS_USE_CBLAS_DOT TRUE) elseif(BLAS STREQUAL "BLIS") find_package(BLIS REQUIRED) include_directories(SYSTEM ${BLIS_INCLUDE_DIR}) -@@ -204,6 +205,7 @@ elseif(BLAS STREQUAL "MKL") +@@ -209,6 +210,7 @@ elseif(BLAS STREQUAL "MKL") set(BLAS_INFO "mkl") set(BLAS_FOUND 1) set(BLAS_LIBRARIES ${MKL_LIBRARIES}) diff --git a/recipe/patches/0007-Fix-FindOpenBLAS.patch b/recipe/patches/0005-Fix-FindOpenBLAS.patch similarity index 93% rename from recipe/patches/0007-Fix-FindOpenBLAS.patch rename to recipe/patches/0005-Fix-FindOpenBLAS.patch index 724d41f04..b8e4c8ae8 100644 --- a/recipe/patches/0007-Fix-FindOpenBLAS.patch +++ b/recipe/patches/0005-Fix-FindOpenBLAS.patch @@ -1,7 +1,7 @@ -From 08f3ff64bbec8420fd779a609e03a52a567a7ee6 Mon Sep 17 00:00:00 2001 +From 4487751a213664c3d62023da331007c712c60f79 Mon Sep 17 00:00:00 2001 From: Bas Zalmstra Date: Thu, 16 May 2024 10:46:49 +0200 -Subject: [PATCH 07/15] Fix FindOpenBLAS +Subject: [PATCH 05/13] Fix FindOpenBLAS --- cmake/Modules/FindOpenBLAS.cmake | 15 +++++++++------ diff --git a/recipe/patches/0006-fix-issue-142484.patch b/recipe/patches/0006-fix-issue-142484.patch deleted file mode 100644 index 666cc1e1d..000000000 --- a/recipe/patches/0006-fix-issue-142484.patch +++ /dev/null @@ -1,33 +0,0 @@ -From e0d77da902d7e861ba3f37c7fcff2d1d66c489c2 Mon Sep 17 00:00:00 2001 -From: "Zheng, Zhaoqiong" -Date: Fri, 27 Dec 2024 13:49:36 +0800 -Subject: [PATCH 06/15] fix issue 142484 - -From https://github.com/pytorch/pytorch/pull/143894 ---- - aten/src/ATen/native/mkl/SpectralOps.cpp | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/aten/src/ATen/native/mkl/SpectralOps.cpp b/aten/src/ATen/native/mkl/SpectralOps.cpp -index 636e94e20f6..6e52871e8e0 100644 ---- a/aten/src/ATen/native/mkl/SpectralOps.cpp -+++ b/aten/src/ATen/native/mkl/SpectralOps.cpp -@@ -478,7 +478,17 @@ static Tensor& _exec_fft(Tensor& out, const Tensor& self, IntArrayRef out_sizes, - - const auto value_type = c10::toRealValueType(input.scalar_type()); - out.resize_(batched_out_sizes, MemoryFormat::Contiguous); -- -+ auto astrides = input.strides(); -+ bool all_zero = true; -+ for (const auto& stride : astrides) { -+ if (stride != 0) { -+ all_zero = false; -+ break; -+ } -+ } -+ if (all_zero) { -+ input = input.clone(MemoryFormat::Contiguous); -+ } - auto descriptor = _plan_mkl_fft( - input.strides(), out.strides(), signal_size, input.is_complex(), - out.is_complex(), normalization, forward, value_type); diff --git a/recipe/patches/0008-point-include-paths-to-Conda-prefix-include-dir.patch b/recipe/patches/0006-point-include-paths-to-Conda-prefix-include-dir.patch similarity index 82% rename from recipe/patches/0008-point-include-paths-to-Conda-prefix-include-dir.patch rename to recipe/patches/0006-point-include-paths-to-Conda-prefix-include-dir.patch index 401e2df31..95e2d48cb 100644 --- a/recipe/patches/0008-point-include-paths-to-Conda-prefix-include-dir.patch +++ b/recipe/patches/0006-point-include-paths-to-Conda-prefix-include-dir.patch @@ -1,7 +1,7 @@ -From 89eedf14f72f2baa2fa8b1766a3b3682f454538d Mon Sep 17 00:00:00 2001 +From b1d699a5efd5659ab7e1d0dd3a203d432e63ffb7 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 23 Jan 2025 22:58:14 +1100 -Subject: [PATCH 08/15] point include paths to Conda prefix include dir +Subject: [PATCH 06/13] point include paths to Conda prefix include dir Updated to use `sys.prefix` per https://github.com/conda-forge/pytorch-cpu-feedstock/issues/424. @@ -10,10 +10,10 @@ https://github.com/conda-forge/pytorch-cpu-feedstock/issues/424. 1 file changed, 5 insertions(+) diff --git a/torch/utils/cpp_extension.py b/torch/utils/cpp_extension.py -index 7fa5237994e..99fbd38e81a 100644 +index 902d2fe6ce0..3701edf1ce4 100644 --- a/torch/utils/cpp_extension.py +++ b/torch/utils/cpp_extension.py -@@ -1495,9 +1495,14 @@ def include_paths(device_type: str = "cpu") -> list[str]: +@@ -1506,9 +1506,14 @@ def include_paths(device_type: str = "cpu") -> list[str]: A list of include path strings. """ lib_include = os.path.join(_TORCH_PATH, 'include') diff --git a/recipe/patches/0009-Add-conda-prefix-to-inductor-include-paths.patch b/recipe/patches/0007-Add-conda-prefix-to-inductor-include-lib-paths.patch similarity index 53% rename from recipe/patches/0009-Add-conda-prefix-to-inductor-include-paths.patch rename to recipe/patches/0007-Add-conda-prefix-to-inductor-include-lib-paths.patch index d7d846d9b..f094aa8bf 100644 --- a/recipe/patches/0009-Add-conda-prefix-to-inductor-include-paths.patch +++ b/recipe/patches/0007-Add-conda-prefix-to-inductor-include-lib-paths.patch @@ -1,7 +1,7 @@ -From 31542c7ab379cb4bed47a021f013e018aa9603c9 Mon Sep 17 00:00:00 2001 +From 6c71d8d16faf7c13b786f3f35fef6ab533bad2c1 Mon Sep 17 00:00:00 2001 From: Daniel Petry Date: Tue, 21 Jan 2025 17:45:23 -0600 -Subject: [PATCH 09/15] Add conda prefix to inductor include paths +Subject: [PATCH 07/14] Add conda prefix to inductor include & lib 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 @@ -13,18 +13,24 @@ end user provides a _compile_flags.json file. Updated to use `sys.prefix` per https://github.com/conda-forge/pytorch-cpu-feedstock/issues/424. --- - torch/_inductor/cpp_builder.py | 1 + - 1 file changed, 1 insertion(+) + torch/_inductor/cpp_builder.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/torch/_inductor/cpp_builder.py b/torch/_inductor/cpp_builder.py -index d0a646c1de8..99c22d0ae40 100644 +index e2cb445ed10..89905bec464 100644 --- a/torch/_inductor/cpp_builder.py +++ b/torch/_inductor/cpp_builder.py -@@ -1136,6 +1136,7 @@ def get_cpp_torch_options( +@@ -1410,10 +1410,12 @@ def get_cpp_torch_options( + python_include_dirs + torch_include_dirs + omp_include_dir_paths + + [sys.prefix + '/include'] ++ + [sys.prefix + '/targets/@CUDA_TARGET@/include'] ) cflags = sys_libs_cflags + omp_cflags ldflags = omp_ldflags +- libraries_dirs = python_libraries_dirs + torch_libraries_dirs + omp_lib_dir_paths ++ libraries_dirs = python_libraries_dirs + torch_libraries_dirs + omp_lib_dir_paths + [sys.prefix + '/targets/@CUDA_TARGET@/lib/stubs'] + libraries = torch_libraries + omp_lib + passthrough_args = ( + sys_libs_passthrough_args + isa_ps_args_build_flags + omp_passthrough_args diff --git a/recipe/patches/0010-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch b/recipe/patches/0008-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch similarity index 83% rename from recipe/patches/0010-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch rename to recipe/patches/0008-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch index b3362ba95..a2db4fc88 100644 --- a/recipe/patches/0010-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch +++ b/recipe/patches/0008-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch @@ -1,7 +1,7 @@ -From fa7cbe57e21e30cd605cf78ac1cec8c3c243df89 Mon Sep 17 00:00:00 2001 +From 7520f1737851d8a812dacfb150399e701fc27769 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 28 Jan 2025 14:15:34 +1100 -Subject: [PATCH 10/15] make ATEN_INCLUDE_DIR relative to TORCH_INSTALL_PREFIX +Subject: [PATCH 08/13] 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: @@ -11,10 +11,10 @@ https://github.com/pytorch/pytorch/blob/v2.5.1/cmake/TorchConfig.cmake.in#L47 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aten/src/ATen/CMakeLists.txt b/aten/src/ATen/CMakeLists.txt -index c9cfd74b501..0ccb7b1d2e5 100644 +index 6c095680733..d7c7a74a302 100644 --- a/aten/src/ATen/CMakeLists.txt +++ b/aten/src/ATen/CMakeLists.txt -@@ -696,7 +696,7 @@ if(USE_ROCM) +@@ -793,7 +793,7 @@ if(USE_ROCM) # list(APPEND ATen_HIP_DEPENDENCY_LIBS ATEN_CUDA_FILES_GEN_LIB) endif() diff --git a/recipe/patches/0011-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch b/recipe/patches/0009-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch similarity index 89% rename from recipe/patches/0011-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch rename to recipe/patches/0009-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch index a126aea5c..aa4e3a029 100644 --- a/recipe/patches/0011-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch +++ b/recipe/patches/0009-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch @@ -1,7 +1,7 @@ -From 24e8b1baf4cc5fe783b6a2b13f36ef026bb98554 Mon Sep 17 00:00:00 2001 +From 755c05e421afd36dc38f07208f28e6df94d48323 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 28 Jan 2025 10:58:29 +1100 -Subject: [PATCH 11/15] remove `DESTINATION lib` from CMake `install(TARGETS` +Subject: [PATCH 09/13] remove `DESTINATION lib` from CMake `install(TARGETS` directives Suggested-By: Silvio Traversaro @@ -16,10 +16,10 @@ Suggested-By: Silvio Traversaro 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/c10/CMakeLists.txt b/c10/CMakeLists.txt -index 8e9d267352d..6c4a4472325 100644 +index f82e460cafc..d5df53938c3 100644 --- a/c10/CMakeLists.txt +++ b/c10/CMakeLists.txt -@@ -164,7 +164,7 @@ if(NOT BUILD_LIBTORCHLESS) +@@ -162,7 +162,7 @@ if(NOT BUILD_LIBTORCHLESS) # Note: for now, we will put all export path into one single Caffe2Targets group # to deal with the cmake deployment need. Inside the Caffe2Targets set, the # individual libraries like libc10.so and libcaffe2.so are still self-contained. @@ -68,10 +68,10 @@ index 95b9f031c3e..f1ce6d1ad14 100644 add_subdirectory(test) endif() diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt -index d1ce24e37fe..1f929e7b8b3 100644 +index 6ab41b6c847..a78ad102aa6 100644 --- a/caffe2/CMakeLists.txt +++ b/caffe2/CMakeLists.txt -@@ -562,7 +562,7 @@ if(USE_CUDA) +@@ -567,7 +567,7 @@ if(USE_CUDA) endif() target_link_libraries(caffe2_nvrtc PRIVATE caffe2::nvrtc ${DELAY_LOAD_FLAGS}) @@ -80,7 +80,7 @@ index d1ce24e37fe..1f929e7b8b3 100644 if(USE_NCCL) list(APPEND Caffe2_GPU_SRCS ${TORCH_SRC_DIR}/csrc/cuda/nccl.cpp) -@@ -636,7 +636,7 @@ if(USE_ROCM) +@@ -642,7 +642,7 @@ if(USE_ROCM) target_link_libraries(caffe2_nvrtc hip::amdhip64 hiprtc::hiprtc) target_include_directories(caffe2_nvrtc PRIVATE ${CMAKE_BINARY_DIR}) target_compile_definitions(caffe2_nvrtc PRIVATE USE_ROCM __HIP_PLATFORM_AMD__) @@ -89,7 +89,7 @@ index d1ce24e37fe..1f929e7b8b3 100644 endif() if(NOT NO_API AND NOT BUILD_LITE_INTERPRETER) -@@ -1098,7 +1098,7 @@ elseif(USE_CUDA) +@@ -1112,7 +1112,7 @@ elseif(USE_CUDA) CUDA::culibos ${CMAKE_DL_LIBS}) endif() set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/../aten/src/ATen/native/cuda/LinearAlgebraStubs.cpp PROPERTIES COMPILE_FLAGS "-DBUILD_LAZY_CUDA_LINALG") @@ -98,7 +98,7 @@ index d1ce24e37fe..1f929e7b8b3 100644 endif() if(USE_PRECOMPILED_HEADERS) -@@ -1584,17 +1584,17 @@ endif() +@@ -1590,17 +1590,17 @@ endif() caffe2_interface_library(torch torch_library) @@ -121,9 +121,9 @@ index d1ce24e37fe..1f929e7b8b3 100644 target_link_libraries(torch PUBLIC torch_cpu_library) -@@ -1726,7 +1726,7 @@ if(BUILD_SHARED_LIBS) - target_link_libraries(torch_global_deps ${Caffe2_PUBLIC_CUDA_DEPENDENCY_LIBS}) - target_link_libraries(torch_global_deps torch::cudart) +@@ -1743,7 +1743,7 @@ if(BUILD_SHARED_LIBS) + target_link_libraries(torch_global_deps torch::nvtoolsext) + endif() endif() - install(TARGETS torch_global_deps DESTINATION "${TORCH_INSTALL_LIB_DIR}") + install(TARGETS torch_global_deps) @@ -131,10 +131,10 @@ index d1ce24e37fe..1f929e7b8b3 100644 # ---[ Caffe2 HIP sources. diff --git a/torch/CMakeLists.txt b/torch/CMakeLists.txt -index 3985cf50c14..bcb90bfc672 100644 +index 1632147f022..ca8a193adb5 100644 --- a/torch/CMakeLists.txt +++ b/torch/CMakeLists.txt -@@ -463,7 +463,7 @@ if(NOT TORCH_PYTHON_LINK_FLAGS STREQUAL "") +@@ -468,7 +468,7 @@ if(NOT TORCH_PYTHON_LINK_FLAGS STREQUAL "") set_target_properties(torch_python PROPERTIES LINK_FLAGS ${TORCH_PYTHON_LINK_FLAGS}) endif() diff --git a/recipe/patches/0012-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch b/recipe/patches/0010-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch similarity index 88% rename from recipe/patches/0012-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch rename to recipe/patches/0010-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch index faa260e89..381edb708 100644 --- a/recipe/patches/0012-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch +++ b/recipe/patches/0010-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch @@ -1,24 +1,24 @@ -From 6785dd8f59dc951fb1194a287f24ea205d72b456 Mon Sep 17 00:00:00 2001 +From 0ee779ff0a9573eeda2b67cf32ea7061d13dd75c Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 30 Jan 2025 08:33:44 +1100 -Subject: [PATCH 12/15] avoid deprecated `find_package(CUDA)` in caffe2 CMake +Subject: [PATCH 10/13] avoid deprecated `find_package(CUDA)` in caffe2 CMake metadata vendor the not-available-anymore function torch_cuda_get_nvcc_gencode_flag from CMake --- - caffe2/CMakeLists.txt | 14 ++-- + caffe2/CMakeLists.txt | 10 +-- cmake/Summary.cmake | 10 +-- cmake/TorchConfig.cmake.in | 2 +- cmake/public/cuda.cmake | 48 ++++---------- cmake/public/utils.cmake | 127 +++++++++++++++++++++++++++++++++++++ setup.py | 2 +- - 6 files changed, 153 insertions(+), 50 deletions(-) + 6 files changed, 151 insertions(+), 48 deletions(-) diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt -index 1f929e7b8b3..8116b5fb5ec 100644 +index a78ad102aa6..fb89e8b2e3c 100644 --- a/caffe2/CMakeLists.txt +++ b/caffe2/CMakeLists.txt -@@ -948,25 +948,25 @@ if(USE_ROCM) +@@ -953,25 +953,25 @@ if(USE_ROCM) "$<$:ATen/core/ATen_pch.h>") endif() elseif(USE_CUDA) @@ -49,26 +49,11 @@ index 1f929e7b8b3..8116b5fb5ec 100644 torch_compile_options(torch_cuda) # see cmake/public/utils.cmake target_compile_definitions(torch_cuda PRIVATE USE_CUDA) -@@ -1076,12 +1076,12 @@ elseif(USE_CUDA) - torch_cuda - ) - if($ENV{ATEN_STATIC_CUDA}) -- if(CUDA_VERSION_MAJOR LESS_EQUAL 11) -+ if(CUDAToolkit_VERSION_MAJOR LESS_EQUAL 11) - target_link_libraries(torch_cuda_linalg PRIVATE - CUDA::cusolver_static - ${CUDAToolkit_LIBRARY_DIR}/liblapack_static.a # needed for libcusolver_static - ) -- elseif(CUDA_VERSION_MAJOR GREATER_EQUAL 12) -+ elseif(CUDAToolkit_VERSION_MAJOR GREATER_EQUAL 12) - target_link_libraries(torch_cuda_linalg PRIVATE - CUDA::cusolver_static - ${CUDAToolkit_LIBRARY_DIR}/libcusolver_lapack_static.a # needed for libcusolver_static diff --git a/cmake/Summary.cmake b/cmake/Summary.cmake -index c33269c0a28..ac200e24ca0 100644 +index 745d9ea0586..993892c6d80 100644 --- a/cmake/Summary.cmake +++ b/cmake/Summary.cmake -@@ -76,7 +76,7 @@ function(caffe2_print_configuration_summary) +@@ -75,7 +75,7 @@ function(caffe2_print_configuration_summary) message(STATUS " USE_CUSPARSELT : ${USE_CUSPARSELT}") message(STATUS " USE_CUDSS : ${USE_CUDSS}") message(STATUS " USE_CUFILE : ${USE_CUFILE}") @@ -77,7 +62,7 @@ index c33269c0a28..ac200e24ca0 100644 message(STATUS " USE_FLASH_ATTENTION : ${USE_FLASH_ATTENTION}") message(STATUS " USE_MEM_EFF_ATTENTION : ${USE_MEM_EFF_ATTENTION}") if(${USE_CUDNN}) -@@ -88,7 +88,7 @@ function(caffe2_print_configuration_summary) +@@ -87,7 +87,7 @@ function(caffe2_print_configuration_summary) if(${USE_CUFILE}) message(STATUS " cufile library : ${CUDA_cuFile_LIBRARY}") endif() @@ -86,7 +71,7 @@ index c33269c0a28..ac200e24ca0 100644 message(STATUS " CUDA library : ${CUDA_cuda_driver_LIBRARY}") message(STATUS " cudart library : ${CUDA_cudart_LIBRARY}") message(STATUS " cublas library : ${CUDA_cublas_LIBRARY}") -@@ -108,12 +108,12 @@ function(caffe2_print_configuration_summary) +@@ -107,12 +107,12 @@ function(caffe2_print_configuration_summary) message(STATUS " cuDSS library : ${__tmp}") endif() message(STATUS " nvrtc : ${CUDA_nvrtc_LIBRARY}") @@ -103,7 +88,7 @@ index c33269c0a28..ac200e24ca0 100644 if(${USE_TENSORRT}) message(STATUS " TensorRT runtime library: ${TENSORRT_LIBRARY}") diff --git a/cmake/TorchConfig.cmake.in b/cmake/TorchConfig.cmake.in -index 8a5587cad27..90c03147817 100644 +index 0b32ffa99ce..471b7154ed0 100644 --- a/cmake/TorchConfig.cmake.in +++ b/cmake/TorchConfig.cmake.in @@ -130,7 +130,7 @@ if(@USE_CUDA@) @@ -113,10 +98,10 @@ index 8a5587cad27..90c03147817 100644 - set(TORCH_CUDA_LIBRARIES ${CUDA_NVRTC_LIB}) + set(TORCH_CUDA_LIBRARIES CUDA::nvrtc) endif() - - if(@BUILD_SHARED_LIBS@) + if(TARGET torch::nvtoolsext) + list(APPEND TORCH_CUDA_LIBRARIES torch::nvtoolsext) diff --git a/cmake/public/cuda.cmake b/cmake/public/cuda.cmake -index ca888bb9db2..ef4119d8a00 100644 +index 218c50a69c6..8ee4e2fe98b 100644 --- a/cmake/public/cuda.cmake +++ b/cmake/public/cuda.cmake @@ -26,8 +26,8 @@ if(NOT MSVC) @@ -157,12 +142,12 @@ index ca888bb9db2..ef4119d8a00 100644 -message(STATUS "PyTorch: CUDA detected: " ${CUDA_VERSION}) -message(STATUS "PyTorch: CUDA nvcc is: " ${CUDA_NVCC_EXECUTABLE}) -message(STATUS "PyTorch: CUDA toolkit directory: " ${CUDA_TOOLKIT_ROOT_DIR}) --if(CUDA_VERSION VERSION_LESS 11.0) +-if(CUDA_VERSION VERSION_LESS 12.0) +message(STATUS "PyTorch: CUDA detected: " ${CUDAToolkit_VERSION}) +message(STATUS "PyTorch: CUDA nvcc is: " ${CUDAToolkit_NVCC_EXECUTABLE}) +message(STATUS "PyTorch: CUDA toolkit directory: " ${CUDAToolkit_ROOT}) -+if(CUDAToolkit_VERSION VERSION_LESS 11.0) - message(FATAL_ERROR "PyTorch requires CUDA 11.0 or above.") ++if(CUDAToolkit_VERSION VERSION_LESS 12.0) + message(FATAL_ERROR "PyTorch requires CUDA 12.0 or above.") endif() -if(CUDA_FOUND) @@ -189,7 +174,7 @@ index ca888bb9db2..ef4119d8a00 100644 - # Force CUDA to be processed for again next time - # TODO: I'm not sure if this counts as an implementation detail of - # FindCUDA -- set(${cuda_version_from_findcuda} ${CUDA_VERSION_STRING}) +- set(cuda_version_from_findcuda ${CUDA_VERSION_STRING}) - unset(CUDA_TOOLKIT_ROOT_DIR_INTERNAL CACHE) - # Not strictly necessary, but for good luck. - unset(CUDA_VERSION CACHE) @@ -215,10 +200,10 @@ index ca888bb9db2..ef4119d8a00 100644 execute_process( COMMAND Python::Interpreter -c diff --git a/cmake/public/utils.cmake b/cmake/public/utils.cmake -index d56dd74d6c0..9f59b40d612 100644 +index 68e66bb3fc3..e02a4abf8cc 100644 --- a/cmake/public/utils.cmake +++ b/cmake/public/utils.cmake -@@ -306,6 +306,133 @@ macro(torch_hip_get_arch_list store_var) +@@ -293,6 +293,133 @@ macro(torch_hip_get_arch_list store_var) string(REPLACE " " ";" ${store_var} "${_TMP}") endmacro() @@ -353,14 +338,14 @@ index d56dd74d6c0..9f59b40d612 100644 # Get the XPU arch flags specified by TORCH_XPU_ARCH_LIST. # Usage: diff --git a/setup.py b/setup.py -index 7f88ade34bf..3b3a3ab46fa 100644 +index 1c5b75897df..759a756739c 100644 --- a/setup.py +++ b/setup.py -@@ -695,7 +695,7 @@ class build_ext(setuptools.command.build_ext.build_ext): +@@ -1175,7 +1175,7 @@ class build_ext(setuptools.command.build_ext.build_ext): else: report("-- Not using cuDNN") if cmake_cache_vars["USE_CUDA"]: -- report("-- Detected CUDA at " + cmake_cache_vars["CUDA_TOOLKIT_ROOT_DIR"]) +- report(f"-- Detected CUDA at {cmake_cache_vars['CUDA_TOOLKIT_ROOT_DIR']}") + report(f"-- Detected CUDA at {cmake_cache_vars['CMAKE_CUDA_COMPILER_TOOLKIT_ROOT']}") else: report("-- Not using CUDA") diff --git a/recipe/patches/0013-Fix-CUPTI-lookup-to-include-target-directory.patch b/recipe/patches/0011-Fix-CUPTI-lookup-to-include-target-directory.patch similarity index 75% rename from recipe/patches/0013-Fix-CUPTI-lookup-to-include-target-directory.patch rename to recipe/patches/0011-Fix-CUPTI-lookup-to-include-target-directory.patch index 28ed68282..629f10183 100644 --- a/recipe/patches/0013-Fix-CUPTI-lookup-to-include-target-directory.patch +++ b/recipe/patches/0011-Fix-CUPTI-lookup-to-include-target-directory.patch @@ -1,17 +1,17 @@ -From 5b0baec85cfa42559474098f0dfd7952145a044e Mon Sep 17 00:00:00 2001 +From 846567d76fe17ac1c9f1154bb439c6a106445dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 6 Mar 2025 13:57:25 +0100 -Subject: [PATCH 13/15] Fix CUPTI lookup to include target directory +Subject: [PATCH 11/13] Fix CUPTI lookup to include target directory --- cmake/Dependencies.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake -index 1dee5889d34..11577a2c0dc 100644 +index f7e56828bdf..4a9fe193830 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake -@@ -1637,6 +1637,7 @@ if(USE_KINETO) +@@ -1626,6 +1626,7 @@ if(USE_KINETO) endif() find_library(CUPTI_LIBRARY_PATH ${CUPTI_LIB_NAME} PATHS @@ -19,7 +19,7 @@ index 1dee5889d34..11577a2c0dc 100644 ${CUDA_SOURCE_DIR} ${CUDA_SOURCE_DIR}/extras/CUPTI/lib64 ${CUDA_SOURCE_DIR}/lib -@@ -1644,6 +1645,7 @@ if(USE_KINETO) +@@ -1633,6 +1634,7 @@ if(USE_KINETO) NO_DEFAULT_PATH) find_path(CUPTI_INCLUDE_DIR cupti.h PATHS diff --git a/recipe/patches/0014-skip-test_norm_matrix_degenerate_shapes-on-numpy-2.3.patch b/recipe/patches/0012-skip-test_norm_matrix_degenerate_shapes-on-numpy-2.3.patch similarity index 81% rename from recipe/patches/0014-skip-test_norm_matrix_degenerate_shapes-on-numpy-2.3.patch rename to recipe/patches/0012-skip-test_norm_matrix_degenerate_shapes-on-numpy-2.3.patch index 27a2069fc..e0d52f2ef 100644 --- a/recipe/patches/0014-skip-test_norm_matrix_degenerate_shapes-on-numpy-2.3.patch +++ b/recipe/patches/0012-skip-test_norm_matrix_degenerate_shapes-on-numpy-2.3.patch @@ -1,14 +1,14 @@ -From f69f6c1f9f1bd001571f22689086ca15c23819f6 Mon Sep 17 00:00:00 2001 +From f38ba11d997851548be9682b37e1dba88cd7856b Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 14 Jun 2025 07:34:48 +1100 -Subject: [PATCH 14/15] skip test_norm_matrix_degenerate_shapes on numpy >=2.3 +Subject: [PATCH 12/13] skip test_norm_matrix_degenerate_shapes on numpy >=2.3 --- test/test_linalg.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_linalg.py b/test/test_linalg.py -index 108a5f59007..5381635b395 100644 +index 0f6c8f20742..f54dcce901d 100644 --- a/test/test_linalg.py +++ b/test/test_linalg.py @@ -2042,6 +2042,7 @@ class TestLinalg(TestCase): diff --git a/recipe/patches/0015-Define-PY_SSIZE_T_CLEAN-before-include-Python.h.patch b/recipe/patches/0013-Define-PY_SSIZE_T_CLEAN-before-include-Python.h.patch similarity index 81% rename from recipe/patches/0015-Define-PY_SSIZE_T_CLEAN-before-include-Python.h.patch rename to recipe/patches/0013-Define-PY_SSIZE_T_CLEAN-before-include-Python.h.patch index e9976cba0..e7f0887ae 100644 --- a/recipe/patches/0015-Define-PY_SSIZE_T_CLEAN-before-include-Python.h.patch +++ b/recipe/patches/0013-Define-PY_SSIZE_T_CLEAN-before-include-Python.h.patch @@ -1,7 +1,7 @@ -From 3d38a7377927da6eb0224e24ba4374db78edfef8 Mon Sep 17 00:00:00 2001 +From 8686ba30882206176dbbeba67a1063d1a08ef669 Mon Sep 17 00:00:00 2001 From: LWisteria Date: Sun, 2 Jun 2024 19:13:23 +0900 -Subject: [PATCH 15/15] Define PY_SSIZE_T_CLEAN before #include +Subject: [PATCH 13/13] Define PY_SSIZE_T_CLEAN before #include See https://docs.python.org/3/c-api/intro.html#include-files --- diff --git a/recipe/patches/0014-Add-USE_SYSTEM-options-for-KLEIDI-CUDNN_FRONTEND-CUT.patch b/recipe/patches/0014-Add-USE_SYSTEM-options-for-KLEIDI-CUDNN_FRONTEND-CUT.patch new file mode 100644 index 000000000..fea50e211 --- /dev/null +++ b/recipe/patches/0014-Add-USE_SYSTEM-options-for-KLEIDI-CUDNN_FRONTEND-CUT.patch @@ -0,0 +1,203 @@ +From 80d19fab767e27bc950b8e229b11294495192a1e Mon Sep 17 00:00:00 2001 +From: Yukio Siraichi +Date: Tue, 30 Sep 2025 01:10:13 +0000 +Subject: [PATCH 14/14] Add USE_SYSTEM options for KLEIDI, CUDNN_FRONTEND, + CUTLASS, and FMT + +This commit adds CMake options to allow users to use system-installed versions of four libraries instead of the bundled versions + +Fixes #153863 +PR: https://github.com/pytorch/pytorch/pull/166824 +--- + CMakeLists.txt | 8 +++++ + aten/src/ATen/CMakeLists.txt | 17 +++++++-- + cmake/Dependencies.cmake | 69 +++++++++++++++++++++++++++--------- + cmake/Summary.cmake | 4 +++ + 4 files changed, 80 insertions(+), 18 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ce7890f002d..6d55828e61e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -467,6 +467,10 @@ option(USE_SYSTEM_BENCHMARK "Use system-provided google benchmark." OFF) + option(USE_SYSTEM_ONNX "Use system-provided onnx." OFF) + option(USE_SYSTEM_XNNPACK "Use system-provided xnnpack." OFF) + option(USE_SYSTEM_NVTX "Use system-provided nvtx." OFF) ++option(USE_SYSTEM_KLEIDIAI "Use system-provided KleidiAI." OFF) ++option(USE_SYSTEM_CUDNN_FRONTEND "Use system-provided cuDNN frontend." OFF) ++option(USE_SYSTEM_CUTLASS "Use system-provided CUTLASS." OFF) ++option(USE_SYSTEM_FMT "Use system-provided fmt." OFF) + option(USE_GOLD_LINKER "Use ld.gold to link" OFF) + if(USE_SYSTEM_LIBS) + set(USE_SYSTEM_CPUINFO ON) +@@ -486,6 +490,10 @@ if(USE_SYSTEM_LIBS) + set(USE_SYSTEM_NCCL ON) + endif() + set(USE_SYSTEM_NVTX ON) ++ set(USE_SYSTEM_KLEIDIAI ON) ++ set(USE_SYSTEM_CUDNN_FRONTEND ON) ++ set(USE_SYSTEM_CUTLASS ON) ++ set(USE_SYSTEM_FMT ON) + endif() + + # /Z7 override option When generating debug symbols, CMake default to use the +diff --git a/aten/src/ATen/CMakeLists.txt b/aten/src/ATen/CMakeLists.txt +index d7c7a74a302..9f9c20926cd 100644 +--- a/aten/src/ATen/CMakeLists.txt ++++ b/aten/src/ATen/CMakeLists.txt +@@ -666,8 +666,21 @@ if(USE_CUDA AND NOT USE_ROCM) + add_definitions(-DCUTLASS_ENABLE_TENSOR_CORE_MMA=1) + add_definitions(-DCUTLASS_ENABLE_SM90_EXTENDED_MMA_SHAPES=1) + add_definitions(-DCUTE_SM90_EXTENDED_MMA_SHAPES_ENABLED) +- list(APPEND ATen_CUDA_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party/cutlass/include) +- list(APPEND ATen_CUDA_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party/cutlass/tools/util/include) ++ if(NOT USE_SYSTEM_CUTLASS) ++ list(APPEND ATen_CUDA_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party/cutlass/include) ++ list(APPEND ATen_CUDA_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party/cutlass/tools/util/include) ++ else() ++ find_path(CUTLASS_INCLUDE_DIR cutlass/cutlass.h) ++ if(NOT CUTLASS_INCLUDE_DIR) ++ message(FATAL_ERROR "Cannot find system CUTLASS headers. Please install cutlass-dev or set USE_SYSTEM_CUTLASS=OFF") ++ endif() ++ list(APPEND ATen_CUDA_INCLUDE ${CUTLASS_INCLUDE_DIR}) ++ # Check if tools/util/include exists in system installation ++ find_path(CUTLASS_TOOLS_INCLUDE_DIR cutlass/util/command_line.h PATH_SUFFIXES cutlass) ++ if(CUTLASS_TOOLS_INCLUDE_DIR) ++ list(APPEND ATen_CUDA_INCLUDE ${CUTLASS_TOOLS_INCLUDE_DIR}) ++ endif() ++ endif() + + # Add FBGEMM_GENAI include directories for torch_ops.h + if(USE_FBGEMM_GENAI) +diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake +index 4a9fe193830..8b3a1b2629a 100644 +--- a/cmake/Dependencies.cmake ++++ b/cmake/Dependencies.cmake +@@ -948,7 +948,14 @@ if(USE_CUDNN) + if(CUDNN_VERSION VERSION_LESS 8.5) + message(FATAL_ERROR "PyTorch needs CuDNN-8.5 or above, but found ${CUDNN_VERSION}. Builds are still possible with `USE_CUDNN=0`") + endif() +- set(CUDNN_FRONTEND_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../third_party/cudnn_frontend/include) ++ if(NOT USE_SYSTEM_CUDNN_FRONTEND) ++ set(CUDNN_FRONTEND_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../third_party/cudnn_frontend/include) ++ else() ++ find_path(CUDNN_FRONTEND_INCLUDE_DIR cudnn_frontend.h PATH_SUFFIXES cudnn_frontend) ++ if(NOT CUDNN_FRONTEND_INCLUDE_DIR) ++ message(FATAL_ERROR "Cannot find system cuDNN frontend headers. Please install cudnn-frontend-dev or set USE_SYSTEM_CUDNN_FRONTEND=OFF") ++ endif() ++ endif() + target_include_directories(torch::cudnn INTERFACE ${CUDNN_FRONTEND_INCLUDE_DIR}) + endif() + +@@ -1493,7 +1500,7 @@ if(NOT INTERN_BUILD_MOBILE) + message("disabling MKLDNN because USE_MKLDNN is not set") + endif() + +- if(USE_KLEIDIAI) ++ if(USE_KLEIDIAI AND NOT USE_SYSTEM_KLEIDIAI) + set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) + set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE) + set(AT_KLEIDIAI_ENABLED 1) +@@ -1503,6 +1510,22 @@ if(NOT INTERN_BUILD_MOBILE) + list(APPEND Caffe2_DEPENDENCY_LIBS kleidiai) + # Recover build options. + set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE) ++ elseif(USE_KLEIDIAI AND USE_SYSTEM_KLEIDIAI) ++ add_library(kleidiai UNKNOWN IMPORTED) ++ find_library(KLEIDIAI_LIBRARY kleidiai) ++ if(NOT KLEIDIAI_LIBRARY) ++ message(FATAL_ERROR "Cannot find system KleidiAI library. Please install it or set USE_SYSTEM_KLEIDIAI=OFF") ++ endif() ++ find_path(KLEIDIAI_INCLUDE_DIR kai/kai_common.h) ++ if(NOT KLEIDIAI_INCLUDE_DIR) ++ message(FATAL_ERROR "Cannot find system KleidiAI headers. Please install kleidiai-dev or set USE_SYSTEM_KLEIDIAI=OFF") ++ endif() ++ set_target_properties(kleidiai PROPERTIES ++ IMPORTED_LOCATION "${KLEIDIAI_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${KLEIDIAI_INCLUDE_DIR}" ++ ) ++ set(AT_KLEIDIAI_ENABLED 1) ++ list(APPEND Caffe2_DEPENDENCY_LIBS kleidiai) + endif() + + if(UNIX AND NOT APPLE) +@@ -1546,21 +1569,35 @@ endif() + # + # End ATen checks + # +-set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) +-set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE) +-add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt) + +-# Disable compiler feature checks for `fmt`. +-# +-# CMake compiles a little program to check compiler features. Some of our build +-# configurations (notably the mobile build analyzer) will populate +-# CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know +-# `fmt` is compatible with a superset of the compilers that PyTorch is, it +-# shouldn't be too bad to just disable the checks. +-set_target_properties(fmt-header-only PROPERTIES INTERFACE_COMPILE_FEATURES "") +- +-list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only) +-set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE) ++# Install `fmtlib` header. ++# This was the default behavior before version 12.0.0. ++# Since PyTorch C API depends on it, make it available for projects that ++# depend on PyTorch. ++if(NOT USE_SYSTEM_FMT) ++ set(FMT_INSTALL ON) ++ set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) ++ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE) ++ add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt) ++ ++ # Disable compiler feature checks for `fmt`. ++ # ++ # CMake compiles a little program to check compiler features. Some of our build ++ # configurations (notably the mobile build analyzer) will populate ++ # CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know ++ # `fmt` is compatible with a superset of the compilers that PyTorch is, it ++ # shouldn't be too bad to just disable the checks. ++ set_target_properties(fmt-header-only PROPERTIES INTERFACE_COMPILE_FEATURES "") ++ ++ list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only) ++ set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE) ++else() ++ find_package(fmt REQUIRED) ++ if(NOT fmt_FOUND) ++ message(FATAL_ERROR "Cannot find system fmt library. Please install libfmt-dev or set USE_SYSTEM_FMT=OFF") ++ endif() ++ list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt) ++endif() + + # ---[ Kineto + # edge profiler depends on KinetoProfiler but it only does cpu +diff --git a/cmake/Summary.cmake b/cmake/Summary.cmake +index 993892c6d80..388e1d164ad 100644 +--- a/cmake/Summary.cmake ++++ b/cmake/Summary.cmake +@@ -80,7 +80,9 @@ function(caffe2_print_configuration_summary) + message(STATUS " USE_MEM_EFF_ATTENTION : ${USE_MEM_EFF_ATTENTION}") + if(${USE_CUDNN}) + message(STATUS " cuDNN version : ${CUDNN_VERSION}") ++ message(STATUS " USE_SYSTEM_CUDNN_FRONTEND : ${USE_SYSTEM_CUDNN_FRONTEND}") + endif() ++ message(STATUS " USE_SYSTEM_CUTLASS : ${USE_SYSTEM_CUTLASS}") + if(${USE_CUSPARSELT}) + message(STATUS " cuSPARSELt version : ${CUSPARSELT_VERSION}") + endif() +@@ -156,6 +158,7 @@ function(caffe2_print_configuration_summary) + endif() + if(${USE_KLEIDIAI}) + message(STATUS " USE_KLEIDIAI : ${USE_KLEIDIAI}") ++ message(STATUS " USE_SYSTEM_KLEIDIAI : ${USE_SYSTEM_KLEIDIAI}") + endif() + message(STATUS " USE_UCC : ${USE_UCC}") + if(${USE_UCC}) +@@ -187,6 +190,7 @@ function(caffe2_print_configuration_summary) + message(STATUS " USE_VULKAN_FP16_INFERENCE : ${USE_VULKAN_FP16_INFERENCE}") + message(STATUS " USE_VULKAN_RELAXED_PRECISION : ${USE_VULKAN_RELAXED_PRECISION}") + endif() ++ message(STATUS " USE_SYSTEM_FMT : ${USE_SYSTEM_FMT}") + message(STATUS " USE_PROF : ${USE_PROF}") + message(STATUS " USE_PYTORCH_QNNPACK : ${USE_PYTORCH_QNNPACK}") + message(STATUS " USE_XNNPACK : ${USE_XNNPACK}") diff --git a/recipe/patches/0015-Fix-building-kineto-against-system-fmt.patch b/recipe/patches/0015-Fix-building-kineto-against-system-fmt.patch new file mode 100644 index 000000000..5fd9277ec --- /dev/null +++ b/recipe/patches/0015-Fix-building-kineto-against-system-fmt.patch @@ -0,0 +1,26 @@ +From 2d7566334da792a27f7a01f6e8ac34975915156c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Mon, 3 Nov 2025 14:59:04 +0100 +Subject: [PATCH 15/15] Fix building kineto against system fmt +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Michał Górny +--- + cmake/Dependencies.cmake | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake +index 8b3a1b2629a..b99fbc5999f 100644 +--- a/cmake/Dependencies.cmake ++++ b/cmake/Dependencies.cmake +@@ -1597,6 +1597,8 @@ else() + message(FATAL_ERROR "Cannot find system fmt library. Please install libfmt-dev or set USE_SYSTEM_FMT=OFF") + endif() + list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt) ++ # for kineto ++ add_custom_target(fmt) + endif() + + # ---[ Kineto diff --git a/recipe/patches/0016-Attempt-to-fix-torch.backends.cudnn.rnn-import.patch b/recipe/patches/0016-Attempt-to-fix-torch.backends.cudnn.rnn-import.patch new file mode 100644 index 000000000..6ac645415 --- /dev/null +++ b/recipe/patches/0016-Attempt-to-fix-torch.backends.cudnn.rnn-import.patch @@ -0,0 +1,131 @@ +From 93be0373dd974e80eb9544892319dfc1a4d29c65 Mon Sep 17 00:00:00 2001 +From: Eddie Yan +Date: Tue, 5 Aug 2025 00:49:50 +0000 +Subject: [PATCH 16/16] Attempt to fix torch.backends.cudnn.rnn import + +torch.backends.cudnn module in order to expose the .conv.fp32_precision +and .rnn.fp32_precision settings. However, it fails to account for the +existing torch.backends.cudnn.rnn module, which if imported after leaves +us in a limbo state where the additional .rnn.fp32_precision property is +no longer accessible. + +This PR is WIP and attempts to remedy this by propagating the hack and +replaces the RNN module with a similar PropertyModule replacement. There +is more than one wart, e.g., a duplicate ContextProp definition in +rnn.py as the original one in backends seems to be too strict in its +frozen flags check. +--- + test/test_cuda.py | 2 ++ + torch/backends/cudnn/__init__.py | 3 ++- + torch/backends/cudnn/rnn.py | 40 +++++++++++++++++++++++++++++++- + 3 files changed, 43 insertions(+), 2 deletions(-) + +diff --git a/test/test_cuda.py b/test/test_cuda.py +index 293bb2b7e70..477b0179f05 100644 +--- a/test/test_cuda.py ++++ b/test/test_cuda.py +@@ -911,6 +911,7 @@ print(t.is_pinned()) + self.assertEqual(torch.backends.cudnn.rnn.fp32_precision, "none") + + @recover_orig_fp32_precision ++ @serialTest() + def test_fp32_precision_with_float32_matmul_precision(self): + torch.set_float32_matmul_precision("highest") + self.assertEqual(torch.backends.cuda.matmul.fp32_precision, "ieee") +@@ -920,6 +921,7 @@ print(t.is_pinned()) + self.assertEqual(torch.backends.cuda.matmul.fp32_precision, "tf32") + + @recover_orig_fp32_precision ++ @serialTest() + def test_invalid_status_for_legacy_api(self): + torch.backends.cudnn.conv.fp32_precision = "none" + torch.backends.cudnn.rnn.fp32_precision = "tf32" +diff --git a/torch/backends/cudnn/__init__.py b/torch/backends/cudnn/__init__.py +index 9c155de7c04..a4106ea32cc 100644 +--- a/torch/backends/cudnn/__init__.py ++++ b/torch/backends/cudnn/__init__.py +@@ -15,6 +15,8 @@ from torch.backends import ( + PropModule, + ) + ++from . import rnn ++ + + try: + from torch._C import _cudnn +@@ -212,7 +214,6 @@ class CudnnModule(PropModule): + torch._C._get_cudnn_allow_tf32, torch._C._set_cudnn_allow_tf32 + ) + conv = _FP32Precision("cuda", "conv") +- rnn = _FP32Precision("cuda", "rnn") + fp32_precision = ContextProp( + _get_fp32_precision_getter("cuda", "all"), + _set_fp32_precision_setter("cuda", "all"), +diff --git a/torch/backends/cudnn/rnn.py b/torch/backends/cudnn/rnn.py +index 5b253e19054..8f6a3964fab 100644 +--- a/torch/backends/cudnn/rnn.py ++++ b/torch/backends/cudnn/rnn.py +@@ -1,5 +1,13 @@ + # mypy: allow-untyped-defs ++import sys ++ ++import torch._C + import torch.cuda ++from torch.backends import ( ++ _get_fp32_precision_getter, ++ _set_fp32_precision_setter, ++ PropModule, ++) + + + try: +@@ -20,7 +28,7 @@ def get_cudnn_mode(mode): + elif mode == "GRU": + return int(_cudnn.RNNMode.gru) + else: +- raise Exception(f"Unknown mode: {mode}") # noqa: TRY002 ++ raise ValueError(f"Unknown mode: {mode}") # noqa: TRY002 + + + # NB: We don't actually need this class anymore (in fact, we could serialize the +@@ -42,6 +50,20 @@ class Unserializable: + self.inner = None + + ++# we would like to use ContextProp from backends here but the ++# frozen flags appears to be overzealous ++class ContextProp: ++ def __init__(self, getter, setter): ++ self.getter = getter ++ self.setter = setter ++ ++ def __get__(self, obj, objtype): ++ return self.getter() ++ ++ def __set__(self, obj, val): ++ self.setter(val) ++ ++ + def init_dropout_state(dropout, train, dropout_seed, dropout_state): + dropout_desc_name = "desc_" + str(torch.cuda.current_device()) + dropout_p = dropout if train else 0 +@@ -62,3 +84,19 @@ def init_dropout_state(dropout, train, dropout_seed, dropout_state): + ) + dropout_ts = dropout_state[dropout_desc_name].get() + return dropout_ts ++ ++ ++class CudnnRNNModule(PropModule): ++ def __init__(self, m, name): ++ super().__init__(m, name) ++ self.m.Unserializable = Unserializable ++ self.m.get_cudnn_mode = get_cudnn_mode ++ self.m.init_dropout_state = init_dropout_state ++ ++ fp32_precision = ContextProp( ++ _get_fp32_precision_getter("cuda", "rnn"), ++ _set_fp32_precision_setter("cuda", "rnn"), ++ ) ++ ++ ++sys.modules[__name__] = CudnnRNNModule(sys.modules[__name__], __name__) diff --git a/recipe/patches_submodules/fbgemm/0001-remove-DESTINATION-lib-from-CMake-install-directives.patch b/recipe/patches_submodules/fbgemm/0001-remove-DESTINATION-lib-from-CMake-install-directives.patch deleted file mode 100644 index 665cc74e8..000000000 --- a/recipe/patches_submodules/fbgemm/0001-remove-DESTINATION-lib-from-CMake-install-directives.patch +++ /dev/null @@ -1,25 +0,0 @@ -From a9879bdd5ea793c5301a4b86f163a07e1f28f321 Mon Sep 17 00:00:00 2001 -From: "H. Vetinari" -Date: Tue, 28 Jan 2025 13:32:28 +1100 -Subject: [PATCH] remove `DESTINATION lib` from CMake install directives - -Suggested-By: Silvio Traversaro ---- - CMakeLists.txt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/third_party/fbgemm/CMakeLists.txt b/third_party/fbgemm/CMakeLists.txt -index 134523e7..86fb8fad 100644 ---- a/third_party/fbgemm/CMakeLists.txt -+++ b/third_party/fbgemm/CMakeLists.txt -@@ -370,8 +370,8 @@ if(MSVC) - FILES $ $ - DESTINATION ${CMAKE_INSTALL_LIBDIR} OPTIONAL) - endif() -- install(TARGETS fbgemm DESTINATION ${CMAKE_INSTALL_LIBDIR}) -- install(TARGETS asmjit DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(TARGETS fbgemm) -+ install(TARGETS asmjit) - endif() - - #Make project importable from the build directory