pytorch
pytorch copied to clipboard
Support Python 3.11
Currently Python 3.11 isn't fully supported in Pytorch yet, including testing in CI and publishing wheels to PyPI.
Python 3.11 is currently in Release Candidate state and will be released in about two weeks. Major packages like NumPy, Pandas, SciPy and Matplotlib have already uploaded their Python 3.11 wheels to PyPI.
Python 3.11 new features include:
- PEP 657 -- Include Fine-Grained Error Locations in Tracebacks
- PEP 654 -- Exception Groups and except*
- PEP 673 -- Self Type
- PEP 646-- Variadic Generics
- PEP 680-- tomllib: Support for Parsing TOML in the Standard Library
- PEP 675-- Arbitrary Literal String Type
- PEP 655-- Marking individual TypedDict items as required or potentially-missing
- bpo-46752-- Introduce task groups to asyncio
- The Faster Cpython Project is already yielding some exciting results: this version of CPython 3.11 is ~ 19% faster on the geometric mean of the PyPerformance benchmarks, compared to 3.10.0.
Pytorch is an import package in the deep learning stack, so support at release will help speed up Python 3.11 adoption.
It would be great to have full Python 3.11 support in Pytorch by the time Python 3.11.0 gets released, (expected Monday October 6th, 2022). This includes testing in CI and publishing wheels to PyPI.
This issue can be used as a tracking issue. This includes:
- [x] Pytorch builds fully on Python 3.11
- [x] All Pytorch tests pass on Python 3.11
- [x] All CI is run and green on Python 3.11
- [x] Wheels are uploaded to PyPI for at least one Pytorch release
- [x] Manylinux (x86_64)
- [x] Manylinux (aarch64)
- [x] Windows
- [x] macOS
cc @seemethere @malfet @pytorch/pytorch-dev-infra @albanD
Nightly builds of python-3.11 wheels is already published to https://download.pytorch.org/whl/nightly but CI can be tricky, in particular around JIT support (which probably needs a separate task)
I feel like the main blocker for enabling more support is that (at the time where this was added at least) conda didn't had 3.11 support. This meant that all our usual test environment couldn't be upgraded easily.
@dagitses suggests that it's probably OK to disable JIT tests and have a followup issue for supporting JIT in 3.11. Also please note that 3.11 is yet not available on Anaconda: https://anaconda.org/anaconda/python
cc @davidberard98 there will most likely be some non-trivial work needed for JIT to support this that should be planned for ahead of time.
Nightly builds of python-3.11 wheels is already published to https://download.pytorch.org/whl/nightly but CI can be tricky, in particular around JIT support (which probably needs a separate task)
Awesome! Do you know if the Python 3.11 wheels will be deployed with the v1.13 release?
conda now has 3.11 support if that is still a blocker! conda install -c conda-forge python
Yeah! Python 3.11 support please. It should be the default. Python 3.11 is between 10-60% faster than Python 3.10. On average, we measured a 1.25x speedup on the standard benchmark suite. See Faster CPython for details. https://docs.python.org/3.11/whatsnew/3.11.html https://www.phoronix.com/news/Python-3.11-Released
Yeah! Python 3.11 support please. It should be the default.
cc @malfet @atalman
conda now has 3.11 support if that is still a blocker!
conda install -c conda-forge python
conda-forge introduces a lot of instability to our CI pipelines so adding conda support should be gated on the default channels having python 3.11 support not conda-forge
Benchmark https://www.phoronix.com/review/python-311-performance
What is the status of this? Python 3.11 was released ~two weeks ago now so it would be great to have torch wheels available relatively soon for downstream projects to work with.
I would be happy with nightly versions too if a stable release will take some more time, although the current binaries are exclusively linux x86: https://download.pytorch.org/whl/nightly/torch/.
Nightly builds of python-3.11 wheels is already published to https://download.pytorch.org/whl/nightly
how do I install these?
https://conda.anaconda.org/pytorch-nightly/osx-arm64
I only see python 3.10 builds there.
conda couldn't find any 3.11-compatible pytorch build in the pytorch-nightly
channel:
conda create -n 11diffnightly -c pytorch-nightly -c defaults -c conda-forge python==3.11.0 pytorch
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
Examining pytorch:
^failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Output in format: Requested package -> Available versions
Package python conflicts for:
python==3.11.0
pytorch -> python[version='>=3.10,<3.11.0a0|>=3.10,<3.11.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0',build=*_cpython]
pytorch -> typing_extensions -> python[version='3.10.*|3.6.12|3.6.12|3.7.10|3.7.10|3.7.12|3.8.12|3.9.10|>=3.11,<3.12.0a0|>=3.11,<3.12.0a0|>=3.5|>=3.6|>=3.7|3.7.9|3.6.9|3.6.9|3.6.9|3.6.9|>=3.8|3.8.*|3.9.*',build='2_73_pypy|4_73_pypy|5_73_pypy|5_73_pypy|0_73_pypy|1_73_pypy|*_cpython|0_73_pypy|0_73_pypy|0_73_pypy|3_73_pypy|1_73_pypy|0_73_pypy']The following specifications were found to be incompatible with your system:
- feature:/osx-arm64::__osx==12.5=0
- feature:|@/osx-arm64::__osx==12.5=0
- pytorch -> __osx[version='>=11.0']
Your installed version is: 12.5
Nightly builds of python-3.11 wheels is already published to https://download.pytorch.org/whl/nightly
how do I install these?
https://conda.anaconda.org/pytorch-nightly/osx-arm64
I only see python 3.10 builds there.
conda couldn't find any 3.11-compatible pytorch build in the
pytorch-nightly
channel:conda create -n 11diffnightly -c pytorch-nightly -c defaults -c conda-forge python==3.11.0 pytorch Collecting package metadata (current_repodata.json): done Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: | Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort. Examining pytorch: ^failed UnsatisfiableError: The following specifications were found to be incompatible with each other: Output in format: Requested package -> Available versions Package python conflicts for: python==3.11.0 pytorch -> python[version='>=3.10,<3.11.0a0|>=3.10,<3.11.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0',build=*_cpython] pytorch -> typing_extensions -> python[version='3.10.*|3.6.12|3.6.12|3.7.10|3.7.10|3.7.12|3.8.12|3.9.10|>=3.11,<3.12.0a0|>=3.11,<3.12.0a0|>=3.5|>=3.6|>=3.7|3.7.9|3.6.9|3.6.9|3.6.9|3.6.9|>=3.8|3.8.*|3.9.*',build='2_73_pypy|4_73_pypy|5_73_pypy|5_73_pypy|0_73_pypy|1_73_pypy|*_cpython|0_73_pypy|0_73_pypy|0_73_pypy|3_73_pypy|1_73_pypy|0_73_pypy']The following specifications were found to be incompatible with your system: - feature:/osx-arm64::__osx==12.5=0 - feature:|@/osx-arm64::__osx==12.5=0 - pytorch -> __osx[version='>=11.0'] Your installed version is: 12.5
https://pytorch.org/blog/PyTorch-1.13-release/
okay, so Linux x86 only? thanks for the link.
if an osx-arm64 build were made available: I'd happily try it out.
Will Python 3.11 support get into the 1.13.1 milestone?
Will Python 3.11 support get into the 1.13.1 milestone?
No unfortunately not, we no longer add support for new platforms (like python) during patch releases
I wonder if someone updates it in any time, but is very needed dependency, for us all, and 3.11 is futher more fast than 3.10
I wonder if someone updates it in any time, but is very needed dependency, for us all, and 3.11 is futher more fast than 3.10
It is really bad this issue has been opened for two months but no progress.
@malfet you said
Nightly builds of python-3.11 wheels is already published to https://download.pytorch.org/whl/nightly but CI can be tricky, in particular around JIT support (which probably needs a separate task)
but in my PC
Microsoft Windows [Version 10.0.22621.963]
(c) Microsoft Corporation. All rights reserved.
C:\Users\donhu>pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu117
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)ERROR: No matching distribution found for torch
C:\Users\donhu>pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu117
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/nightly/cu117
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch
C:\Users\donhu>python --version
Python 3.11.1
C:\Users\donhu>
So tedious. As default, when Python release version 3.11.1, any library should upgrade after a little time. I am from Java world, with Spring Boot, even they have beta version for upcoming version of programming language.
Did not work even with nightly build of PyTorch.
@donhuvy
It looks like cp311 (Python 3.11) release wheel for linux is already on stable. But other platforms like windows or mac is still not supported.
We should add information about this fact of nightly version: Not run on Windows 11 x64 or Windows OS x64. It will make us avoid lost time for confusting or questions or looking for solution.
I updated the starting post to reflect that Linux x64 wheels are available for Python 3.11, but others are not.
I see there is now also a Python 3.11 milestone. Hopefully this helps keeping track of 3.11 progress.
To the Pytorch team: It would be hugely appreciated if 3.11 support could be prioritized, and if fully support for all platforms is in the Pytorch 2.0 release.
@donhuvy as a Java dev trying to install pytorch with the latest Python version available, I was also surprised to see the lack of retrocompatibility within the Python ecosystem. I was aware of the break between Python 2 and Python 3, but it seems like even minor version bumps may lead to compatibility issue. What a let down. :(
@payne911 , My advice: use old version of Python for system. For example, Google Colab pro use Python 3.8 at this time. Don't try latest version in Python eco-system. You should use Python 3.8 , 3.9 for easy and avoid error.
PyTorch nightly wheels should be available for all OSes right now, but conda package is still pending.
PyTorch nightly wheels should be available for all OSes right now, but conda package is still pending.
thanks you so much!!
@payne911 this is kind of off topic for this but I want to mention that the number of backward compatibility breaking changes in the python code itself are very low in practice. The two reasons this takes time are that it is a lot of Infra work (and in particular getting all dependencies running, including conda having a 3.11 build) and that we use bleeding edge CPython features (tightly integrated with their internal representation and C API, at this level backward compatibility is a lot more challenging and some amount of breakage is expected for the language to be able to move forward. But the number of projects impacted by these changes is really minor compared to the overal ecosystem).
PyTorch nightly wheels should be available for all OSes right now, but conda package is still pending.
Is it normal that I get this, then?
Coming from https://pytorch.org/get-started/locally/
@payne911 yes this is expected. Domain libraries don't have binaries yet.
You can remove torchvision torchaudio
from the command to make this work.
Hi, I'm not the most technical programmer, but I've been trying to install TA_lib and Numpy for a while now without success. Python --version returns 3.11.1 and pip is fully up to date. Am I doing something wrong?