diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index dd1197b4adb..fe1044f42e4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -57,6 +57,33 @@ jobs: set -eux python torch/testing/check_kernel_launches.py |& tee ${GITHUB_WORKSPACE}/cuda_kernel_launch_checks.txt + toc: + runs-on: ubuntu-18.04 + # https://github.com/actions/virtual-environments/issues/599#issuecomment-602754687 + env: + NPM_CONFIG_PREFIX: ~/.npm-global + steps: + - name: Setup Node + uses: actions/setup-node@v2 + - name: Checkout PyTorch + uses: actions/checkout@v2 + - name: Install markdown-toc + run: npm install -g markdown-toc + - name: Regenerate ToCs + run: | + set -eux + export PATH=~/.npm-global/bin:"$PATH" + for FILE in {CONTRIBUTING,README}.md; do + markdown-toc --bullets='-' -i "$FILE" + done + - name: Assert that regenerating the ToCs didn't change them + run: | + set -eux + CHANGES=$(git status --porcelain) + echo "$CHANGES" + git diff + [ -z "$CHANGES" ] + flake8-py3: runs-on: ubuntu-18.04 steps: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b3ea8f83831..6a05e0a1478 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,45 +1,48 @@ # Table of Contents -- [Table of Contents](#table-of-contents) - - [Contributing to PyTorch](#contributing-to-pytorch) - - [Developing PyTorch](#developing-pytorch) - - [Tips and Debugging](#tips-and-debugging) - - [Nightly Checkout & Pull](#nightly-checkout--pull) - - [Codebase structure](#codebase-structure) - - [Unit testing](#unit-testing) - - [Better local unit tests with pytest](#better-local-unit-tests-with-pytest) - - [Running `mypy`](#running-mypy) - - [Writing documentation](#writing-documentation) - - [Building documentation](#building-documentation) - - [Tips](#tips) - - [Building C++ Documentation](#building-c-documentation) - - [Previewing changes](#previewing-changes) - - [Submitting changes for review](#submitting-changes-for-review) - - [Adding documentation tests](#adding-documentation-tests) - - [Profiling with `py-spy`](#profiling-with-py-spy) - - [Managing multiple build trees](#managing-multiple-build-trees) - - [C++ development tips](#c-development-tips) - - [Build only what you need](#build-only-what-you-need) - - [Code completion and IDE support](#code-completion-and-ide-support) - - [Make no-op build fast](#make-no-op-build-fast) - - [Use Ninja](#use-ninja) - - [Use CCache](#use-ccache) - - [Use a faster linker](#use-a-faster-linker) - - [C++ frontend development tips](#c-frontend-development-tips) - - [GDB integration](#gdb-integration) - - [CUDA development tips](#cuda-development-tips) - - [Windows development tips](#windows-development-tips) - - [Known MSVC (and MSVC with NVCC) bugs](#known-msvc-and-msvc-with-nvcc-bugs) - - [Running clang-tidy](#running-clang-tidy) - - [Pre-commit tidy/linting hook](#pre-commit-tidylinting-hook) - - [Building PyTorch with ASAN](#building-pytorch-with-asan) - - [Getting `ccache` to work](#getting-ccache-to-work) - - [Why this stuff with `LD_PRELOAD` and `LIBASAN_RT`?](#why-this-stuff-with-ld_preload-and-libasan_rt) - - [Why LD_PRELOAD in the build function?](#why-ld_preload-in-the-build-function) - - [Why no leak detection?](#why-no-leak-detection) - - [Caffe2 notes](#caffe2-notes) - - [CI failure tips](#ci-failure-tips) - - [Which commit is used in CI?](#which-commit-is-used-in-ci) + + +- [Contributing to PyTorch](#contributing-to-pytorch) +- [Developing PyTorch](#developing-pytorch) + - [Tips and Debugging](#tips-and-debugging) +- [Nightly Checkout & Pull](#nightly-checkout--pull) +- [Codebase structure](#codebase-structure) +- [Unit testing](#unit-testing) + - [Better local unit tests with pytest](#better-local-unit-tests-with-pytest) + - [Running `mypy`](#running-mypy) +- [Writing documentation](#writing-documentation) + - [Building documentation](#building-documentation) + - [Tips](#tips) + - [Building C++ Documentation](#building-c-documentation) + - [Previewing changes](#previewing-changes) + - [Submitting changes for review](#submitting-changes-for-review) + - [Adding documentation tests](#adding-documentation-tests) +- [Profiling with `py-spy`](#profiling-with-py-spy) +- [Managing multiple build trees](#managing-multiple-build-trees) +- [C++ development tips](#c-development-tips) + - [Build only what you need](#build-only-what-you-need) + - [Code completion and IDE support](#code-completion-and-ide-support) + - [Make no-op build fast](#make-no-op-build-fast) + - [Use Ninja](#use-ninja) + - [Use CCache](#use-ccache) + - [Use a faster linker](#use-a-faster-linker) + - [C++ frontend development tips](#c-frontend-development-tips) + - [GDB integration](#gdb-integration) +- [CUDA development tips](#cuda-development-tips) +- [Windows development tips](#windows-development-tips) + - [Known MSVC (and MSVC with NVCC) bugs](#known-msvc-and-msvc-with-nvcc-bugs) +- [Running clang-tidy](#running-clang-tidy) +- [Pre-commit tidy/linting hook](#pre-commit-tidylinting-hook) +- [Building PyTorch with ASAN](#building-pytorch-with-asan) + - [Getting `ccache` to work](#getting-ccache-to-work) + - [Why this stuff with `LD_PRELOAD` and `LIBASAN_RT`?](#why-this-stuff-with-ld_preload-and-libasan_rt) + - [Why LD_PRELOAD in the build function?](#why-ld_preload-in-the-build-function) + - [Why no leak detection?](#why-no-leak-detection) +- [Caffe2 notes](#caffe2-notes) +- [CI failure tips](#ci-failure-tips) + - [Which commit is used in CI?](#which-commit-is-used-in-ci) + + ## Contributing to PyTorch diff --git a/README.md b/README.md index eb9fdacc9fb..bba0831825b 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,36 @@ PyTorch is a Python package that provides two high-level features: You can reuse your favorite Python packages such as NumPy, SciPy, and Cython to extend PyTorch when needed. -- [More about PyTorch](#more-about-pytorch) + + +- [More About PyTorch](#more-about-pytorch) + - [A GPU-Ready Tensor Library](#a-gpu-ready-tensor-library) + - [Dynamic Neural Networks: Tape-Based Autograd](#dynamic-neural-networks-tape-based-autograd) + - [Python First](#python-first) + - [Imperative Experiences](#imperative-experiences) + - [Fast and Lean](#fast-and-lean) + - [Extensions Without Pain](#extensions-without-pain) - [Installation](#installation) - [Binaries](#binaries) + - [NVIDIA Jetson Platforms](#nvidia-jetson-platforms) - [From Source](#from-source) + - [Install Dependencies](#install-dependencies) + - [Get the PyTorch Source](#get-the-pytorch-source) + - [Install PyTorch](#install-pytorch) + - [Adjust Build Options (Optional)](#adjust-build-options-optional) - [Docker Image](#docker-image) + - [Using pre-built images](#using-pre-built-images) + - [Building the image yourself](#building-the-image-yourself) - [Building the Documentation](#building-the-documentation) - [Previous Versions](#previous-versions) - [Getting Started](#getting-started) +- [Resources](#resources) - [Communication](#communication) - [Releases and Contributing](#releases-and-contributing) - [The Team](#the-team) +- [License](#license) + + | System | 3.6 | 3.7 | 3.8 | | :---: | :---: | :---: | :--: |