Build This Doc Site#

This guide walks through building the TIRx documentation locally. Building the docs requires the Python package to be installed first; see Build from Source for instructions.

Prerequisite

  • Use the project .venv, as in Build from Source.

  • Run commands from the repository root.

  • Install the documentation tools and editable package with uv sync --no-default-groups --group docs.

  • Optional: install Doxygen if you plan to generate the C++ API reference (see Build with C++ Docs).

Interactive Build (Auto-Reload)#

Rebuild and serve the documentation locally with live reload:

uv run --no-sync sphinx-autobuild docs docs/_build/html \
  --ignore docs/reference/python/generated --ignore docs/reference/cpp/generated

Open http://127.0.0.1:8000 after the initial build completes.

One-Off Build#

Generate the HTML documentation once, with warnings treated as errors:

uv run --no-sync python -m sphinx -b html -W docs docs/_build/html

Open docs/_build/html/index.html to browse the result.

Build with C++ Docs#

Generating the C++ reference takes longer and requires Doxygen:

brew install doxygen        # macOS
sudo apt install doxygen    # Linux

The C++ reference also documents the TVM-FFI structural utilities from the 3rdparty/tvm-ffi submodule, so check it out first:

git submodule update --init 3rdparty/tvm-ffi

Set BUILD_CPP_DOCS=1 on the desired build command to enable the extra step:

# Interactive build with auto-rebuild on C++ header changes
BUILD_CPP_DOCS=1 uv run --no-sync sphinx-autobuild docs docs/_build/html \
  --ignore docs/reference/python/generated --ignore docs/reference/cpp/generated \
  --watch include

# One-off build
BUILD_CPP_DOCS=1 uv run --no-sync python -m sphinx -b html -W docs docs/_build/html

Build with Rust Docs#

The Rust API reference is the cargo doc output of the rust/ crate, copied under reference/rust/generated of the HTML output. Use Rust 1.85 or newer to avoid the Rust 1.84 rustdoc crash when documenting tvm-ffi. The crate’s build script runs tvm-tirx-config to find libtvm_tirx_compiler, so build the package first; uv run puts the helper on PATH. Set BUILD_RUST_DOCS=1 to enable the extra step:

# Interactive build with auto-rebuild on crate changes
BUILD_RUST_DOCS=1 uv run --no-sync sphinx-autobuild docs docs/_build/html \
  --ignore docs/reference/python/generated --ignore docs/reference/cpp/generated \
  --watch rust/src

# One-off build
BUILD_RUST_DOCS=1 uv run --no-sync python -m sphinx -b html -W docs docs/_build/html

Rustdoc warnings, such as a broken intra-doc link, fail the build; set RUSTDOCFLAGS to override the -D warnings default.

Cleanup#

Remove generated artifacts when they are no longer needed:

rm -rf docs/_build/
rm -rf docs/reference/python/generated
rm -rf docs/reference/cpp/generated
rm -rf rust/target/doc