[docs]: modernize documentation build (#1503)

This commit is contained in:
William Lin
2026-06-28 02:02:09 -07:00
committed by GitHub
parent 16bf2eaf77
commit c4e108de78
19 changed files with 262 additions and 345 deletions
+10 -5
View File
@@ -5,15 +5,21 @@ on:
branches: [ main ]
paths:
- 'docs/**'
- 'examples/**'
- 'mkdocs.yml'
- 'requirements-mkdocs.in'
- 'requirements-mkdocs.txt'
- 'scripts/check_docs_links.py'
- '.github/workflows/infra-docs.yml'
pull_request:
branches: [ main ]
paths:
- 'docs/**'
- 'examples/**'
- 'mkdocs.yml'
- 'requirements-mkdocs.in'
- 'requirements-mkdocs.txt'
- 'scripts/check_docs_links.py'
- '.github/workflows/infra-docs.yml'
permissions:
@@ -31,6 +37,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
@@ -46,15 +54,12 @@ jobs:
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Generate docs examples
run: python docs/generate_examples.py
- name: Build documentation
run: mkdocs build
- name: Check docs links
run: python scripts/check_docs_links.py
- name: Build documentation
run: mkdocs build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
+1
View File
@@ -53,6 +53,7 @@ eggs/
# MkDocs documentation
site/
docs/getting_started/examples/
docs/examples/
docs/inference/examples/
docs/training/examples/
docs/distillation/examples/
+11
View File
@@ -37,3 +37,14 @@ Then open your browser to: http://localhost:8000
## Automatic Deployment
Documentation is automatically built and deployed to GitHub Pages when changes are pushed to the `main` branch via the `.github/workflows/infra-docs.yml` workflow.
## Update documentation dependencies
Edit `requirements-mkdocs.in`, then regenerate the pinned Linux/Python 3.12 lock file:
```bash
uv pip compile requirements-mkdocs.in \
-o requirements-mkdocs.txt \
--python-platform x86_64-manylinux_2_28 \
--python-version 3.12
```
-257
View File
@@ -1,257 +0,0 @@
# FastVideo API Reference
This page contains the complete API reference for the FastVideo library.
## fastvideo
### Modules
| Name | Description |
|------|-------------|
| [attention](#fastvideoattention) | Attention mechanisms and backends for video generation |
| [configs](#fastvideoconfigs) | Configuration classes for pipelines, models, and sampling |
| [distributed](#fastvideodistributed) | Distributed execution and communication utilities |
| [entrypoints](#fastvideoentrypoints) | Main API entry points for video generation |
| [models](#fastvideomodels) | Model implementations (transformers, VAEs, schedulers) |
| [pipelines](#fastvideopipelines) | Core pipeline classes for video diffusion |
| [training](#fastvideotraining) | Training utilities and helpers |
| [workflow](#fastvideoworkflow) | Workflow management and orchestration |
| [dataset](#fastvideodataset) | Dataset handling and preprocessing |
| [layers](#fastvideolayers) | Custom neural network layers |
| [platforms](#fastvideoplatforms) | Platform-specific implementations |
| [utils](#fastvideoutils) | Utility functions and helpers |
| [worker](#fastvideoworker) | Execution workers for video generation |
## fastvideo.attention
::: fastvideo.attention
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
show_submodules: true
heading_level: 3
## fastvideo.configs
::: fastvideo.configs
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
show_submodules: true
heading_level: 3
### Submodules
#### fastvideo.configs.pipelines
::: fastvideo.configs.pipelines
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
heading_level: 4
#### fastvideo.configs.models
::: fastvideo.configs.models
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
heading_level: 4
#### fastvideo.api.sampling_param
::: fastvideo.api.sampling_param
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
heading_level: 4
## fastvideo.distributed
::: fastvideo.distributed
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
show_submodules: true
heading_level: 3
## fastvideo.entrypoints
::: fastvideo.entrypoints
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
show_submodules: true
heading_level: 3
## fastvideo.models
::: fastvideo.models
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
show_submodules: true
heading_level: 3
### Submodules
#### fastvideo.models.registry
::: fastvideo.models.registry
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
heading_level: 4
#### fastvideo.models.loader
::: fastvideo.models.loader
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
heading_level: 4
## fastvideo.registry
::: fastvideo.registry
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
heading_level: 3
## fastvideo.pipelines
::: fastvideo.pipelines
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
show_submodules: true
heading_level: 3
### Submodules
#### fastvideo.pipelines.composed_pipeline_base
::: fastvideo.pipelines.composed_pipeline_base
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
heading_level: 4
#### fastvideo.pipelines.lora_pipeline
::: fastvideo.pipelines.lora_pipeline
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
heading_level: 4
#### fastvideo.pipelines.pipeline_batch_info
::: fastvideo.pipelines.pipeline_batch_info
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
heading_level: 4
#### fastvideo.pipelines.pipeline_registry
::: fastvideo.pipelines.pipeline_registry
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
heading_level: 4
#### fastvideo.pipelines.stages
::: fastvideo.pipelines.stages
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
heading_level: 4
## fastvideo.training
::: fastvideo.training
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
show_submodules: true
heading_level: 3
## fastvideo.workflow
::: fastvideo.workflow
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
show_submodules: true
heading_level: 3
## fastvideo.dataset
::: fastvideo.dataset
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
show_submodules: true
heading_level: 3
## fastvideo.layers
::: fastvideo.layers
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
show_submodules: true
heading_level: 3
## fastvideo.platforms
::: fastvideo.platforms
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
show_submodules: true
heading_level: 3
## fastvideo.utils
::: fastvideo.utils
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
heading_level: 3
## fastvideo.worker
::: fastvideo.worker
options:
show_source: true
show_root_heading: true
show_root_toc_entry: true
show_submodules: true
heading_level: 3
+29
View File
@@ -0,0 +1,29 @@
# FastVideo API Reference
FastVideo exposes a small public API for loading pipelines and generating media.
The detailed package reference is generated automatically from the source code.
## Core API
- [`fastvideo.VideoGenerator`][] loads a pipeline and provides the high-level
generation interface.
- [`fastvideo.PipelineConfig`][] describes the components required by a pipeline.
- [`fastvideo.SamplingParam`][] contains generation-time sampling parameters.
## Package Reference
- [API contracts and sampling][fastvideo.api]
- [Configuration][fastvideo.configs]
- [Models][fastvideo.models]
- [Pipelines][fastvideo.pipelines]
- [Training][fastvideo.train]
- [Distributed runtime][fastvideo.distributed]
- [Attention backends][fastvideo.attention]
- [Layers][fastvideo.layers]
- [Entrypoints][fastvideo.entrypoints]
## Guides
- [V1 API](../getting_started/v1_api.md)
- [Inference quick start](../inference/inference_quick_start.md)
- [Training overview](../training/overview.md)
-27
View File
@@ -1,27 +0,0 @@
# API Summary
This page provides a quick overview of the main FastVideo API components.
## Video Generator
::: fastvideo.VideoGenerator
options:
show_root_heading: false
show_source: false
heading_level: 3
## Initialization Configuration
::: fastvideo.PipelineConfig
options:
show_root_heading: false
show_source: false
heading_level: 3
## Sampling Configuration
::: fastvideo.SamplingParam
options:
show_root_heading: false
show_source: false
heading_level: 3
+4 -5
View File
@@ -252,11 +252,10 @@ pushes to `main`, it also deploys the built site to GitHub Pages.
The docs job:
1. Installs MkDocs dependencies.
2. Runs `python docs/generate_examples.py`.
3. Runs `python scripts/check_docs_links.py`.
4. Runs `mkdocs build`.
5. Uploads the Pages artifact and deploys only from `main`.
1. Installs the pinned MkDocs dependencies.
2. Runs `mkdocs build`; the native MkDocs hook generates example pages before the build.
3. Runs `python scripts/check_docs_links.py` against the generated documentation.
4. Uploads the Pages artifact and deploys only from `main`.
### Docker Images
+1 -1
View File
@@ -2,7 +2,7 @@
This guide is for contributors adding new evaluation metrics to
FastVideo's eval suite. To run the existing metrics, see
[`fastvideo/eval/README.md`](../../fastvideo/eval/README.md).
[`fastvideo/eval/README.md`](https://github.com/hao-ai-lab/FastVideo/blob/main/fastvideo/eval/README.md).
## When to use this guide
+3 -3
View File
@@ -48,7 +48,7 @@ highest first:
`request.model_fields_set` (Pydantic v2). Unset fields do not count,
even if the Pydantic model has a schema default for them.
2. **`ServeConfig.default_request` (operator-explicit)** — projected via
[`explicit_request_updates()`](../../../fastvideo/api/compat.py);
[`explicit_request_updates()`](https://github.com/hao-ai-lab/FastVideo/blob/main/fastvideo/api/compat.py);
only fields the operator actually wrote into the YAML count as
defaults. Every other field inherits the schema default rather than
being pinned.
@@ -58,7 +58,7 @@ The gate matters: both surfaces carry schema defaults. Without
`model_fields_set` / explicit-path tracking, schema defaults would
masquerade as intent and silently shadow the other side.
See [`video_api.py::_build_generation_kwargs`](../../../fastvideo/entrypoints/openai/video_api.py)
See [`video_api.py::_build_generation_kwargs`](https://github.com/hao-ai-lab/FastVideo/blob/main/fastvideo/entrypoints/openai/video_api.py)
for the canonical implementation; the per-request assembly lives there,
not in pipeline code.
@@ -82,7 +82,7 @@ Shape:
Payload is always JSON-serializable. Large tensors may live in an
opaque blob-store reference the client simply round-trips; see
[`LTX2ContinuationState`](../../../fastvideo/pipelines/basic/ltx2/continuation.py).
[`LTX2ContinuationState`](https://github.com/hao-ai-lab/FastVideo/blob/main/fastvideo/pipelines/basic/ltx2/continuation.py).
Continuation is not yet wired all the way through to
`generator.generate_video(...)` — PR 7.6 (GPU pool upstream) is the
-13
View File
@@ -1,13 +0,0 @@
# 💡 Examples
A collection of examples demonstrating usage of FastVideo.
All documented examples are autogenerated using [generate_examples.py](https://github.com/hao-ai-lab/FastVideo/blob/main/docs/generate_examples.py) from examples found in the [examples](https://github.com/hao-ai-lab/FastVideo/tree/main/examples) directory.
## Examples
- [Examples Distillation Index](../distillation/examples/examples_distillation_index.md)
- [Examples Training Index](../training/examples/examples_training_index.md)
- [Examples Inference Index](../inference/examples/examples_inference_index.md)
- [Train](train.md)
+16 -2
View File
@@ -12,6 +12,13 @@ ROOT_DIR_RELATIVE = '../..'
EXAMPLE_DIR = ROOT_DIR / "examples"
EXAMPLE_DOC_DIR = ROOT_DIR / "docs/getting_started/examples"
GITHUB_REPO = "hao-ai-lab/FastVideo" # Update this to your repo
GENERATED_DOC_PREFIXES = (
"examples/",
"getting_started/examples/",
"inference/examples/",
"training/examples/",
"distillation/examples/",
)
def fix_case(text: str) -> str:
@@ -524,16 +531,23 @@ def generate_examples(generate_main_index: bool = False) -> None:
f.write(examples_index.generate())
def on_pre_build_hook(config, **kwargs):
def on_pre_build(config, **kwargs):
"""
MkDocs hook to generate examples before building the documentation.
This function is called automatically by the mkdocs-simple-hooks plugin.
This function is called automatically by MkDocs' native hook system.
"""
print("Generating example documentation...")
generate_examples(generate_main_index=True)
print("Example documentation generated successfully!")
def on_page_context(context, page, **kwargs):
"""Hide repository edit actions for pages that only exist at build time."""
if page.file.src_uri.startswith(GENERATED_DOC_PREFIXES):
page.edit_url = None
return context
if __name__ == "__main__":
print("Generating example documentation...")
generate_examples(generate_main_index=True)
+1 -1
View File
@@ -591,5 +591,5 @@ fastvideo/train/
rationale, model/method abstractions, and open questions.
- [Training Overview](overview.md) — data requirements and preprocessing.
- [Data Preprocessing](data_preprocess.md) — how to prepare datasets.
- [Config Reference](../../examples/train/configs/example.yaml) — fully-commented
- [Config Reference](https://github.com/hao-ai-lab/FastVideo/blob/main/examples/train/configs/example.yaml) — fully-commented
YAML config with all fields and defaults.
View File
View File
+47 -17
View File
@@ -1,10 +1,14 @@
site_name: FastVideo
site_description: A unified inference and post-training framework for accelerated video generation
site_author: FastVideo Team
site_url: http://127.0.0.1:8000/
site_url: https://haoailab.com/FastVideo/
# Documentation directory
docs_dir: docs
exclude_docs: |
README.md
generate_examples.py
**/__pycache__/**
# Repository
repo_name: hao-ai-lab/FastVideo
@@ -16,48 +20,73 @@ theme:
name: material
favicon: assets/logos/icon_simple.svg
palette:
- scheme: default
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
- scheme: slate
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/brightness-4
name: Switch to light mode
icon: material/brightness-2
name: Switch to system preference
features:
- navigation.tabs
- content.action.edit
- content.code.annotate
- content.code.copy
- content.tabs.link
- navigation.instant
- navigation.instant.progress
- navigation.tabs
- navigation.tabs.sticky
- navigation.tracking
- navigation.top
- navigation.path
- search.highlight
- search.share
- content.tabs.link
- content.code.copy
- content.code.annotate
- toc.follow
icon:
logo: material/book-open-variant
font:
text: Roboto
code: Roboto Mono
# Native MkDocs hooks
hooks:
- docs/generate_examples.py
# Plugins
plugins:
- search:
lang: en
- mkdocs-simple-hooks:
hooks:
on_pre_build: "docs.generate_examples:on_pre_build_hook"
- autorefs
# - awesome-nav
# - glightbox
- glightbox
- git-revision-date-localized:
# exclude autogenerated files
exclude:
- examples/*
- getting_started/examples/*
- inference/examples/*
- training/examples/*
- distillation/examples/*
- minify:
minify_html: true
minify_js: true
minify_css: true
cache_safe: true
js_files: [assets/copy-page.js]
css_files: [assets/custom.css]
- api-autonav:
modules: ["fastvideo"]
api_root_uri: "api"
on_implicit_namespace_package: skip
exclude:
- "re:fastvideo\\._.*"
- "fastvideo.tests"
- "fastvideo.third_party"
- mkdocstrings:
handlers:
@@ -65,6 +94,9 @@ plugins:
paths: [.]
options:
docstring_style: google
# Avoid flooding build logs with existing API docstring lint debt.
docstring_options:
warnings: false
show_source: true
show_root_heading: true
show_root_toc_entry: true
@@ -76,7 +108,6 @@ plugins:
show_signature_annotations: true
separate_signature: true
merge_init_into_class: true
show_submodules: true
show_bases: true
show_root_full_path: false
show_root_members_full_path: false
@@ -152,7 +183,6 @@ nav:
- DMD: distillation/dmd.md
- Attention:
- Overview: attention/index.md
- Attention QAT: attention/attn_qat/index.md
- Video Sparse Attention: attention/vsa/index.md
- Sliding Tile Attention (Archived): attention/sta/index.md
- Backend Development: contributing/attention_backend.md
@@ -183,7 +213,7 @@ nav:
- Dreamverse Development: contributing/dreamverse-development.md
- Attention Backend Development: contributing/attention_backend.md
- API Reference:
- FastVideo: api/fastvideo.md
- Overview: api/index.md
# Extra
+10
View File
@@ -0,0 +1,10 @@
mkdocs<2.0.0
mkdocs-api-autonav
mkdocs-autorefs
mkdocs-git-revision-date-localized-plugin
mkdocs-glightbox
mkdocs-material
mkdocs-minify-plugin
mkdocstrings-python
mdx-truly-sane-lists
pymdown-extensions
+129 -14
View File
@@ -1,14 +1,129 @@
mkdocs-simple-hooks>=0.1.5
mkdocs-minify-plugin>=0.7.0
mkdocs>=1.5.0
mkdocs-material>=9.4.0
mkdocstrings>=0.24.0
mkdocstrings-python>=1.8.0
mkdocs-mermaid2-plugin>=1.1.0
mkdocs-git-revision-date-localized-plugin>=1.2.0
mkdocs-git-committers-plugin-2>=1.1.0
mkdocs-macros-plugin>=0.8.0
pymdown-extensions>=10.0
mkdocs-api-autonav
mkdocs-autorefs
mdx-truly-sane-lists
# This file was autogenerated by uv via the following command:
# uv pip compile requirements-mkdocs.in -o requirements-mkdocs.txt --python-platform x86_64-manylinux_2_28 --python-version 3.12
babel==2.18.0
# via
# mkdocs-git-revision-date-localized-plugin
# mkdocs-material
backrefs==7.0
# via mkdocs-material
certifi==2026.6.17
# via requests
charset-normalizer==3.4.7
# via requests
click==8.4.2
# via mkdocs
colorama==0.4.6
# via mkdocs-material
csscompressor==0.9.5
# via mkdocs-minify-plugin
ghp-import==2.1.0
# via mkdocs
gitdb==4.0.12
# via gitpython
gitpython==3.1.50
# via mkdocs-git-revision-date-localized-plugin
griffelib==2.1.0
# via mkdocstrings-python
htmlmin2==0.1.13
# via mkdocs-minify-plugin
idna==3.18
# via requests
jinja2==3.1.6
# via
# mkdocs
# mkdocs-material
# mkdocstrings
jsmin==3.0.1
# via mkdocs-minify-plugin
markdown==3.10.2
# via
# mdx-truly-sane-lists
# mkdocs
# mkdocs-autorefs
# mkdocs-material
# mkdocstrings
# pymdown-extensions
markupsafe==3.0.3
# via
# jinja2
# mkdocs
# mkdocs-autorefs
# mkdocstrings
mdx-truly-sane-lists==1.3
# via -r requirements-mkdocs.in
mergedeep==1.3.4
# via
# mkdocs
# mkdocs-get-deps
mkdocs==1.6.1
# via
# -r requirements-mkdocs.in
# mkdocs-api-autonav
# mkdocs-autorefs
# mkdocs-git-revision-date-localized-plugin
# mkdocs-material
# mkdocs-minify-plugin
# mkdocstrings
mkdocs-api-autonav==0.4.0
# via -r requirements-mkdocs.in
mkdocs-autorefs==1.4.4
# via
# -r requirements-mkdocs.in
# mkdocstrings
# mkdocstrings-python
mkdocs-get-deps==0.2.2
# via mkdocs
mkdocs-git-revision-date-localized-plugin==1.5.3
# via -r requirements-mkdocs.in
mkdocs-glightbox==0.5.2
# via -r requirements-mkdocs.in
mkdocs-material==9.7.6
# via -r requirements-mkdocs.in
mkdocs-material-extensions==1.3.1
# via mkdocs-material
mkdocs-minify-plugin==0.8.0
# via -r requirements-mkdocs.in
mkdocstrings==1.0.4
# via mkdocstrings-python
mkdocstrings-python==2.0.5
# via
# -r requirements-mkdocs.in
# mkdocs-api-autonav
packaging==26.2
# via mkdocs
paginate==0.5.7
# via mkdocs-material
pathspec==1.1.1
# via mkdocs
platformdirs==4.10.0
# via mkdocs-get-deps
pygments==2.20.0
# via mkdocs-material
pymdown-extensions==11.0
# via
# -r requirements-mkdocs.in
# mkdocs-material
# mkdocstrings
python-dateutil==2.9.0.post0
# via ghp-import
pyyaml==6.0.3
# via
# mkdocs
# mkdocs-api-autonav
# mkdocs-get-deps
# pymdown-extensions
# pyyaml-env-tag
pyyaml-env-tag==1.1
# via mkdocs
requests==2.34.2
# via mkdocs-material
selectolax==0.4.10
# via mkdocs-glightbox
six==1.17.0
# via python-dateutil
smmap==5.0.3
# via gitdb
urllib3==2.7.0
# via requests
watchdog==6.0.0
# via mkdocs