From 92ac35556b3e8fa0ada48d1c980aaa5f92bb187a Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Wed, 2 Oct 2024 17:00:27 -0700 Subject: [PATCH] build-docs job builds from source (#2466) Summary: Pull Request resolved: https://github.com/pytorch/torchrec/pull/2466 Previously we build docs from nightly. Hard for us to see previews of docstring changes, here we change it to build from source. Reviewed By: svekars Differential Revision: D63784555 fbshipit-source-id: 2402fc7d31b91c9f1b7a503211c9d3e6b8f7641e --- .github/workflows/docs.yml | 4 +++- docs/source/conf.py | 3 +-- torchrec/distributed/planner/planners.py | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6651b8327..51217790e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -18,6 +18,7 @@ jobs: include: - os: linux.20_04.4x python-version: 3.9 + python-tag: "py39" steps: - name: Check ldd --version run: ldd --version @@ -66,7 +67,8 @@ jobs: conda run -n build_binary pip install torchmetrics==1.0.3 - name: Install TorchRec run: | - conda run -n build_binary pip install torchrec --index-url https://download.pytorch.org/whl/nightly/cpu + conda run -n build_binary pip install -r requirements.txt + conda run -n build_binary python setup.py bdist_wheel --python-tag=${{ matrix.python-tag }} - name: Test fbgemm_gpu and torchrec installation shell: bash run: | diff --git a/docs/source/conf.py b/docs/source/conf.py index 2e6c8f229..0f64cefe7 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -21,7 +21,6 @@ import sys import pytorch_sphinx_theme -import torchrec current_dir = os.path.dirname(__file__) target_dir = os.path.abspath(os.path.join(current_dir, "../..")) @@ -36,7 +35,7 @@ try: # pyre-ignore - version = torchrec.__version__ + version = "1.0.0" # TODO: Hardcode stable version for now except Exception: # when run internally, we don't have a version yet version = "0.0.0" diff --git a/torchrec/distributed/planner/planners.py b/torchrec/distributed/planner/planners.py index 643f291fd..ef24b4be9 100644 --- a/torchrec/distributed/planner/planners.py +++ b/torchrec/distributed/planner/planners.py @@ -156,6 +156,7 @@ class EmbeddingShardingPlanner(ShardingPlanner): debug (bool): whether to print debug information. Example:: + ebc = EmbeddingBagCollection(tables=eb_configs, device=torch.device("meta")) planner = EmbeddingShardingPlanner() plan = planner.plan(