Skip to content

Commit 0aef069

Browse files
brianjofacebook-github-bot
authored andcommitted
Adds torchrec docs
Summary: This diff adds sphinx docs build files to the torchrec github project. Reviewed By: colin2328 Differential Revision: D33901410 fbshipit-source-id: bcbce8b3346d5b56fb063d24cea5537ab9ff98e3
1 parent 20b2bff commit 0aef069

20 files changed

+914
-0
lines changed

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.https://www.sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sphinx
2+
# torch
3+
# PyTorch Theme
4+
-e git+git://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme

docs/source/conf.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
15+
16+
import pytorch_sphinx_theme
17+
18+
current_dir = os.path.dirname(__file__)
19+
target_dir = os.path.abspath(os.path.join(current_dir, "../.."))
20+
sys.path.insert(0, target_dir)
21+
print(target_dir)
22+
23+
# -- Project information -----------------------------------------------------
24+
25+
project = "TorchRec"
26+
copyright = "2022, Meta"
27+
author = "Meta"
28+
29+
# The full version, including alpha/beta/rc tags
30+
release = "0.0.1"
31+
32+
33+
# -- General configuration ---------------------------------------------------
34+
35+
# Add any Sphinx extension module names here, as strings. They can be
36+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
37+
# ones.
38+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon"]
39+
40+
# Add any paths that contain templates here, relative to this directory.
41+
templates_path = ["_templates"]
42+
43+
# List of patterns, relative to source directory, that match files and
44+
# directories to ignore when looking for source files.
45+
# This pattern also affects html_static_path and html_extra_path.
46+
exclude_patterns = []
47+
48+
49+
# -- Options for HTML output -------------------------------------------------
50+
51+
# The theme to use for HTML and HTML Help pages. See the documentation for
52+
# a list of builtin themes.
53+
#
54+
# html_theme = 'alabaster'
55+
html_theme = "pytorch_sphinx_theme"
56+
html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]
57+
58+
# Add any paths that contain custom static files (such as style sheets) here,
59+
# relative to this directory. They are copied after the builtin static files,
60+
# so a file named "default.css" will overwrite the builtin "default.css".
61+
html_static_path = ["_static"]

docs/source/index.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.. TorchRec documentation master file, created by
2+
sphinx-quickstart on Fri Jan 14 11:37:03 2022.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to the TorchRec documentation!
7+
====================================
8+
9+
TorchRec is a PyTorch domain library built to provide common
10+
sparsity & parallelism primitives needed for large-scale recommender
11+
systems (RecSys). It allows authors to train models with large
12+
embedding tables sharded across many GPUs.
13+
14+
For installation instructions, visit
15+
16+
https://github.com/pytorch/torchrec#readme
17+
18+
19+
20+
.. toctree::
21+
:maxdepth: 2
22+
:caption: Contents:
23+
24+
torchrec.rst
25+
torchrec.datasets.rst
26+
torchrec.datasets.scripts.rst
27+
torchrec.distributed.planner.rst
28+
torchrec.distributed.rst
29+
torchrec.examples.dlrm.data.rst
30+
torchrec.examples.dlrm.modules.rst
31+
torchrec.examples.dlrm.rst
32+
torchrec.examples.rst
33+
torchrec.fx.rst
34+
torchrec.models.rst
35+
torchrec.modules.rst
36+
torchrec.modules.tests.rst
37+
torchrec.optim.rst
38+
torchrec.quant.rst
39+
torchrec.sparse.rst
40+
torchrec.tests.rst
41+
42+
Indices and tables
43+
==================
44+
45+
* :ref:`genindex`
46+
* :ref:`modindex`
47+
* :ref:`search`

