Skip to content

Commit

Permalink
Adds torchrec docs
Browse files Browse the repository at this point in the history
Summary: This diff adds sphinx docs build files to the torchrec github project.

Reviewed By: colin2328

Differential Revision: D33901410

fbshipit-source-id: bcbce8b3346d5b56fb063d24cea5537ab9ff98e3
  • Loading branch information
brianjo authored and facebook-github-bot committed Feb 1, 2022
1 parent 20b2bff commit 0aef069
Show file tree
Hide file tree
Showing 20 changed files with 914 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# 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)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
4 changes: 4 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sphinx
# torch
# PyTorch Theme
-e git+git://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
61 changes: 61 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

import pytorch_sphinx_theme

current_dir = os.path.dirname(__file__)
target_dir = os.path.abspath(os.path.join(current_dir, "../.."))
sys.path.insert(0, target_dir)
print(target_dir)

# -- Project information -----------------------------------------------------

project = "TorchRec"
copyright = "2022, Meta"
author = "Meta"

# The full version, including alpha/beta/rc tags
release = "0.0.1"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = 'alabaster'
html_theme = "pytorch_sphinx_theme"
html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
47 changes: 47 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. TorchRec documentation master file, created by
sphinx-quickstart on Fri Jan 14 11:37:03 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to the TorchRec documentation!
====================================

TorchRec is a PyTorch domain library built to provide common
sparsity & parallelism primitives needed for large-scale recommender
systems (RecSys). It allows authors to train models with large
embedding tables sharded across many GPUs.

For installation instructions, visit

https://github.com/pytorch/torchrec#readme



.. toctree::
:maxdepth: 2
:caption: Contents:

torchrec.rst
torchrec.datasets.rst
torchrec.datasets.scripts.rst
torchrec.distributed.planner.rst
torchrec.distributed.rst
torchrec.examples.dlrm.data.rst
torchrec.examples.dlrm.modules.rst
torchrec.examples.dlrm.rst
torchrec.examples.rst
torchrec.fx.rst
torchrec.models.rst
torchrec.modules.rst
torchrec.modules.tests.rst
torchrec.optim.rst
torchrec.quant.rst
torchrec.sparse.rst
torchrec.tests.rst

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
54 changes: 54 additions & 0 deletions docs/source/torchrec.datasets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
torchrec.datasets
=================

Subpackages
-----------

.. toctree::
:maxdepth: 4

torchrec.datasets.scripts
torchrec.datasets.tests

Submodules
----------

torchrec.datasets.criteo
------------------------

.. automodule:: torchrec.datasets.criteo
:members:
:undoc-members:
:show-inheritance:

torchrec.datasets.movielens
---------------------------

.. automodule:: torchrec.datasets.movielens
:members:
:undoc-members:
:show-inheritance:

torchrec.datasets.random
------------------------

.. automodule:: torchrec.datasets.random
:members:
:undoc-members:
:show-inheritance:

torchrec.datasets.utils
-----------------------

.. automodule:: torchrec.datasets.utils
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: torchrec.datasets
:members:
:undoc-members:
:show-inheritance:
21 changes: 21 additions & 0 deletions docs/source/torchrec.datasets.scripts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
torchrec.datasets.scripts
=========================

Submodules
----------

torchrec.datasets.scripts.preprocess\_criteo
--------------------------------------------

.. automodule:: torchrec.datasets.scripts.preprocess_criteo
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: torchrec.datasets.scripts
:members:
:undoc-members:
:show-inheritance:
101 changes: 101 additions & 0 deletions docs/source/torchrec.distributed.planner.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
torchrec.distributed.planner
============================

Submodules
----------

torchrec.distributed.planner.constants
--------------------------------------

.. automodule:: torchrec.distributed.planner.constants
:members:
:undoc-members:
:show-inheritance:

torchrec.distributed.planner.enumerators
----------------------------------------

.. automodule:: torchrec.distributed.planner.enumerators
:members:
:undoc-members:
:show-inheritance:

torchrec.distributed.planner.partitioners
-----------------------------------------

.. automodule:: torchrec.distributed.planner.partitioners
:members:
:undoc-members:
:show-inheritance:

torchrec.distributed.planner.perf\_models
-----------------------------------------

.. automodule:: torchrec.distributed.planner.perf_models
:members:
:undoc-members:
:show-inheritance:

torchrec.distributed.planner.planners
-------------------------------------

.. automodule:: torchrec.distributed.planner.planners
:members:
:undoc-members:
:show-inheritance:

torchrec.distributed.planner.proposers
--------------------------------------

.. automodule:: torchrec.distributed.planner.proposers
:members:
:undoc-members:
:show-inheritance:

torchrec.distributed.planner.shard\_estimators
----------------------------------------------

.. automodule:: torchrec.distributed.planner.shard_estimators
:members:
:undoc-members:
:show-inheritance:

torchrec.distributed.planner.stats
----------------------------------

.. automodule:: torchrec.distributed.planner.stats
:members:
:undoc-members:
:show-inheritance:

torchrec.distributed.planner.storage\_reservations
--------------------------------------------------

.. automodule:: torchrec.distributed.planner.storage_reservations
:members:
:undoc-members:
:show-inheritance:

torchrec.distributed.planner.types
----------------------------------

.. automodule:: torchrec.distributed.planner.types
:members:
:undoc-members:
:show-inheritance:

torchrec.distributed.planner.utils
----------------------------------

.. automodule:: torchrec.distributed.planner.utils
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: torchrec.distributed.planner
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit 0aef069

Please sign in to comment.