Skip to content

Commit a484218

Browse files
authored
Fix docs (#656)
* Fix Python doc generation * Remove `ChannelTrigger` and fix `ProxyTrigger` * Fixed package versions for consistency
1 parent cbf448b commit a484218

File tree

12 files changed

+41
-82
lines changed

12 files changed

+41
-82
lines changed

.github/workflows/doc-build.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,26 @@ permissions:
1010

1111
jobs:
1212
build:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v4
1717

1818
- name: Setup Python
1919
uses: actions/setup-python@v5
2020
with:
21-
python-version: '3.10'
21+
python-version: '3.12'
2222

2323
- name: Install dependencies
2424
run: |
2525
sudo apt-get update
26-
sudo apt-get install -y doxygen graphviz
26+
sudo apt-get install -y doxygen=1.9.1-* graphviz
2727
pip install -r docs/requirements.txt
2828
2929
- name: Build docs
3030
run: |
3131
cd docs
32+
rm -rf doxygen _build py_api
3233
doxygen
3334
make html
3435
touch _build/html/.nojekyll

.github/workflows/gh-pages.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,23 @@ concurrency:
2222

2323
jobs:
2424
build:
25-
runs-on: ubuntu-latest
25+
runs-on: ubuntu-22.04
2626
steps:
2727
- name: Checkout
2828
uses: actions/checkout@v4
2929
- name: Setup python
3030
uses: actions/setup-python@v5
3131
with:
32-
python-version: '3.10'
32+
python-version: '3.12'
3333
- name: Install dependencies
3434
run: |
3535
sudo apt-get update
36-
sudo apt-get install -y doxygen graphviz
36+
sudo apt-get install -y doxygen=1.9.1-* graphviz
3737
pip install -r docs/requirements.txt
3838
- name: Build docs
3939
run: |
4040
cd docs
41+
rm -rf doxygen _build py_api
4142
doxygen
4243
make html
4344
touch _build/html/.nojekyll

.github/workflows/update-version.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

docs/Doxyfile

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,6 @@ TAB_SIZE = 2
263263

264264
ALIASES =
265265

266-
# This tag can be used to specify a number of word-keyword mappings (TCL only).
267-
# A mapping has the form "name=value". For example adding "class=itcl::class"
268-
# will allow you to use the command class in the itcl::class meaning.
269-
270-
TCL_SUBST =
271-
272266
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
273267
# only. Doxygen will then generate output that is more tailored for C. For
274268
# instance, some of the names that are used will be different. The list of all
@@ -829,10 +823,7 @@ WARN_LOGFILE =
829823
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
830824
# Note: If this tag is empty the current directory is searched.
831825

832-
INPUT = ../include/mscclpp \
833-
../README.md \
834-
quickstart.md \
835-
performance-ndmv4.md
826+
INPUT = ../include/mscclpp
836827

837828
# This tag can be used to specify the character encoding of the source files
838829
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -1030,7 +1021,7 @@ FILTER_SOURCE_PATTERNS =
10301021
# (index.html). This can be useful if you have a project on for instance GitHub
10311022
# and want to reuse the introduction page also for the doxygen output.
10321023

1033-
USE_MDFILE_AS_MAINPAGE = ../README.md
1024+
USE_MDFILE_AS_MAINPAGE =
10341025

10351026
#---------------------------------------------------------------------------
10361027
# Configuration options related to source browsing
@@ -1158,13 +1149,6 @@ CLANG_DATABASE_PATH =
11581149

11591150
ALPHABETICAL_INDEX = YES
11601151

1161-
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
1162-
# which the alphabetical index list will be split.
1163-
# Minimum value: 1, maximum value: 20, default value: 5.
1164-
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
1165-
1166-
COLS_IN_ALPHA_INDEX = 5
1167-
11681152
# In case all classes in a project start with a common prefix, all classes will
11691153
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
11701154
# can be used to specify a prefix (or a list of prefixes) that should be ignored

docs/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ help:
1717
# Catch-all target: route all unknown targets to Sphinx using the new
1818
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919
%: Makefile
20+
@cd .. && python3 -m setuptools_scm --force-write-version-files
2021
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,34 @@
33
# For the full list of built-in configuration values, see the documentation:
44
# https://www.sphinx-doc.org/en/master/usage/configuration.html
55

6+
7+
# -- Path setup --------------------------------------------------------------
8+
import sys
9+
import importlib.util
10+
from pathlib import Path
11+
12+
# Add the python package to sys.path so Sphinx can find it
13+
project_root = Path(__file__).parent.parent
14+
python_path = project_root / "python"
15+
sys.path.insert(0, str(python_path))
16+
17+
# -- Project version -----------------------------------------------------
18+
spec = importlib.util.spec_from_file_location("_version", python_path / "mscclpp" / "_version.py")
19+
version_module = importlib.util.module_from_spec(spec)
20+
spec.loader.exec_module(version_module)
21+
version = version_module.__version__
22+
623
# -- Project information -----------------------------------------------------
724
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
825

926
project = "mscclpp"
1027
copyright = "2025, MSCCL++ Team"
1128
author = "MSCCL++ Team"
12-
release = "v0.8.0"
29+
release = "v" + version
1330

1431
# -- General configuration ---------------------------------------------------
1532
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
1633

17-
import os, sys
18-
19-
sys.path.insert(0, os.path.abspath("../python"))
20-
2134
extensions = [
2235
"breathe",
2336
"myst_parser",
@@ -36,7 +49,7 @@
3649
"show-inheritance": True,
3750
}
3851
# only mock the C-extension when using the source tree
39-
autodoc_mock_imports = ["mscclpp._mscclpp", "sortedcontainers"]
52+
autodoc_mock_imports = ["mscclpp._version", "mscclpp._mscclpp", "cupy", "mpi4py", "numpy", "sortedcontainers"]
4053
autodoc_typehints = "description"
4154
napoleon_google_docstring = True
4255
napoleon_numpy_docstring = True

docs/cpp_api.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,6 @@ Channel Device Interfaces
231231
.. doxygenstruct:: mscclpp::BasePortChannelDeviceHandle
232232
:members:
233233

234-
.. doxygenunion:: mscclpp::ChannelTrigger
235-
236234
.. doxygenunion:: mscclpp::LL16Packet
237235

238236
.. doxygenunion:: mscclpp::LL8Packet
@@ -267,8 +265,7 @@ FIFO Device Interfaces
267265
.. doxygenstruct:: mscclpp::FifoDeviceHandle
268266
:members:
269267

270-
.. doxygenstruct:: mscclpp::ProxyTrigger
271-
:members:
268+
.. doxygenunion:: mscclpp::ProxyTrigger
272269

273270
.. doxygenvariable:: mscclpp::TriggerBitsFifoReserved
274271

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ You can find the followings from this documentation.
1313
- **Tutorials:** A step-by-step guide for GPU communication using MSCCL++. :doc:`🔗 <tutorials>`
1414
- **Programming Guide:** Advanced topics and best practices for using MSCCL++. :doc:`🔗 <programming_guide>`
1515
- **C++ API Reference:** Detailed documentation of the MSCCL++ C++ API. :doc:`🔗 <cpp_api>`
16+
- **Python API Reference:** Detailed documentation of the MSCCL++ Python API. :doc:`🔗 <py_api>`
1617

1718
.. toctree::
1819
:maxdepth: 1

docs/py_api.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ This reference organizes the MSCCL++ Python API.
77
:toctree: py_api
88
:recursive:
99

10-
mscclpp
10+
mscclpp.comm
11+
mscclpp.utils
12+
mscclpp.language

docs/quickstart.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ $ python3 -m pip install -r ./python/requirements_cuda12.txt
162162
$ mpirun -tag-output -np 8 python3 ./python/mscclpp_benchmark/allreduce_bench.py
163163
```
164164
165+
(nccl-benchmark)=
165166
### NCCL/RCCL Benchmark over MSCCL++
166167
167168
We implement [NCCL](https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/api.html) APIs using MSCCL++. How to use:

0 commit comments

Comments
 (0)