python doc auto generation (#605)

Add Python API references
This commit is contained in:
Changho Hwang
2025-08-11 10:34:29 -07:00
committed by GitHub
parent be6a941fba
commit 2eadbaf86f
9 changed files with 50 additions and 3 deletions

1
docs/.gitignore vendored
View File

@@ -1,2 +1,3 @@
doxygen/
_build/
py_api/

View File

@@ -14,7 +14,36 @@ release = "v0.7.0"
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = ["breathe", "myst_parser", "sphinxcontrib.mermaid"]
import os, sys
sys.path.insert(0, os.path.abspath("../python"))
extensions = [
"breathe",
"myst_parser",
"sphinxcontrib.mermaid",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx_autodoc_typehints",
]
autosummary_generate = True
autodoc_default_options = {
"members": True,
"inherited-members": True,
"show-inheritance": True,
}
# only mock the C-extension when using the source tree
autodoc_mock_imports = ["mscclpp._mscclpp", "sortedcontainers"]
autodoc_typehints = "description"
napoleon_google_docstring = True
napoleon_numpy_docstring = True
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable/", None),
}
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

View File

@@ -23,3 +23,4 @@ You can find the followings from this documentation.
tutorials
programming_guide
cpp_api
py_api

View File

@@ -11,3 +11,4 @@ This section provides advanced topics and best practices for using MSCCL++. It i
guide/memory-management
guide/advanced-connections
guide/cpp-examples
guide/mscclpp-dsl

10
docs/py_api.rst Normal file
View File

@@ -0,0 +1,10 @@
Python API Reference
====================
This reference organizes the MSCCL++ Python API.
.. autosummary::
:toctree: py_api
:recursive:
mscclpp

View File

@@ -177,8 +177,6 @@ mpirun -np 8 --bind-to numa --allow-run-as-root -x LD_PRELOAD=$MSCCLPP_BUILD/app
If MSCCL++ is built on AMD platforms, `libmscclpp_nccl.so` would replace the [RCCL](https://github.com/ROCm/rccl) library (i.e., `librccl.so`).
See limitations of the current NCCL over MSCCL++ from [here](design/nccl-over-mscclpp.md#limitations).
MSCCL++ also supports fallback to NCCL/RCCL collectives by adding following environment variables.
```bash
-x MSCCLPP_ENABLE_NCCL_FALLBACK=TRUE

View File

@@ -2,3 +2,4 @@ breathe
sphinx_rtd_theme
myst_parser
sphinxcontrib-mermaid
sphinx-autodoc-typehints

View File

@@ -1,6 +1,8 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""MSCCL++ Python API."""
import os
import warnings
from functools import wraps

View File

@@ -0,0 +1,4 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""MSCCL++ DSL."""