# 🚀 基准测试
> 本文档展示了LightX2V在不同硬件环境下的性能测试结果,包括H200和RTX 4090平台的详细对比数据。
---
## 🖥️ H200 环境 (~140GB显存)
### 📋 软件环境配置
| 组件 | 版本 |
|:-----|:-----|
| **Python** | 3.11 |
| **PyTorch** | 2.7.1+cu128 |
| **SageAttention** | 2.2.0 |
| **vLLM** | 0.9.2 |
| **sgl-kernel** | 0.1.8 |
---
### 🎬 480P 5s视频测试
**测试配置:**
- **模型**: [Wan2.1-I2V-14B-480P-Lightx2v](https://huggingface.co/lightx2v/Wan2.1-I2V-14B-480P-Lightx2v)
- **参数**: `infer_steps=40`, `seed=42`, `enable_cfg=True`
#### 📊 性能对比表
| 配置 | 推理时间(s) | GPU显存占用(GB) | 加速比 | 视频效果 |
|:-----|:----------:|:---------------:|:------:|:--------:|
| **Wan2.1 Official** | 366 | 71 | 1.0x | |
| **FastVideo** | 292 | 26 | **1.25x** | |
| **LightX2V_1** | 250 | 53 | **1.46x** | |
| **LightX2V_2** | 216 | 50 | **1.70x** | |
| **LightX2V_3** | 191 | 35 | **1.92x** | |
| **LightX2V_3-Distill** | 14 | 35 | **🏆 20.85x** | |
| **LightX2V_4** | 107 | 35 | **3.41x** | |
---
### 🎬 720P 5s视频测试
**测试配置:**
- **模型**: [Wan2.1-I2V-14B-720P-Lightx2v](https://huggingface.co/lightx2v/Wan2.1-I2V-14B-720P-Lightx2v)
- **参数**: `infer_steps=40`, `seed=1234`, `enable_cfg=True`
#### 📊 性能对比表
| 配置 | 推理时间(s) | GPU显存占用(GB) | 加速比 | 视频效果 |
|:-----|:----------:|:---------------:|:------:|:--------:|
| **Wan2.1 Official** | 974 | 81 | 1.0x | |
| **FastVideo** | 914 | 40 | **1.07x** | |
| **LightX2V_1** | 807 | 65 | **1.21x** | |
| **LightX2V_2** | 751 | 57 | **1.30x** | |
| **LightX2V_3** | 671 | 43 | **1.45x** | |
| **LightX2V_3-Distill** | 44 | 43 | **🏆 22.14x** | |
| **LightX2V_4** | 344 | 46 | **2.83x** | |
---
## 🖥️ RTX 4090 环境 (~24GB显存)
### 📋 软件环境配置
| 组件 | 版本 |
|:-----|:-----|
| **Python** | 3.9.16 |
| **PyTorch** | 2.5.1+cu124 |
| **SageAttention** | 2.1.0 |
| **vLLM** | 0.6.6 |
| **sgl-kernel** | 0.0.5 |
| **q8-kernels** | 0.0.0 |
---
### 🎬 480P 5s视频测试
**测试配置:**
- **模型**: [Wan2.1-I2V-14B-480P-Lightx2v](https://huggingface.co/lightx2v/Wan2.1-I2V-14B-480P-Lightx2v)
- **参数**: `infer_steps=40`, `seed=42`, `enable_cfg=True`
#### 📊 性能对比表
| 配置 | 推理时间(s) | GPU显存占用(GB) | 加速比 | 视频效果 |
|:-----|:----------:|:---------------:|:------:|:--------:|
| **Wan2GP(profile=3)** | 779 | 20 | **1.0x** | |
| **LightX2V_5** | 738 | 16 | **1.05x** | |
| **LightX2V_5-Distill** | 68 | 16 | **11.45x** | |
| **LightX2V_6** | 630 | 12 | **1.24x** | |
| **LightX2V_6-Distill** | 63 | 12 | **🏆 12.36x** | |
---
### 🎬 720P 5s视频测试
**测试配置:**
- **模型**: [Wan2.1-I2V-14B-720P-Lightx2v](https://huggingface.co/lightx2v/Wan2.1-I2V-14B-720P-Lightx2v)
- **参数**: `infer_steps=40`, `seed=1234`, `enable_cfg=True`
#### 📊 性能对比表
| 配置 | 推理时间(s) | GPU显存占用(GB) | 加速比 | 视频效果 |
|:-----|:----------:|:---------------:|:------:|:--------:|
| **Wan2GP(profile=3)** | -- | OOM | -- | |
| **LightX2V_5** | 2473 | 23 | -- | |
| **LightX2V_5-Distill** | 183 | 23 | -- | |
| **LightX2V_6** | 2169 | 18 | -- | |
| **LightX2V_6-Distill** | 171 | 18 | -- | |
---
## 📖 配置说明
### 🖥️ H200 环境配置说明
| 配置 | 技术特点 |
|:-----|:---------|
| **Wan2.1 Official** | 基于[Wan2.1官方仓库](https://github.com/Wan-Video/Wan2.1)的原始实现 |
| **FastVideo** | 基于[FastVideo官方仓库](https://github.com/hao-ai-lab/FastVideo),使用SageAttention2后端优化 |
| **LightX2V_1** | 使用SageAttention2替换原生注意力机制,采用DIT BF16+FP32(部分敏感层)混合精度计算,在保持精度的同时提升计算效率 |
| **LightX2V_2** | 统一使用BF16精度计算,进一步减少显存占用和计算开销,同时保持生成质量 |
| **LightX2V_3** | 引入FP8量化技术显著减少计算精度要求,结合Tiling VAE技术优化显存使用 |
| **LightX2V_3-Distill** | 在LightX2V_3基础上使用4步蒸馏模型(`infer_steps=4`, `enable_cfg=False`),进一步减少推理步数并保持生成质量 |
| **LightX2V_4** | 在LightX2V_3基础上加入TeaCache(teacache_thresh=0.2)缓存复用技术,通过智能跳过冗余计算实现加速 |
### 🖥️ RTX 4090 环境配置说明
| 配置 | 技术特点 |
|:-----|:---------|
| **Wan2GP(profile=3)** | 基于[Wan2GP仓库](https://github.com/deepbeepmeep/Wan2GP)实现,使用MMGP优化技术。profile=3配置适用于至少32GB内存和24GB显存的RTX 3090/4090环境,通过牺牲显存来适应有限的内存资源。使用量化模型:[480P模型](https://huggingface.co/DeepBeepMeep/Wan2.1/blob/main/wan2.1_image2video_480p_14B_quanto_mbf16_int8.safetensors)和[720P模型](https://huggingface.co/DeepBeepMeep/Wan2.1/blob/main/wan2.1_image2video_720p_14B_quanto_mbf16_int8.safetensors) |
| **LightX2V_5** | 使用SageAttention2替换原生注意力机制,采用DIT FP8+FP32(部分敏感层)混合精度计算,启用CPU offload技术,将部分敏感层执行FP32精度计算,将DIT推理过程中异步数据卸载到CPU上,节省显存,offload粒度为block级别 |
| **LightX2V_5-Distill** | 在LightX2V_5基础上使用4步蒸馏模型(`infer_steps=4`, `enable_cfg=False`),进一步减少推理步数并保持生成质量 |
| **LightX2V_6** | 在LightX2V_3基础上启用CPU offload技术,将部分敏感层执行FP32精度计算,将DIT推理过程中异步数据卸载到CPU上,节省显存,offload粒度为block级别 |
| **LightX2V_6-Distill** | 在LightX2V_6基础上使用4步蒸馏模型(`infer_steps=4`, `enable_cfg=False`),进一步减少推理步数并保持生成质量 |
---
## 📁 配置文件参考
基准测试相关的配置文件和运行脚本可在以下位置获取:
| 类型 | 链接 | 说明 |
|:-----|:-----|:-----|
| **配置文件** | [configs/bench](https://github.com/ModelTC/LightX2V/tree/main/configs/bench) | 包含各种优化配置的JSON文件 |
| **运行脚本** | [scripts/bench](https://github.com/ModelTC/LightX2V/tree/main/scripts/bench) | 包含基准测试的执行脚本 |
---
> 💡 **提示**: 建议根据您的硬件配置选择合适的优化方案,以获得最佳的性能表现。