diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 56dd05bf7d0..4c46077f9db 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,6 +67,23 @@ aspects of contributing to PyTorch. Follow the instructions for [installing PyTorch from source](https://github.com/pytorch/pytorch#from-source). If you get stuck when developing PyTorch on your machine, check out the [tips and debugging](#tips-and-debugging) section below for common solutions. +### Setup the development environment + +First, you need to [fork the PyTorch project on GitHub](https://github.com/pytorch/pytorch/fork) and follow the instructions at [Connecting to GitHub with SSH](https://docs.github.com/en/authentication/connecting-to-github-with-ssh) to setup your SSH authentication credentials. + +Then clone the PyTorch project and setup the development environment: + +```bash +git clone git@github.com:/pytorch.git +cd pytorch +git remote add upstream git@github.com:pytorch/pytorch.git + +make setup-env +# Or run `make setup-env-cuda` for pre-built CUDA binaries +# Or run `make setup-env-rocm` for pre-built ROCm binaries +source venv/bin/activate # or `. .\venv\Scripts\activate` on Windows +``` + ### Tips and Debugging * If you want to have no-op incremental rebuilds (which are fast), see [Make no-op build fast](#make-no-op-build-fast) below.