From 481838f21ba8f0f7239b12e2cc27e1bd96e135f9 Mon Sep 17 00:00:00 2001 From: Shawn Zhong Date: Thu, 21 May 2020 13:01:10 -0700 Subject: [PATCH] Sphinx parallel build (#38785) Summary: See https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-j > Distribute the build over N processes in parallel, to make building on multiprocessor machines more effective. Note that not all parts and not all builders of Sphinx can be parallelized. If auto argument is given, Sphinx uses the number of CPUs as N. - Timing results - Python doc build on a 40-core machine: 9:34 down to 1:29 - pytorch_cpp_doc_push: ~1h 10m down to 47m - pytorch_python_doc_push: 34m down to 32m Pull Request resolved: https://github.com/pytorch/pytorch/pull/38785 Differential Revision: D21691991 Pulled By: zou3519 fbshipit-source-id: cfc5e8cd13414640f82edfd2ad1ce4d9c7afce12 --- docs/Makefile | 2 +- docs/cpp/Makefile | 2 +- docs/make.bat | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 61b80ae09e56..cbe17146cd96 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -2,7 +2,7 @@ # # You can set these variables from the command line. -SPHINXOPTS = +SPHINXOPTS = -j auto SPHINXBUILD = sphinx-build SPHINXPROJ = PyTorch SOURCEDIR = source diff --git a/docs/cpp/Makefile b/docs/cpp/Makefile index 689743bbd437..00a330c754fc 100644 --- a/docs/cpp/Makefile +++ b/docs/cpp/Makefile @@ -1,7 +1,7 @@ # Minimal makefile for Sphinx documentation # You can set these variables from the command line. -SPHINXOPTS = +SPHINXOPTS = -j auto SPHINXBUILD = sphinx-build SPHINXPROJ = PyTorch SOURCEDIR = source diff --git a/docs/make.bat b/docs/make.bat index aa4a7a414126..fde7f1fdeaaf 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -10,6 +10,7 @@ if "%SPHINXBUILD%" == "" ( set SOURCEDIR=source set BUILDDIR=build set SPHINXPROJ=PyTorch +set SPHINXOPTS=-j auto if "%1" == "" goto help