Skip to content

Composable send/recv interface (transport + hooks + minimal NVLink path) (#2829) #12317

Composable send/recv interface (transport + hooks + minimal NVLink path) (#2829)

Composable send/recv interface (transport + hooks + minimal NVLink path) (#2829) #12317

Workflow file for this run

name: Docs
on:
push:
branches:
- main
pull_request:
jobs:
build-docs:
if: github.repository_owner == 'meta-pytorch'
name: Build Documentation
runs-on: linux.12xlarge
container:
image: nvidia/cuda:13.2.1-cudnn-devel-ubuntu24.04
timeout-minutes: 30
steps:
- name: Setup git
shell: bash -l {0}
run: |
set -eux
apt-get update
apt-get install -y git
# git doesn't like mixed ownership, override it
chown -R root:root .
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup conda env
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
conda-version: "25.11.1"
activate-environment: test
python-version: '3.10'
auto-activate: false
- name: Verify conda environment
shell: bash -l {0}
run: |
conda info
which python
which conda
- name: Update pip
shell: bash -l {0}
run: python -m pip install --upgrade pip
- name: Install pytorch
shell: bash -l {0}
run: pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu128
- name: Install Dependencies
shell: bash -l {0}
run: |
set -eux
conda install -y git
conda install -y -c conda-forge glog==0.4.0 gflags fmt
pip install cmake==3.31.6
pip install -r docs/requirements.txt
export USE_NCCL=0
export USE_NCCLX=0
export USE_TRANSPORT=0
export USE_SYSTEM_LIBS=1
pip install --no-build-isolation .[dev] -v
- name: Build Sphinx Docs
shell: bash -l {0}
working-directory: docs
run: |
set -eux
conda activate test
make html SPHINXOPTS="-WT --keep-going"
- name: Remove noindex meta tag from docs
working-directory: docs/build/html
run: |
# Remove the noindex meta tag from all HTML files
# This allows search engines to index the documentation
find . -name "*.html" -type f -exec sed -i '/<meta name="robots" content="noindex">/d' {} \;
- name: Upload static files as artifact
id: deployment
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/build/html/
upload:
runs-on: linux.12xlarge
permissions:
# Grant write permission here so that the doc can be pushed to gh-pages branch
contents: write
needs: build-docs
if: github.repository == 'meta-pytorch/torchcomms' && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: gh-pages
persist-credentials: true
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: docs
path: docs
- name: Move and commit changes
run: |
set -euo pipefail
# Get github.ref for the output doc folder. By default "main"
# If matches a tag like refs/tags/v1.12.0-rc3 or
# refs/tags/v1.12.0 convert to 1.12
GITHUB_REF=${{ github.ref }}
# Convert refs/tags/v1.12.0rc3 into 1.12.
# Adopted from https://github.com/pytorch/pytorch/blob/main/.github/workflows/_docs.yml#L150C11-L155C13
if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+)\.* ]]; then
TARGET_FOLDER="${BASH_REMATCH[1]}"
else
TARGET_FOLDER="main"
fi
echo "Target Folder: ${TARGET_FOLDER}"
mkdir -p "${TARGET_FOLDER}"
rm -rf "${TARGET_FOLDER}"/*
mv docs/* "${TARGET_FOLDER}"
git config user.name 'pytorchbot'
git config user.email 'soumith+bot@pytorch.org'
git add "${TARGET_FOLDER}" || true
git commit -m "auto-generating sphinx docs" || true
git push -f