Skip to content

Commit 0ab590e

Browse files
authored
ver: bump version to 0.4.3
1 parent 84d1c3d commit 0ab590e

13 files changed

+72
-28
lines changed

CHANGELOG.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Added
1313

14+
### Changed
15+
16+
### Fixed
17+
18+
### Removed
19+
20+
------
21+
22+
## [0.4.3] - 2022-08-08
23+
24+
### Added
25+
26+
- Bump PyTorch version to 1.12.1 by [@XuehaiPan](https://github.com/XuehaiPan) in [#49](https://github.com/metaopt/TorchOpt/pull/49).
1427
- CPU-only build without `nvcc` requirement by [@XuehaiPan](https://github.com/XuehaiPan) in [#51](https://github.com/metaopt/TorchOpt/pull/51).
1528
- Use [`cibuildwheel`](https://github.com/pypa/cibuildwheel) to build wheels by [@XuehaiPan](https://github.com/XuehaiPan) in [#45](https://github.com/metaopt/TorchOpt/pull/45).
1629
- Use dynamic process number in CPU kernels by [@JieRen98](https://github.com/JieRen98) in [#42](https://github.com/metaopt/TorchOpt/pull/42).
@@ -61,7 +74,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6174

6275
------
6376

64-
[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.4.2...HEAD
77+
[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.4.3...HEAD
78+
[0.4.3]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.4.2...v0.4.3
6579
[0.4.2]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.4.1...v0.4.2
6680
[0.4.1]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.4.0...v0.4.1
6781
[0.4.0]: https://github.com/olivierlacan/keep-a-changelog/releases/tag/v0.4.0

CITATION.cff

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ authors:
2828
family-names: Yang
2929
affiliation: Peking University
3030
31-
version: 0.4.2
32-
date-released: "2022-07-26"
31+
version: 0.4.3
32+
date-released: "2022-08-08"
3333
license: Apache-2.0
3434
repository-code: "https://github.com/metaopt/TorchOpt"

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,20 @@ Requirements
219219
- (Optional) For visualizing computation graphs
220220
- [Graphviz](https://graphviz.org/download/) (for Linux users use `apt/yum install graphviz` or `conda install -c anaconda python-graphviz`)
221221

222-
Please follow the instructions at <https://pytorch.org> to install PyTorch in your Python environment first. Then run the following command to install TorchOpt from PyPI ([![PyPI](https://img.shields.io/pypi/v/torchopt?label=PyPI)](https://pypi.org/project/torchopt) / ![Status](https://img.shields.io/pypi/status/torchopt?label=Status)):
222+
**Please follow the instructions at <https://pytorch.org> to install PyTorch in your Python environment first.** Then run the following command to install TorchOpt from PyPI ([![PyPI](https://img.shields.io/pypi/v/torchopt?label=PyPI)](https://pypi.org/project/torchopt) / ![Status](https://img.shields.io/pypi/status/torchopt?label=Status)):
223223

224224
```bash
225225
pip3 install torchopt
226226
```
227227

228+
If the minimum version of PyTorch is not satisfied, `pip` will install/upgrade it for you. Please be careful about the `torch` build for CPU / CUDA support (e.g. `cpu`, `cu102`, `cu113`). You may need to specify the extra index URL for the `torch` package:
229+
230+
```bash
231+
pip3 install torchopt --extra-index-url https://download.pytorch.org/whl/cu116
232+
```
233+
234+
See <https://pytorch.org> for more information about installing PyTorch.
235+
228236
You can also build shared libraries from source, use:
229237

230238
```bash

conda-recipe.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ dependencies:
1717
- pip
1818

1919
# Learning
20-
- pytorch::pytorch = 1.12
20+
- pytorch::pytorch >= 1.12
2121
- pytorch::torchvision
2222
- pytorch::pytorch-mutex = *=*cuda*
2323
- pip:
24-
- functorch
24+
- functorch >= 0.2
2525
- torchviz
2626
- sphinxcontrib-katex # for documentation
2727
- jax

docs/conda-recipe.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ dependencies:
3030
- pip
3131

3232
# Learning
33-
- pytorch::pytorch = 1.12
33+
- pytorch::pytorch >= 1.12
3434
- pytorch::torchvision
3535
- pytorch::pytorch-mutex = *=*cpu*
3636
- pip:
3737
- jax[cpu] >= 0.3
38-
- functorch
38+
- functorch >= 0.2
3939
- torchviz
4040
- sphinxcontrib-katex # for documentation
4141
- tensorboard

docs/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--extra-index-url https://download.pytorch.org/whl/cpu
2-
torch == 1.12
2+
torch >= 1.12
33
torchvision
4-
functorch
4+
functorch >= 0.2
55

66
--requirement ../requirements.txt
77

docs/source/developer/contributing.rst

+13-1
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,23 @@ To build compatible **manylinux2014** (:pep:`599`) wheels for distribution, you
9595
export CUDA_VERSION="11.6" # version of `nvcc` for compilation
9696
python3 -m cibuildwheel --platform=linux --output-dir=wheelhouse --config-file=pyproject.toml
9797
98-
It will installs the CUDA compiler with ``CUDA_VERSION`` in the build container. Then build wheel binaries for all supported CPython versions. The outputs will be placed in the ``wheelhouse`` directory.
98+
It will install the CUDA compiler with ``CUDA_VERSION`` in the build container. Then build wheel binaries for all supported CPython versions. The outputs will be placed in the ``wheelhouse`` directory.
99+
100+
To build a wheel for a specific CPython version, you can use the |CIBW_BUILD|_ environment variable.
101+
For example, the following command will build a wheel for Python 3.7:
102+
103+
.. code-block:: bash
104+
105+
CIBW_BUILD="cp37*manylinux*" python3 -m cibuildwheel --platform=linux --output-dir=wheelhouse --config-file=pyproject.toml
106+
107+
You can change ``cp37*`` to ``cp310*`` to build for Python 3.10. See https://cibuildwheel.readthedocs.io/en/stable/options for more options.
99108

100109
.. |cibuildwheel| replace:: ``cibuildwheel``
101110
.. _cibuildwheel: https://github.com/pypa/cibuildwheel
102111

112+
.. |CIBW_BUILD| replace:: ``CIBW_BUILD``
113+
.. _CIBW_BUILD: https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
114+
103115
.. |docker| replace:: ``docker``
104116
.. _docker: https://www.docker.com
105117

examples/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--extra-index-url https://download.pytorch.org/whl/cu116
2-
torch == 1.12
2+
torch >= 1.12
33
torchvision
4-
functorch
4+
functorch >= 0.2
55

66
--requirement ../requirements.txt
77

pyproject.toml

+19-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Package ######################################################################
22

33
[build-system]
4-
requires = ["setuptools", "torch == 1.12", "numpy", "pybind11"]
4+
requires = ["setuptools", "torch >= 1.12", "numpy", "pybind11"]
55
build-backend = "setuptools.build_meta"
66

77
[project]
@@ -44,7 +44,7 @@ classifiers = [
4444
"Topic :: Scientific/Engineering :: Artificial Intelligence",
4545
]
4646
dependencies = [
47-
"torch == 1.12",
47+
"torch >= 1.12",
4848
"jax[cpu] >= 0.3",
4949
"numpy",
5050
"graphviz",
@@ -72,7 +72,13 @@ lint = [
7272
"cpplint",
7373
"pre-commit",
7474
]
75-
test = ['torchvision', 'functorch', 'pytest', 'pytest-cov', 'pytest-xdist']
75+
test = [
76+
'torchvision',
77+
'functorch >= 0.2',
78+
'pytest',
79+
'pytest-cov',
80+
'pytest-xdist',
81+
]
7682

7783
[tool.setuptools.packages.find]
7884
include = ["torchopt", "torchopt.*"]
@@ -109,10 +115,11 @@ test-extras = ["test"]
109115
test-command = """
110116
SITE_PACKAGES="$(python -c 'print(__import__("sysconfig").get_path("purelib"))')"
111117
TORCH_LIB_PATH="${SITE_PACKAGES}/torch/lib"
118+
echo "LD_LIBRARY_PATH='${LD_LIBRARY_PATH}'"
112119
echo "ls ${TORCH_LIB_PATH}"; ls -lh "${TORCH_LIB_PATH}"
113120
find "${SITE_PACKAGES}/torchopt" -name "*.so" -print0 |
114121
xargs -0 -I '{}' bash -c "echo 'ldd {}'; ldd '{}'; echo 'patchelf --print-rpath {}'; patchelf --print-rpath '{}'"
115-
make -C "{project}" test || true
122+
make -C "{project}" test || exit 1
116123
TORCH_VERSION="$(python -c 'print(__import__("torch").__version__.partition("+")[0])')"
117124
TEST_TORCH_SPECS="${TEST_TORCH_SPECS:-"${DEFAULT_TEST_TORCH_SPECS}"}"
118125
for spec in ${TEST_TORCH_SPECS}; do
@@ -125,18 +132,21 @@ test-command = """
125132
xargs -0 -I '{}' bash -c "echo 'ldd {}'; ldd '{}'; echo 'patchelf --print-rpath {}'; patchelf --print-rpath '{}'"
126133
make -C "{project}" test || exit 1
127134
done
135+
rm -rf ~/.pip/cache ~/.cache/pip
128136
"""
129137

130138
[tool.cibuildwheel.linux]
131139
repair-wheel-command = """
132140
python -m pip install -r requirements.txt
133141
SITE_PACKAGES="$(python -c 'print(__import__("sysconfig").get_path("purelib"))')"
134142
TORCH_LIB_PATH="${SITE_PACKAGES}/torch/lib"
135-
export LD_LIBRARY_PATH="${TORCH_LIB_PATH}:/usr/local/cuda/lib64:/usr/local/cuda/targets/x86_64-linux/lib/stubs${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
136-
echo "ls ${TORCH_LIB_PATH}"; ls -lh "${TORCH_LIB_PATH}"
137-
python -m pip install --force-reinstall git+https://github.com/XuehaiPan/auditwheel.git@torchopt
138-
python -m auditwheel lddtree "{wheel}"
139-
python -m auditwheel repair --no-copy-site-libs --wheel-dir="{dest_dir}" "{wheel}"
143+
(
144+
export LD_LIBRARY_PATH="${TORCH_LIB_PATH}:/usr/local/cuda/lib64:/usr/local/cuda/targets/x86_64-linux/lib/stubs${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
145+
echo "ls ${TORCH_LIB_PATH}"; ls -lh "${TORCH_LIB_PATH}"
146+
python -m pip install --force-reinstall git+https://github.com/XuehaiPan/auditwheel.git@torchopt
147+
python -m auditwheel lddtree "{wheel}"
148+
python -m auditwheel repair --no-copy-site-libs --wheel-dir="{dest_dir}" "{wheel}"
149+
)
140150
"""
141151

142152
# Linter tools #################################################################

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
torch == 1.12
1+
torch >= 1.12
22
jax[cpu] >= 0.3
33
numpy
44
graphviz

tests/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--extra-index-url https://download.pytorch.org/whl/cu116
2-
torch == 1.12
2+
torch >= 1.12
33
torchvision
4-
functorch
4+
functorch >= 0.2
55

66
--requirement ../requirements.txt
77

torchopt/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
# ==============================================================================
1515
"""TorchOpt: a high-performance optimizer library built upon PyTorch."""
1616

17-
__version__ = '0.4.2'
17+
__version__ = '0.4.3'

tutorials/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--extra-index-url https://download.pytorch.org/whl/cu116
2-
torch == 1.12
2+
torch >= 1.12
33
torchvision
4-
functorch
4+
functorch >= 0.2
55

66
--requirement ../requirements.txt
77

0 commit comments

Comments
 (0)