Skip to content

Add scaffolding to build C++/Python docs#323

Open
oleksandr-pavlyk wants to merge 3 commits intoNVIDIA:mainfrom
oleksandr-pavlyk:doc-generation
Open

Add scaffolding to build C++/Python docs#323
oleksandr-pavlyk wants to merge 3 commits intoNVIDIA:mainfrom
oleksandr-pavlyk:doc-generation

Conversation

@oleksandr-pavlyk
Copy link
Collaborator

@oleksandr-pavlyk oleksandr-pavlyk commented Mar 10, 2026

Closes #324

This PR adds docs/sphinx-combined folder and docs/build_combined_docs.sh script to orchestrate use of doxygen and sphinx.

To build docs, the following steps where used to create and configure environment:

conda create -n nvbench-docs --yes python pip doxygen
conda activate nvbench-docs
pip install breathe sphinx nvidia-sphinx-theme myst-parser docutils
pip install cython scikit-build-core setuptools-scm typing-extensions cmake cuda-bindings

Then

Build Python package

cd python
rm -rf build
CUDACXX=/usr/local/cuda/bin/nvcc python -m pip install --no-build-isolation --no-deps --verbose .
cd ..

Note: Editable build is broken at the moment.

Build documentation

cd docs
./build_combined_docs.sh

View the documentation

python -m http.server 8001 --bind localhost  -d sphinx-combined/_build 

Open browser and navigate to http://127.0.0.1:8001/ to view rendered documentation.

Add sphinx-combined folder that builds combined C++ & Python docs

Fixed relative text alignment in docstrings to fix autodoc warnigns

Renamed cuda.bench.test_cpp_exception and cuda.bench.test_py_exception functions
to start with underscore, signaling that these functions are internal and should
not be documented

Account for test_cpp_exceptions -> _test_cpp_exception, same for *_py_*

Fix cpp_benchmarks, add py_benchmarks

1. Fixed xrefs in docs/sphinx-combined/cpp_benchmarks.md, which is built on top of
   docs/benchmarks.md

   Added level-1 heading, and pushed existing headings one level down.

2. Added py_benchmarks.md to document benchmarking of Python scripts.

3. Rearranged entries in index.rst so that overview documents come before
   API enumeration.

Make sure to reset __module__ of reexported symbols to be cuda.bench

Enumerate free functions in nvbench:: namespace

Tweak to index.rst intro sentence and title

Changed title, fixed references, added intro borrowed from README

Fix punctuation in one of the itemlist item text

Hide TOC from the index page. It is too long and confusing
Use miniforge to create Python environment. Install doc
dependencies, install tools needed to build Python package
for autodocs to work.

Build documentation, and publish rendered artifact in PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable generation of NVBench documentation

1 participant