Repository navigation
[skip ci][Misc] LVSA showcase (training-free block-sparse attention) - #4192
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Self-contained demo of training-free block-sparse attention for video diffusion on vLLM-Omni: serve_lvsa.sh (Wan/HunyuanVideo server, LVSA backend via --diffusion-attention-config), generate.py (async video client), and README. No core changes — loads via general_plugins. Signed-off-by: Gael Glorian <gael.glorian@gmail.com> Signed-off-by: Ioannis Lamprou <yiannis.lamprou@gmail.com> Signed-off-by: Zhen Zhang <zhen.zhang.fr@huawei.com> Co-authored-by: Ioannis Lamprou <yiannis.lamprou@gmail.com> Co-authored-by: Zhen Zhang <zhen.zhang.fr@huawei.com> Signed-off-by: Gael Glorian <gael.glorian@gmail.com>
|
Thanks for the feedback during the vLLM-Omni community meeting, we have pushed the requested changes: Changes
The app stays a thin, plugin-only showcase ( Visual result Here is a dense-vs-LVSA comparison on Wan 2.2 14B at 4× the training horizon (321 frames, single A100). Beyond its training length, dense attention degrades into looping/static output; LVSA's rotating-keyframe pattern keeps coherent motion — at ~2.4× the speed: Dense (base): plugin__wan14b__dense__4x__dog_forest.mp4LVSA: plugin__wan14b__flashinfer__4x__dog_forest.mp4Across the full sweep (5 prompts × 6 horizons, scored with VQeval + VBench-Long), LVSA runs ~1.4× faster at 2× → up to 3.5× at 6× (Wan 1.3B), with quality improving at extension — for this clip, VQeval composite 63.8 → 67.3 and loop-quality 45 → 65. Full numbers and methodology live in the upstream repo's |
|
@Gaohan123 @hsliuustc0106 could you please review this PR, thanks! |
|
|
||
| # 2. LVSA core + plugin | ||
| git clone https://github.com/JiusiServe/LongVideoSparseAttention.git | ||
| ( cd LongVideoSparseAttention && pip install -e . && pip install -e lvsa-vllm-omni/ ) |
There was a problem hiding this comment.
This installs the plugin without FlashInfer, but the script defaults to LVSA_BACKEND=flashinfer and the README reports LVSA-FlashInfer results. Please install the FlashInfer wheels here or default the script/docs to SDPA.
|
|
||
| echo "[lvsa-app] serving $MODEL ($MODEL_FAMILY) on :$PORT" | ||
| echo "[lvsa-app] LVSA backend=$BACKEND T_lat=$T_LAT (frames=$FRAMES) reference=$REFERENCE" | ||
| echo "[lvsa-app] confirm activation by grep '\\[LVSA\\] engaged' in this log" |
There was a problem hiding this comment.
The backend path logs [LVSA] Geometry detected, not [LVSA] engaged. This verification hint should match the path this script enables.
- README: correct VQeval loop-quality figures (+27 to +34 at ≥3×) and name the models that OOM dense on 80 GB (Wan2.1-14B and Cosmos at 6×). - README: clarify FlashInfer ships with vLLM (no extra install for the default backend); document the optional JIT-cache speedup and the SDPA fallback for environments without FlashInfer. - serve_lvsa.sh: clarify LVSA is selected via --diffusion-attention-config with LVSA_* env vars only tuning it, and update the activation log marker to "[LVSA] Geometry detected". Signed-off-by: Gael Glorian <gael.glorian@gmail.com> Signed-off-by: Ioannis Lamprou <yiannis.lamprou@gmail.com> Signed-off-by: Zhen Zhang <zhen.zhang.fr@huawei.com> Co-authored-by: Ioannis Lamprou <yiannis.lamprou@gmail.com> Co-authored-by: Zhen Zhang <zhen.zhang.fr@huawei.com> Signed-off-by: Gael Glorian <gael.glorian@gmail.com>
|
Thanks @hsliuustc0106 — both good catches, fixed. 1. FlashInfer install (README). Worth flagging, but FlashInfer is actually already present after the quickstart: 2. While here I self-audited the rest of the showcase against our sweep data and tightened a few things: corrected the Wan-1.3B loop-quality range (≥3× is ~+27 to +34), scoped the dense-OOM note to the specific models that actually OOM (HunyuanVideo ≥2×, Wan2.1-14B and Cosmos at 6× — Wan-1.3B itself runs dense fine at 6×, as the speedup row implies), and fixed two stale comments in |
…llm-project#4192) Signed-off-by: Gael Glorian <gael.glorian@gmail.com> Signed-off-by: Ioannis Lamprou <yiannis.lamprou@gmail.com> Signed-off-by: Zhen Zhang <zhen.zhang.fr@huawei.com> Co-authored-by: Ioannis Lamprou <yiannis.lamprou@gmail.com> Co-authored-by: Zhen Zhang <zhen.zhang.fr@huawei.com>
What
A self-contained showcase app for LVSA (Long-Video Sparse Attention) on vLLM-Omni. LVSA is a training-free, drop-in sparse-attention path for video diffusion transformers, each query frame attends to a few global anchors + a local window instead of full O(N²), so long-video generation gets much faster at competitive quality, with no fine-tuning and no changes to vLLM-Omni core. Plugs in via the public
vllm_omni.general_pluginsentry point, enabled per-server withLVSA_*env vars. Pairs with #3115.Results (published, single A100 80 GB, 50 steps)
Plus a Wan-14B 4× dense vs LVSA-SDPA vs LVSA-FlashInfer side-by-side in
assets/.Scope
serve_lvsa.sh(sets plugin env) +generate.py(async/v1/videosclient).LVSA is Apache-2.0; uses vLLM-Omni's standard serving API and modifies nothing in core.