Skip to content

Commit 28eb1d8

Browse files
cyx-6yzh119
andauthored
Fix sphinx error (#1380)
<!-- .github/pull_request_template.md --> ## 📌 Description <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### ✅ Pre-commit Checks - [x] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [x] I have installed the hooks with `pre-commit install`. - [x] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## 🧪 Tests - [x] Tests have been added or updated as needed. - [x] All tests are passing (`unittest`, etc.). ## Reviewer Notes <!-- Optional: anything you'd like reviewers to focus on, concerns, etc. --> --------- Co-authored-by: Yaxing Cai <[email protected]> Co-authored-by: Zihao Ye <[email protected]>
1 parent fdfe07a commit 28eb1d8

File tree

6 files changed

+18
-137
lines changed

6 files changed

+18
-137
lines changed

.github/workflows/build-doc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ jobs:
2727
with:
2828
submodules: recursive
2929

30+
- name: Setup Python
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: '3.12'
34+
3035
- name: Configuring build Environment
3136
run: |
3237
sudo apt-get update

docs/api/comm.rst

Lines changed: 0 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +0,0 @@
1-
.. _apicomm:
2-
3-
flashinfer.comm
4-
===============
5-
6-
.. currentmodule:: flashinfer.comm
7-
8-
This module provides communication primitives and utilities for distributed computing, including CUDA IPC, AllReduce operations, and memory management utilities.
9-
10-
CUDA IPC Utilities
11-
------------------
12-
13-
.. autosummary::
14-
:toctree: ../generated
15-
16-
CudaRTLibrary
17-
create_shared_buffer
18-
free_shared_buffer
19-
20-
DLPack Utilities
21-
----------------
22-
23-
.. autosummary::
24-
:toctree: ../generated
25-
26-
pack_strided_memory
27-
28-
Mapping Utilities
29-
-----------------
30-
31-
.. autosummary::
32-
:toctree: ../generated
33-
34-
Mapping
35-
36-
TensorRT-LLM AllReduce
37-
----------------------
38-
39-
Types and Enums
40-
~~~~~~~~~~~~~~~~
41-
42-
.. autosummary::
43-
:toctree: ../generated
44-
45-
AllReduceFusionOp
46-
AllReduceFusionPattern
47-
AllReduceStrategyConfig
48-
AllReduceStrategyType
49-
FP4QuantizationSFLayout
50-
51-
Core Operations
52-
~~~~~~~~~~~~~~~
53-
54-
.. autosummary::
55-
:toctree: ../generated
56-
57-
trtllm_allreduce_fusion
58-
trtllm_custom_all_reduce
59-
trtllm_moe_allreduce_fusion
60-
trtllm_moe_finalize_allreduce_fusion
61-
62-
Workspace Management
63-
~~~~~~~~~~~~~~~~~~~~
64-
65-
.. autosummary::
66-
:toctree: ../generated
67-
68-
trtllm_create_ipc_workspace_for_all_reduce
69-
trtllm_create_ipc_workspace_for_all_reduce_fusion
70-
trtllm_destroy_ipc_workspace_for_all_reduce
71-
trtllm_destroy_ipc_workspace_for_all_reduce_fusion
72-
73-
Initialization and Utilities
74-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75-
76-
.. autosummary::
77-
:toctree: ../generated
78-
79-
trtllm_lamport_initialize
80-
trtllm_lamport_initialize_all
81-
compute_fp4_swizzled_layout_sf_size
82-
83-
vLLM AllReduce
84-
--------------
85-
86-
.. autosummary::
87-
:toctree: ../generated
88-
89-
vllm_all_reduce
90-
vllm_dispose
91-
vllm_init_custom_ar
92-
vllm_register_buffer
93-
vllm_register_graph_buffers
94-
vllm_get_graph_buffer_ipc_meta
95-
vllm_meta_size
96-
97-
MNNVL (Multi-Node NVLink)
98-
-------------------------
99-
100-
.. currentmodule:: flashinfer.comm.mnnvl
101-
102-
Core Classes
103-
~~~~~~~~~~~~
104-
105-
.. autosummary::
106-
:toctree: ../generated
107-
108-
MnnvlMemory
109-
McastGPUBuffer
110-
111-
Utility Functions
112-
~~~~~~~~~~~~~~~~~
113-
114-
.. autosummary::
115-
:toctree: ../generated
116-
117-
create_tensor_from_cuda_memory
118-
alloc_and_copy_to_cuda
119-
120-
TensorRT-LLM MNNVL AllReduce
121-
----------------------------
122-
123-
.. currentmodule:: flashinfer.comm.trtllm_mnnvl_ar
124-
125-
.. autosummary::
126-
:toctree: ../generated
127-
128-
trtllm_mnnvl_all_reduce
129-
trtllm_mnnvl_fused_allreduce_rmsnorm
130-
mpi_barrier

docs/build_docs.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/bin/bash
2+
set -eo pipefail
3+
set -x
24
echo "Building FlashInfer documentation..."
35

46
make clean
5-
make html
7+
make SPHINXOPTS='-T -v' html
68

79
# Add RunLLM widget to generated HTML files
810
echo "Adding RunLLM widget to documentation..."

docs/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import sys
3+
import warnings
34
from pathlib import Path
45

56
# import tlcpack_sphinx_addon
@@ -12,13 +13,16 @@
1213
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1314

1415
root = Path(__file__).parents[1].resolve()
15-
sys.path.append(str(root))
16+
sys.path.insert(0, str(root))
1617
os.environ["BUILD_DOC"] = "1"
1718
autodoc_mock_imports = [
1819
"torch",
1920
"triton",
2021
"flashinfer._build_meta",
2122
"cuda",
23+
"numpy",
24+
"einops",
25+
"mpi4py",
2226
]
2327

2428
project = "FlashInfer"

docs/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ FlashInfer is a library and kernel generator for Large Language Models that prov
3030
api/attention
3131
api/gemm
3232
api/fused_moe
33-
api/comm
3433
api/cascade
3534
api/sparse
3635
api/page

flashinfer/comm/cuda_ipc.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def find_loaded_library(lib_name) -> Optional[str]:
6868

6969

7070
class CudaRTLibrary:
71+
"""CudaRTLibrary"""
72+
7173
exported_functions = [
7274
# ​cudaError_t cudaSetDevice ( int device )
7375
Function("cudaSetDevice", cudaError_t, [ctypes.c_int]),
@@ -195,10 +197,6 @@ def cudaIpcOpenMemHandle(self, handle: cudaIpcMemHandle_t) -> ctypes.c_void_p:
195197
def create_shared_buffer(
196198
size_in_bytes: int, group: Optional[ProcessGroup] = None
197199
) -> List[int]:
198-
"""
199-
Creates a shared buffer and returns a list of pointers
200-
representing the buffer on all processes in the group.
201-
"""
202200
"""
203201
Creates a shared buffer and returns a list of pointers
204202
representing the buffer on all processes in the group.
@@ -228,6 +226,9 @@ def create_shared_buffer(
228226
def free_shared_buffer(
229227
pointers: List[int], group: Optional[ProcessGroup] = None
230228
) -> None:
229+
"""
230+
Frees a shared buffer.
231+
"""
231232
if group is None:
232233
group = dist.group.WORLD
233234
rank = dist.get_rank(group=group)

0 commit comments

Comments
 (0)