Skip to content

Commit

Permalink
Merge pull request #250 from hmaarrfk/update_2.4
Browse files Browse the repository at this point in the history
Update to 2.4.0 and add libpytorch.so to lib location
  • Loading branch information
hmaarrfk authored Aug 23, 2024
2 parents b362c03 + 66d9fce commit 4314852
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/conda-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ jobs:
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
with:
miniforge-version: latest
miniforge-variant: Mambaforge
if: matrix.os == 'windows'

- name: Build on windows
Expand Down
1 change: 0 additions & 1 deletion .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .scripts/run_osx_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build-locally.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,11 @@ if [[ "$PKG_NAME" == "libtorch" ]]; then

# Keep the original backed up to sed later
cp build/CMakeCache.txt build/CMakeCache.txt.orig
else
# Keep this in ${PREFIX}/lib so that the library can be found by
# TorchConfig.cmake.
# With upstream non-split build, `libtorch_python.so`
# and TorchConfig.cmake are both in ${SP_DIR}/torch/lib and therefore
# this is not needed.
mv ${SP_DIR}/torch/lib/libtorch_python${SHLIB_EXT} ${PREFIX}/lib
fi
3 changes: 1 addition & 2 deletions recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
c_stdlib_version: # [unix]
- 2.17 # [linux]
c_stdlib_version: # [osx and x86_64]
- 10.15 # [osx and x86_64]

MACOSX_SDK_VERSION: # [osx]
Expand Down
15 changes: 10 additions & 5 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set version = "2.3.1" %}
{% set build = 1 %}
{% set version = "2.4.0" %}
{% set build = 0 %}

{% if cuda_compiler_version != "None" %}
{% set build = build + 200 %}
Expand All @@ -21,7 +21,7 @@ package:

source:
url: https://github.com/pytorch/pytorch/releases/download/v{{ version }}/pytorch-v{{ version }}.tar.gz
sha256: 6c66b59345091907cd62a693b647cee224558e7f15a9b04f4f322f4f6ffeb75b
sha256: a890d4342149adbc6c8b116a9afe437fe347527a9ecc0650086cdec82ecdcfb7
patches:
# The patch below is probably OK for other versions too, but it is untested with them
# https://github.com/conda-forge/pytorch-cpu-feedstock/pull/203#issuecomment-1797352452
Expand All @@ -34,6 +34,10 @@ source:
# https://gist.github.com/andreigh/f78f631e0039f0af410b269acbb0c8dc
- patches/0002-Use-new-nvtoolset.patch # [cuda_compiler_version == "12.0"]

# Remove in 2.4.1+
# https://github.com/pytorch/pytorch/pull/133177
- patches/133177_remove_qnnpack.patch

build:
number: {{ build }}
string: cuda{{ cuda_compiler_version | replace('.', '') }}_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"]
Expand Down Expand Up @@ -266,8 +270,8 @@ outputs:
- {{ pin_compatible('cudnn') }} # [cuda_compiler_version != "None"]
# other requirements
- python
- typing_extensions
- sympy
- typing_extensions >=4.8.0
- sympy >=1.13.1
- filelock
- jinja2
- networkx
Expand Down Expand Up @@ -317,6 +321,7 @@ outputs:
# But if users install a newer version of OSX, they will have MPS support
# https://github.com/conda-forge/pytorch-cpu-feedstock/pull/123#issuecomment-1186355073
# - python -c "import torch; assert torch.backends.mps.is_available()" # [osx]
- test -f $PREFIX/lib/libtorch_python${SHLIB_EXT} # [unix]

# 2021/08/01, hmaarrfk
# While this seems like a roundabout way of defining the package name
Expand Down
22 changes: 22 additions & 0 deletions recipe/patches/133177_remove_qnnpack.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/setup.py b/setup.py
index 9ec41cd37cd..5d1952b67b0 100644
--- a/setup.py
+++ b/setup.py
@@ -68,9 +68,6 @@
# USE_NNPACK=0
# disables NNPACK build
#
-# USE_QNNPACK=0
-# disables QNNPACK build (quantized 8-bit operators)
-#
# USE_DISTRIBUTED=0
# disables distributed (c10d, gloo, mpi, etc.) build
#
@@ -366,7 +363,6 @@ def get_submodule_folders():
"cpuinfo",
"onnx",
"foxi",
- "QNNPACK",
"fbgemm",
"cutlass",
]

0 comments on commit 4314852

Please sign in to comment.