mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Updates for correctness and readability
@ -12,7 +12,7 @@ Thank you for considering contributing to PyTorch. The contribution process for
|
||||
----
|
||||
|
||||
## All the ways to contribute
|
||||
There are many ways to contribute to the PyTorch project, and we value them all. Most open source contributors start with small improvements, and ramp up the scale of their work as they become more familiar with the project and the community.
|
||||
There are many ways to contribute to the PyTorch project, and we value them all. Most open source contributors start with small improvements, and ramp up the scale of their work as they become more familiar with the project and the community. Here are some pathways to becoming a PyTorch contributor, listed in no particular order:
|
||||
|
||||
<details>
|
||||
<summary><h3><b>Community Discussions</b></h3></summary>
|
||||
@ -36,13 +36,13 @@ We aim to produce high-quality documentation, but typos or other inaccuracies ma
|
||||
|
||||
<details>
|
||||
<summary><h3><b>Reporting Issues</b></h3></summary>
|
||||
If you happen to run into some unexpected behavior, you can help by creating an issue (if a similar one doesn't already exist on the tracker). Use the Bug Report template and supply as much information as you can, and any additional insights/guesses you might have. See <a href="Finding-or-Reporting-Issues">Finding or Reporting Issues</a> to get started.
|
||||
If you happen to run into some unexpected behavior, you can help by creating an issue (if a similar one doesn't already exist on the <a href="https://github.com/pytorch/pytorch/issues">issue list</a>). Use the Bug Report template and supply as much information as you can, and any additional insights/guesses you might have. When reporting an issue, it's helpful to narrow down the problematic behavior to a minimal reproducible example. See <a href="Finding-or-Reporting-Issues">Finding or Reporting Issues</a> to get started.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><h3><b>Reproducing Issues</b></h3></summary>
|
||||
Another valuable way to contribute is by <a href="https://github.com/pytorch/pytorch/labels/needs%20reproduction">reproducing open issues</a>. Sometimes the problematic behavior may be isolated to specific environments, repro'ing it helps developers identify the cause and troubleshoot faster.
|
||||
<summary><h3><b>Reproducing and Investigating Issues</b></h3></summary>
|
||||
Another valuable way to contribute is by <a href="https://github.com/pytorch/pytorch/labels/needs%20reproduction">reproducing open issues</a>. Sometimes the problematic behavior may be isolated to specific environments, or the reported issue is too broad. By repro'ing, you can add details about the problematic behavior, perhaps even further narrow it down towards a root cause, and offer your insights that can help developers to troubleshoot the problem.
|
||||
|
||||
</details>
|
||||
|
||||
@ -54,7 +54,7 @@ We welcome ideas for new features in PyTorch! A great way to share it with the c
|
||||
|
||||
<details>
|
||||
<summary><h3><b>Submitting Pull Requests</b></h3></summary>
|
||||
Fixing existing issues or implementing new features require changes to the codebase. We manage merging changes via Github Pull Requests. You will need to set up your developer environment, find an issue to work upon, and submit your changes for review. The <a href="#getting-started-with-pull-requests">PR guide</a> below contains resources for you to start submitting your changes to PyTorch.
|
||||
Fixing existing issues or implementing new features require changes to the codebase. We accept new code contributions via Github Pull Requests. We can't accept any changes unless you sign the <a href="https://github.com/pytorch/pytorch/issues/85559">PyTorch Contributors License Agreement</a>. You will need to set up your developer environment, find an issue to work upon, and submit your changes for review. The <a href="#getting-started-with-pull-requests">PR guide</a> below contains resources for you to start submitting your changes to PyTorch.
|
||||
|
||||
</details>
|
||||
|
||||
@ -90,8 +90,9 @@ Here are some resources that can help you contribute pull requests:
|
||||
- [Workflow docs and notes](https://github.com/pytorch/pytorch/wiki#workflow-docs)
|
||||
|
||||
### Setup the developer environment
|
||||
- [[Install Prerequisites and Dependencies|Developer Environment Setup]]
|
||||
- [[Install Prerequisites|Developer Environment Prerequisites]]
|
||||
- [[Fork, clone, and checkout the PyTorch source|Fork Clone and Checkout]]
|
||||
- [[Install Dependencies]]
|
||||
- [[Build PyTorch from source|Build-PyTorch]]
|
||||
- [[Debugging your PyTorch build|Debugging PyTorch Build]]
|
||||
- [[Tips for developing PyTorch|Development Tips]]
|
||||
|
@ -24,7 +24,9 @@ Once an issue is raised, someone from the PyTorch Triaging team will take a look
|
||||
|
||||
<!-- Source: https://github.com/pytorch/pytorch/wiki/%5BDraft%5D-The-PyTorch-Contribution-Process#contributing-faq -->
|
||||
|
||||
Absolutely not. Nor do we "lock" issues and only allow a single person to work
|
||||
No, but please leave a note on the issue when working on it so others are aware.
|
||||
|
||||
We don't "lock" issues and only allow a single person to work
|
||||
on them. Even if an issue is assigned you are free to work on it and submit a
|
||||
pull request for it. If there are multiple pull requests addressing the same
|
||||
issue then the one that is the highest quality (or that came first, if multiple
|
||||
|
@ -10,21 +10,23 @@ You should have
|
||||
|
||||
1. [Find or report](Finding-Or-Reporting-Issues) a new issue to work on. If your change is minor (like fixing a typo) feel free to skip this step.
|
||||
|
||||
1. Create a new branch with `git fetch && git checkout -b <my-branch-name> 'viable/strict'` ([more details on 'viable/strict'](https://github.com/pytorch/pytorch/wiki/PyTorch-Basics#use-viablestrict)).
|
||||
2. Create a new branch with `git fetch && git checkout -b <my-branch-name>` to start working on your change.
|
||||
|
||||
3. Make changes locally to the code. Whether you're working on a new feature or a bug fix, always consider adding tests for your changes (using the `unittest` framework).
|
||||
|
||||
1. Make changes locally to the code.
|
||||
4. Test your changes locally with `python ./test/test_torch.py` ([more details](Running-and-writing-tests)).
|
||||
|
||||
5. Review other [pre-commit checks](Pre-Commit-Checks).
|
||||
|
||||
1. Test your changes locally with `python ./test/test_torch.py` ([more details](Running-and-writing-tests)) and review other [pre-commit checks](Pre-Commit-Checks).
|
||||
|
||||
1. Push changes to your fork `git push`
|
||||
6. Push changes to your fork `git push`
|
||||
- If your changes are tracking an older version of PyTorch, rebase and push
|
||||
```
|
||||
git pull --rebase upstream viable/strict
|
||||
git push -f
|
||||
```
|
||||
|
||||
1. [Create a new Github PR](Create-a-Pull-Request) to propose changes from your fork into the official PyTorch repo.
|
||||
7. [Create a new Github PR](Create-a-Pull-Request) to propose changes from your fork into the official PyTorch repo.
|
||||
|
||||
1. Review, address comments on your PR, and initiate merge along the [[pull request workflow|Typical Pull Request Workflow]].
|
||||
8. Review, address comments on your PR, and initiate merge along the [[pull request workflow|Typical Pull Request Workflow]].
|
||||
|
||||
1. Celebrate your contributions and welcome to the PyTorch Developer community :)
|
||||
9. Celebrate your contributions and welcome to the PyTorch Developer community :)
|
@ -1,8 +1,8 @@
|
||||
Source: https://github.com/pytorch/pytorch#from-source
|
||||
|
||||
|
||||
<!-- Source: https://github.com/pytorch/pytorch#from-source -->
|
||||
<!-- TODO: When should we use build/install instead of develop? -->
|
||||
|
||||
Pull requests for simple fixes DO NOT require a local build of PyTorch. You will likely need to build from source (the steps below) for more involved contributions, for example changes that touch native code (C++, CUDA, ObjectiveC, Vulkan, etc.)
|
||||
|
||||
## Install from Source
|
||||
Now that you have the source code, you can build PyTorch on your development machine. Note that the steps might be different depending on your machine's platform.
|
||||
|
||||
|
29
setup/Developer-Environment-Prerequisites.md
Normal file
29
setup/Developer-Environment-Prerequisites.md
Normal file
@ -0,0 +1,29 @@
|
||||
This wiki lists the steps for setting up a developer environment to contribute code changes to PyTorch.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
<!-- Source: https://github.com/pytorch/pytorch#prerequisites -->
|
||||
|
||||
To develop PyTorch you will need:
|
||||
- Python 3.8 or later (for Linux, Python 3.8.1+ is needed)
|
||||
- A C++17 compatible compiler, such as clang
|
||||
|
||||
### (optional) CUDA Support
|
||||
If you want to compile with CUDA support, install the following (note that CUDA is not supported on macOS)
|
||||
- [NVIDIA CUDA](https://developer.nvidia.com/cuda-downloads) 11.0 or above
|
||||
- [NVIDIA cuDNN](https://developer.nvidia.com/cudnn) v8 or above
|
||||
- [Compiler](https://gist.github.com/ax3l/9489132) compatible with CUDA
|
||||
|
||||
Note: You could refer to the [cuDNN Support Matrix](https://docs.nvidia.com/deeplearning/cudnn/pdf/cuDNN-Support-Matrix.pdf) for cuDNN versions with the various supported CUDA, CUDA driver and NVIDIA hardware
|
||||
|
||||
### (optional) ROCm Support
|
||||
If you want to compile with ROCm support, install
|
||||
- [AMD ROCm](https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html) 4.0 and above installation
|
||||
- ROCm is currently supported only for Linux systems.
|
||||
|
||||
|
||||
|
||||
----
|
||||
|
||||
## Next Steps
|
||||
* [[Fork, clone, and checkout the PyTorch source|Fork Clone and Checkout]]
|
@ -1,72 +0,0 @@
|
||||
This wiki lists the steps for setting up a developer environment to contribute code changes to PyTorch.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
<!-- Source: https://github.com/pytorch/pytorch#prerequisites -->
|
||||
|
||||
To develop PyTorch you will need:
|
||||
- Python 3.8 or later (for Linux, Python 3.8.1+ is needed)
|
||||
- A C++17 compatible compiler, such as clang
|
||||
|
||||
We highly recommend installing an [Anaconda](https://www.anaconda.com/distribution/#download-section) environment. You will get a high-quality BLAS library (MKL) and you get controlled dependency versions regardless of your Linux distro.
|
||||
|
||||
### CUDA Support
|
||||
If you want to compile with CUDA support, install the following (note that CUDA is not supported on macOS)
|
||||
- [NVIDIA CUDA](https://developer.nvidia.com/cuda-downloads) 11.0 or above
|
||||
- [NVIDIA cuDNN](https://developer.nvidia.com/cudnn) v8 or above
|
||||
- [Compiler](https://gist.github.com/ax3l/9489132) compatible with CUDA
|
||||
|
||||
Note: You could refer to the [cuDNN Support Matrix](https://docs.nvidia.com/deeplearning/cudnn/pdf/cuDNN-Support-Matrix.pdf) for cuDNN versions with the various supported CUDA, CUDA driver and NVIDIA hardware
|
||||
|
||||
### ROCm Support
|
||||
If you want to compile with ROCm support, install
|
||||
- [AMD ROCm](https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html) 4.0 and above installation
|
||||
- ROCm is currently supported only for Linux systems.
|
||||
|
||||
---
|
||||
|
||||
## Install Dependencies
|
||||
|
||||
**Common**
|
||||
|
||||
```bash
|
||||
conda install cmake ninja
|
||||
# Run this command from the PyTorch directory after cloning the source code using the “Get the PyTorch Source“ section below
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
**On Linux**
|
||||
|
||||
```bash
|
||||
conda install mkl mkl-include
|
||||
# CUDA only: Add LAPACK support for the GPU if needed
|
||||
conda install -c pytorch magma-cuda110 # or the magma-cuda* that matches your CUDA version from https://anaconda.org/pytorch/repo
|
||||
|
||||
# (optional) If using torch.compile with inductor/triton, install the matching version of triton
|
||||
# Run from the pytorch directory after cloning
|
||||
make triton
|
||||
```
|
||||
|
||||
**On MacOS**
|
||||
|
||||
```bash
|
||||
# Add this package on intel x86 processor machines only
|
||||
conda install mkl mkl-include
|
||||
# Add these packages if torch.distributed is needed
|
||||
conda install pkg-config libuv
|
||||
```
|
||||
|
||||
**On Windows**
|
||||
|
||||
```bash
|
||||
conda install mkl mkl-include
|
||||
# Add these packages if torch.distributed is needed.
|
||||
# Distributed package support on Windows is a prototype feature and is subject to changes.
|
||||
conda install -c conda-forge libuv=1.39
|
||||
```
|
||||
|
||||
|
||||
----
|
||||
|
||||
## Next Steps
|
||||
* [[Fork, clone, and checkout the PyTorch source|Fork Clone and Checkout]]
|
@ -22,7 +22,7 @@ Fork the PyTorch repository to your Github account and create a local clone.
|
||||
Remember to always push changes to `origin` (your fork)!
|
||||
|
||||
---
|
||||
## Nightly Checkout & Pull for Python-only development
|
||||
## (optional) Nightly Checkout & Pull for Python-only development
|
||||
The `tools/nightly.py` script is provided to allow Python-only development of
|
||||
PyTorch. Choose this if you aren't changing or compiling C++ code.
|
||||
This uses `conda` and `git` to check out the nightly development
|
||||
@ -57,4 +57,4 @@ into the repo directory.
|
||||
----
|
||||
|
||||
## Next Steps
|
||||
* [[Build PyTorch from source|Build-PyTorch]]
|
||||
* [[Install-Dependencies]]
|
43
setup/Install-Dependencies.md
Normal file
43
setup/Install-Dependencies.md
Normal file
@ -0,0 +1,43 @@
|
||||
|
||||
## Common
|
||||
|
||||
```bash
|
||||
conda install cmake ninja
|
||||
# Run this command from the PyTorch directory after cloning the source code using the “Get the PyTorch Source“ section below
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## On Linux
|
||||
|
||||
```bash
|
||||
conda install mkl mkl-include
|
||||
# CUDA only: Add LAPACK support for the GPU if needed
|
||||
conda install -c pytorch magma-cuda110 # or the magma-cuda* that matches your CUDA version from https://anaconda.org/pytorch/repo
|
||||
|
||||
# (optional) If using torch.compile with inductor/triton, install the matching version of triton
|
||||
# Run from the pytorch directory after cloning
|
||||
make triton
|
||||
```
|
||||
|
||||
## On MacOS
|
||||
|
||||
```bash
|
||||
# Add this package on intel x86 processor machines only
|
||||
conda install mkl mkl-include
|
||||
# Add these packages if torch.distributed is needed
|
||||
conda install pkg-config libuv
|
||||
```
|
||||
|
||||
## On Windows
|
||||
|
||||
```bash
|
||||
conda install mkl mkl-include
|
||||
# Add these packages if torch.distributed is needed.
|
||||
# Distributed package support on Windows is a prototype feature and is subject to changes.
|
||||
conda install -c conda-forge libuv=1.39
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
## Next Steps
|
||||
* [[Build PyTorch from source|Build-PyTorch]]
|
Reference in New Issue
Block a user