docs/source/torchrec.datasets.rst

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
torchrec.datasets
2+
=================
3+
4+
Subpackages
5+
-----------
6+
7+
.. toctree::
8+
:maxdepth: 4
9+
10+
torchrec.datasets.scripts
11+
torchrec.datasets.tests
12+
13+
Submodules
14+
----------
15+
16+
torchrec.datasets.criteo
17+
------------------------
18+
19+
.. automodule:: torchrec.datasets.criteo
20+
:members:
21+
:undoc-members:
22+
:show-inheritance:
23+
24+
torchrec.datasets.movielens
25+
---------------------------
26+
27+
.. automodule:: torchrec.datasets.movielens
28+
:members:
29+
:undoc-members:
30+
:show-inheritance:
31+
32+
torchrec.datasets.random
33+
------------------------
34+
35+
.. automodule:: torchrec.datasets.random
36+
:members:
37+
:undoc-members:
38+
:show-inheritance:
39+
40+
torchrec.datasets.utils
41+
-----------------------
42+
43+
.. automodule:: torchrec.datasets.utils
44+
:members:
45+
:undoc-members:
46+
:show-inheritance:
47+
48+
Module contents
49+
---------------
50+
51+
.. automodule:: torchrec.datasets
52+
:members:
53+
:undoc-members:
54+
:show-inheritance:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
torchrec.datasets.scripts
2+
=========================
3+
4+
Submodules
5+
----------
6+
7+
torchrec.datasets.scripts.preprocess\_criteo
8+
--------------------------------------------
9+
10+
.. automodule:: torchrec.datasets.scripts.preprocess_criteo
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
Module contents
16+
---------------
17+
18+
.. automodule:: torchrec.datasets.scripts
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
torchrec.distributed.planner
2+
============================
3+
4+
Submodules
5+
----------
6+
7+
torchrec.distributed.planner.constants
8+
--------------------------------------
9+
10+
.. automodule:: torchrec.distributed.planner.constants
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
torchrec.distributed.planner.enumerators
16+
----------------------------------------
17+
18+
.. automodule:: torchrec.distributed.planner.enumerators
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
torchrec.distributed.planner.partitioners
24+
-----------------------------------------
25+
26+
.. automodule:: torchrec.distributed.planner.partitioners
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
31+
torchrec.distributed.planner.perf\_models
32+
-----------------------------------------
33+
34+
.. automodule:: torchrec.distributed.planner.perf_models
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:
38+
39+
torchrec.distributed.planner.planners
40+
-------------------------------------
41+
42+
.. automodule:: torchrec.distributed.planner.planners
43+
:members:
44+
:undoc-members:
45+
:show-inheritance:
46+
47+
torchrec.distributed.planner.proposers
48+
--------------------------------------
49+
50+
.. automodule:: torchrec.distributed.planner.proposers
51+
:members:
52+
:undoc-members:
53+
:show-inheritance:
54+
55+
torchrec.distributed.planner.shard\_estimators
56+
----------------------------------------------
57+
58+
.. automodule:: torchrec.distributed.planner.shard_estimators
59+
:members:
60+
:undoc-members:
61+
:show-inheritance:
62+
63+
torchrec.distributed.planner.stats
64+
----------------------------------
65+
66+
.. automodule:: torchrec.distributed.planner.stats
67+
:members:
68+
:undoc-members:
69+
:show-inheritance:
70+
71+
torchrec.distributed.planner.storage\_reservations
72+
--------------------------------------------------
73+
74+
.. automodule:: torchrec.distributed.planner.storage_reservations
75+
:members:
76+
:undoc-members:
77+
:show-inheritance:
78+
79+
torchrec.distributed.planner.types
80+
----------------------------------
81+
82+
.. automodule:: torchrec.distributed.planner.types
83+
:members:
84+
:undoc-members:
85+
:show-inheritance:
86+
87+
torchrec.distributed.planner.utils
88+
----------------------------------
89+
90+
.. automodule:: torchrec.distributed.planner.utils
91+
:members:
92+
:undoc-members:
93+
:show-inheritance:
94+
95+
Module contents
96+
---------------
97+
98+
.. automodule:: torchrec.distributed.planner
99+
:members:
100+
:undoc-members:
101+
:show-inheritance:

0 commit comments

Comments
 (0)