Files
hao-ai-lab-FastVideo/docs
KyleandClaude Opus 5 43644de268 [perf]: load pipeline components on demand and free them after their last stage
A pipeline materializes every component before the first stage runs, so peak
memory is the sum of all components even though no two are needed at the same
moment. The CPU offload flags cannot help with this: they act after loading,
and on a unified-memory device moving weights to the host frees nothing because
it is the same pool.

Add lazy_module_load, off by default. Heavy components become a LazyModule
proxy that loads on first use, and the pipeline installs a release hook on the
last stage that holds each one. Peak becomes the largest overlapping set
instead of the sum.

Measured on MiniMax-H3 r16, 121 GiB GB10, 1 GPU, 192x320, 4 steps. Peak CUDA
allocated is 57.7 GiB, reached during conditioning where the text encoder and
video VAE overlap. The four deferred components account for 96.3 GiB together,
which is what stays resident without the flag: text encoder 48.0, DiT 37.8,
video VAE 9.7, audio VAE 0.8. Generation completed and wrote a video.

Details worth flagging:

The release hook lives on PipelineStage.__call__, not in the pipeline stage
loop, so pipelines that override forward still free.

The proxy forwards __class__, so isinstance stays honest. A proxy answering
False to isinstance(module, FSDPModule) would take the wrong branch silently.

Self-returning methods hand back the proxy rather than the component. Stages
write self.vae = self.vae.to(device) in a dozen places; returning the component
there would replace the proxy with a reference the pipeline cannot release, and
the run would look normal while freeing nothing.

Releasing is a latency cost, never a correctness one: a released component
reloads on next access. Training keeps everything resident and warns if the
flag is set. If no stage holds a deferred component the pipeline warns rather
than silently doing nothing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 22:36:51 -07:00
..
2026-07-19 18:37:47 -07:00
2026-07-19 18:37:47 -07:00

FastVideo Documentation

This directory contains the FastVideo documentation built with MkDocs.

Build the docs locally

# Install dependencies
uv pip install -r requirements-mkdocs.txt

# Serve docs with live reload (recommended for development)
mkdocs serve

# Or build static site
mkdocs build

View the docs

Development server (with live reload)

mkdocs serve

Then open your browser to: http://127.0.0.1:8000

Static build

mkdocs build
python -m http.server -d site/

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:

uv pip compile requirements-mkdocs.in \
  -o requirements-mkdocs.txt \
  --python-platform x86_64-manylinux_2_28 \
  --python-version 3.12