PyTorch is a Python package that provides two high-level features:
- Tensor computation (like NumPy) with strong GPU acceleration
- Deep neural networks built on a tape-based autograd system
You can reuse your favorite Python packages such as NumPy, SciPy and Cython to extend PyTorch when needed.
System | 2.7 | 3.5 | 3.6 |
---|---|---|---|
Linux CPU | — | ||
Linux GPU | — | ||
Windows CPU / GPU | — | — | |
Linux (ppc64le) CPU | — | ||
Linux (ppc64le) GPU | — |
See also the ci.pytorch.org HUD.
Common
conda install numpy pyyaml mkl mkl-include setuptools cmake cffi typing
On Linux
# Add LAPACK support for the GPU if needed
conda install -c pytorch magma-cuda90 # or [magma-cuda80 | magma-cuda92 | magma-cuda100 ] depending on your cuda version
git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
On Linux
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
python setup.py install
For installation targeting gpgpu-sim,
export CUDNN_LIBRARY=<path to cudnn_static library>
export TORCH_CUDA_ARCH_LIST="<target compute capability>+PTX"
python setup.py install [--user]
if you want to install with different CUDA version(ex) /usr/local/cuda-9.0), you need to setup extra env PATH should be set because cmake look for some library depending on "which nvcc"
export CUDA_HOME=<cuda path>
export CUDNN_LIBRARY=<path to cudnn_static library>
export TORCH_CUDA_ARCH_LIST="<target compute capability>+PTX"
export PATH=<CUDA path>:$PATH
python setup.py install [--user]
On macOS
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install
To build documentation in various formats, you will need Sphinx and the readthedocs theme.
cd docs/
pip install -r requirements.txt
You can then build the documentation by running make <format>
from the
docs/
folder. Run make
to get a list of all available output formats.
Installation instructions and binaries for previous PyTorch versions may be found on our website.
Three pointers to get you started:
- Tutorials: get you started with understanding and using PyTorch
- Examples: easy to understand pytorch code across all domains
- The API Reference
- forums: discuss implementations, research, etc. https://discuss.pytorch.org
- GitHub issues: bug reports, feature requests, install issues, RFCs, thoughts, etc.
- Slack: The PyTorch Slack hosts a primary audience of moderate to experienced PyTorch users and developers for general chat, online discussions, collaboration etc. If you are a beginner looking for help, the primary medium is PyTorch Forums. If you need a slack invite, please fill this form: https://goo.gl/forms/PP1AGvNHpSaJP8to1
- newsletter: no-noise, one-way email newsletter with important announcements about pytorch. You can sign-up here: https://eepurl.com/cbG0rv
PyTorch has a 90 day release cycle (major releases). Please let us know if you encounter a bug by filing an issue.
We appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion.
If you plan to contribute new features, utility functions or extensions to the core, please first open an issue and discuss the feature with us. Sending a PR without discussion might end up resulting in a rejected PR, because we might be taking the core in a different direction than you might be aware of.
PyTorch is a community driven project with several skillful engineers and researchers contributing to it.
PyTorch is currently maintained by Adam Paszke, Sam Gross, Soumith Chintala and Gregory Chanan with major contributions coming from hundreds of talented individuals in various forms and means. A non-exhaustive but growing list needs to mention: Trevor Killeen, Sasank Chilamkurthy, Sergey Zagoruyko, Adam Lerer, Francisco Massa, Alykhan Tejani, Luca Antiga, Alban Desmaison, Andreas Kopf, James Bradbury, Zeming Lin, Yuandong Tian, Guillaume Lample, Marat Dukhan, Natalia Gimelshein, Christian Sarofeen, Martin Raison, Edward Yang, Zachary Devito.
Note: this project is unrelated to hughperkins/pytorch with the same name. Hugh is a valuable contributor in the Torch community and has helped with many things Torch and PyTorch.
PyTorch is BSD-style licensed, as found in the LICENSE file.