From 840e761c346b4600f5f46fe59f0fc513a237521d Mon Sep 17 00:00:00 2001 From: Suraj Subramanian Date: Fri, 28 Jul 2023 16:21:13 -0400 Subject: [PATCH] Updates for correctness and readability --- ...Ultimate-Guide-to-PyTorch-Contributions.md | 13 ++-- pr-process/Finding-Or-Reporting-Issues.md | 4 +- .../Overview-of-the-Pull-Request-Lifecycle.md | 18 ++--- setup/Build-PyTorch.md | 6 +- setup/Developer-Environment-Prerequisites.md | 29 ++++++++ setup/Developer-Environment-Setup.md | 72 ------------------- setup/Fork-Clone-and-Checkout.md | 4 +- setup/Install-Dependencies.md | 43 +++++++++++ 8 files changed, 97 insertions(+), 92 deletions(-) create mode 100644 setup/Developer-Environment-Prerequisites.md delete mode 100644 setup/Developer-Environment-Setup.md create mode 100644 setup/Install-Dependencies.md diff --git a/The-Ultimate-Guide-to-PyTorch-Contributions.md b/The-Ultimate-Guide-to-PyTorch-Contributions.md index f4c40be..59df56d 100644 --- a/The-Ultimate-Guide-to-PyTorch-Contributions.md +++ b/The-Ultimate-Guide-to-PyTorch-Contributions.md @@ -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:

Community Discussions

@@ -36,13 +36,13 @@ We aim to produce high-quality documentation, but typos or other inaccuracies ma

Reporting Issues

-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 Finding or Reporting Issues 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 issue list). 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 Finding or Reporting Issues to get started.
-

Reproducing Issues

-Another valuable way to contribute is by reproducing open issues. Sometimes the problematic behavior may be isolated to specific environments, repro'ing it helps developers identify the cause and troubleshoot faster. +

Reproducing and Investigating Issues

+Another valuable way to contribute is by reproducing open issues. 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.
@@ -54,7 +54,7 @@ We welcome ideas for new features in PyTorch! A great way to share it with the c

Submitting Pull Requests

-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 PR guide 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 PyTorch Contributors License Agreement. You will need to set up your developer environment, find an issue to work upon, and submit your changes for review. The PR guide below contains resources for you to start submitting your changes to PyTorch.
@@ -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]] diff --git a/pr-process/Finding-Or-Reporting-Issues.md b/pr-process/Finding-Or-Reporting-Issues.md index bb2f9ee..ed2d21c 100644 --- a/pr-process/Finding-Or-Reporting-Issues.md +++ b/pr-process/Finding-Or-Reporting-Issues.md @@ -24,7 +24,9 @@ Once an issue is raised, someone from the PyTorch Triaging team will take a look -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 diff --git a/pr-process/Overview-of-the-Pull-Request-Lifecycle.md b/pr-process/Overview-of-the-Pull-Request-Lifecycle.md index 22cad6e..789a884 100644 --- a/pr-process/Overview-of-the-Pull-Request-Lifecycle.md +++ b/pr-process/Overview-of-the-Pull-Request-Lifecycle.md @@ -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 '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 ` 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 :) \ No newline at end of file +9. Celebrate your contributions and welcome to the PyTorch Developer community :) \ No newline at end of file diff --git a/setup/Build-PyTorch.md b/setup/Build-PyTorch.md index 6206900..3582826 100644 --- a/setup/Build-PyTorch.md +++ b/setup/Build-PyTorch.md @@ -1,8 +1,8 @@ -Source: https://github.com/pytorch/pytorch#from-source - - + +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. diff --git a/setup/Developer-Environment-Prerequisites.md b/setup/Developer-Environment-Prerequisites.md new file mode 100644 index 0000000..3774bbf --- /dev/null +++ b/setup/Developer-Environment-Prerequisites.md @@ -0,0 +1,29 @@ +This wiki lists the steps for setting up a developer environment to contribute code changes to 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]] diff --git a/setup/Developer-Environment-Setup.md b/setup/Developer-Environment-Setup.md deleted file mode 100644 index bd4bc00..0000000 --- a/setup/Developer-Environment-Setup.md +++ /dev/null @@ -1,72 +0,0 @@ -This wiki lists the steps for setting up a developer environment to contribute code changes to 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]] diff --git a/setup/Fork-Clone-and-Checkout.md b/setup/Fork-Clone-and-Checkout.md index fd3f65f..9a1e4fa 100644 --- a/setup/Fork-Clone-and-Checkout.md +++ b/setup/Fork-Clone-and-Checkout.md @@ -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]] \ No newline at end of file +* [[Install-Dependencies]] \ No newline at end of file diff --git a/setup/Install-Dependencies.md b/setup/Install-Dependencies.md new file mode 100644 index 0000000..6c2a692 --- /dev/null +++ b/setup/Install-Dependencies.md @@ -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]] \ No newline at end of file