mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
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
29 lines
895 B
Makefile
29 lines
895 B
Makefile
# Minimal makefile for Sphinx documentation
|
|
|
|
# You can set these variables from the command line.
|
|
SPHINXOPTS = -j auto
|
|
SPHINXBUILD = sphinx-build
|
|
SPHINXPROJ = PyTorch
|
|
SOURCEDIR = source
|
|
BUILDDIR = build
|
|
PYCMD = python
|
|
|
|
# Put it first so that "make" without argument is like "make help".
|
|
help:
|
|
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
|
|
.PHONY: help Makefile clean
|
|
|
|
clean:
|
|
@# Clean up sphinx and doxygen build artifacts.
|
|
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
@# Clean up exhale generated api.
|
|
@echo "Removing everything under generated 'source/api'..."
|
|
@rm -rf $(SOURCEDIR)/api
|
|
|
|
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
%: Makefile
|
|
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
|