Overview of the Pull Request Lifecycle
Like many open source projects, PyTorch uses a workflow based on pull requests. You will create a copy of the repository in your Git branch, make your changes and test it, push those changes to your fork (origin
), and create a pull request (PR) against the official repo (upstream
).
You should have
-
Find or report a new issue to work on. If your change is minor (like fixing a typo) feel free to skip this step.
-
Create a new branch with
git fetch && git checkout -b <my-branch-name>
to start working on your change. -
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). -
Test your changes locally with
python ./test/test_torch.py
(more details). -
Review other pre-commit checks.
-
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
-
Create a new Github PR to propose changes from your fork into the official PyTorch repo.
-
Review, address comments on your PR, and initiate merge along the pull request workflow.
-
Celebrate your contributions and welcome to the PyTorch Developer community :)
- Install Prerequisites
- Fork, clone, and checkout the PyTorch source
- Install Dependencies
- Build PyTorch from source
- Tips for developing PyTorch
- PyTorch Workflow Git cheatsheet
- Overview of the Pull Request Lifecycle
- Finding Or Reporting Issues
- Pre Commit Checks
- Create a Pull Request
- Typical Pull Request Workflow
- Pull Request FAQs
- Getting Help
- Codebase structure
- Tensors, Operators, and Testing
- Autograd
- Dispatcher, Structured Kernels, and Codegen
- torch.nn
- CUDA basics
- Data (Optional)
- function transforms (Optional)