Skip to content

Commit

Permalink
doc: Fix and update doc builder (#658)
Browse files Browse the repository at this point in the history
Doc builders fail with misleading error info: `(exception: no module
named flashinfer.activation)`.

Actually importing failures are caused by missing `aot_config.py` in
`flashinfer.jit` module when building docs.
  • Loading branch information
ur4t authored Dec 13, 2024
1 parent 6dfc9d8 commit ed89d24
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
7 changes: 5 additions & 2 deletions custom_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ def build_editable(wheel_directory, config_settings=None, metadata_directory=Non
def ln(src: str, dst: str) -> None:
src: Path = root / src
dst: Path = data_dir / dst
if dst.exists() and dst.is_symlink():
dst.unlink()
if dst.exists():
if dst.is_symlink():
dst.unlink()
elif dst.is_dir():
dst.rmdir()
dst.symlink_to(src, target_is_directory=True)

ln("3rdparty/cutlass", "cutlass")
Expand Down
13 changes: 8 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import sys
from pathlib import Path

# import tlcpack_sphinx_addon
# Configuration file for the Sphinx documentation builder.
Expand All @@ -10,16 +11,18 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

sys.path.insert(0, os.path.abspath(".."))
root = Path(__file__).parents[1].resolve()
sys.path.append(str(root))
os.environ["BUILD_DOC"] = "1"
autodoc_mock_imports = ["torch", "triton"]
autodoc_mock_imports = ["torch", "triton", "flashinfer.jit.aot_config"]

project = "FlashInfer"
author = "FlashInfer Contributors"
copyright = "2023-2024, {}".format(author)
copyright = f"2023-2024, {author}"

version = "0.1.6"
release = "0.1.6"
package_version = (root / "version.txt").read_text().strip()
version = package_version
release = package_version

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ You can follow the steps below to install FlashInfer from source code:
.. code-block:: bash
cd flashinfer
python3 -m build --no-isolation --wheel
python -m build --no-isolation --wheel
ls -la dist/
.. tab:: Create wheel for AOT mode

.. code-block:: bash
cd flashinfer
TORCH_CUDA_ARCH_LIST="7.5 8.0 8.9 9.0a" FLASHINFER_ENABLE_AOT=1 python3 -m build --no-isolation --wheel
TORCH_CUDA_ARCH_LIST="7.5 8.0 8.9 9.0a" FLASHINFER_ENABLE_AOT=1 python -m build --no-isolation --wheel
ls -la dist/
C++ API
Expand Down
12 changes: 5 additions & 7 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
furo == 2024.01.29
sphinx == 7.2.6
sphinx-reredirects == 0.1.2
sphinx-tabs == 3.4.1
sphinx-toolbox == 3.4.0
sphinxcontrib-napoleon == 0.7
sphinxcontrib_httpdomain == 1.8.1
furo == 2024.8.6
sphinx == 8.1.3
sphinx-reredirects == 0.1.5
sphinx-tabs == 3.4.5
sphinx-toolbox == 3.8.1

0 comments on commit ed89d24

Please sign in to comment.