lightx2v commited on
Commit
d359133
·
verified ·
1 Parent(s): c4e74e4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +184 -0
README.md CHANGED
@@ -1,3 +1,187 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ base_model:
4
+ - yuanty/fastwam
5
+ - hustvl/FasterWAM
6
+ - Wan-AI/Wan2.2-TI2V-5B
7
+ tags:
8
+ - WAM
9
+ - world-action-model
10
  ---
11
+ <div align="center" style="font-family: charter;">
12
+ <h1>RealtimeWAM:<br>One-Step Asynchronous World Action Models</h1>
13
+
14
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](../../LICENSE)&nbsp;
15
+ [![GitHub Stars](https://img.shields.io/github/stars/ModelTC/LightX2V.svg?style=social&label=Star&maxAge=60)](https://github.com/ModelTC/LightX2V)&nbsp;
16
+ [![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-RealtimeWAM-yellow)](https://huggingface.co/lightx2v/RealtimeWAM)&nbsp;
17
+
18
+ </div>
19
+
20
+ ### 💡 Why RealtimeWAM
21
+
22
+ * 🥇 Pioneer work: The first **one-step World Action Model (WAM)** with near-lossless performance, built on **any Mixture-of-Transformers (MoT)-based WAM architecture**.
23
+ * 🏆 Superior performance: Maintains **less than 1% average accuracy drop** compared with multi-step counterparts across diverse benchmarks, including **RoboTwin 2.0**, **LIBERO**, and **LIBERO-Plus**.
24
+ * ⚡ Extreme acceleration: With one-step distillation, asynchronous inference, CUDA Graph, and efficient kernels, achieves **24.55× end-to-end speedup** on **Fast-WAM** (**12.2 ms**) and **13.56×** on **Faster-WAM** (**16.1 ms**) on a single **NVIDIA H100**, enabling real-time action generation. Latency includes VAE encoding and excludes text encoding, which is performed once per episode.
25
+
26
+ ## 💪 TODO
27
+
28
+ | Resource | RealtimeWAM<sup>*</sup> | RealtimeWAM<sup>†</sup> |
29
+ | --- | :---: | :---: |
30
+ | Checkpoints | ✅ | ✅ |
31
+ | Inference code | ✅ | ✅ |
32
+ | Evaluation code | ✅ | ✅ |
33
+ | Training code | ❌ | ❌ |
34
+
35
+ <sup>*</sup> and <sup>†</sup> denote variants based on Fast-WAM and Faster-WAM, respectively.
36
+
37
+ ## ✨ Quick Start
38
+
39
+ ### Environment
40
+
41
+ #### Inference
42
+
43
+ RealtimeWAM uses the LightX2V environment. You can follow the environment setup instructions in the [LightX2V README](../../README.md). For comprehensive usage instructions, please refer to the LightX2V documentation: **[English Docs](https://lightx2v-en.readthedocs.io/en/latest/) | [中文文档](https://lightx2v-zhcn.readthedocs.io/zh-cn/latest/)**. **We highly recommend using the Docker environment, as it is the simplest and fastest way to set up the environment. For details, please refer to the Quick Start section in the documentation.** If you prefer to build from source, please refer to [**Building from Source**](../../README.md#building-from-source) in the LightX2V README.
44
+
45
+ #### Evaluation
46
+
47
+ We provide [uv](https://docs.astral.sh/uv/getting-started/installation/)-based environment setup scripts for LIBERO, LIBERO-Plus, and RoboTwin 2.0. We recommend **CUDA 12.8 and PyTorch 2.7.1**. The scripts create independent Python 3.10 environments with LightX2V and PyTorch 2.7.1, and initialize the corresponding benchmark submodules. Run the following commands from the LightX2V repository root. Install only the environment you need.
48
+
49
+ For **LIBERO and LIBERO-Plus**, install and activate their shared evaluation environment:
50
+
51
+ ```bash
52
+ bash scripts/bench/robotics/install_env.sh libero
53
+ source .venvs/libero/bin/activate
54
+ ```
55
+
56
+ For **RoboTwin**, first install CUDA Toolkit 12.8 and set `CUDA_HOME` to its installation path, then install and activate the evaluation environment:
57
+
58
+ ```bash
59
+ export CUDA_HOME=/usr/local/cuda-12.8
60
+ export PATH="$CUDA_HOME/bin:$PATH"
61
+ bash scripts/bench/robotics/install_env.sh robotwin
62
+ source .venvs/robotwin/bin/activate
63
+ ```
64
+
65
+ Dependencies are listed in [`requirements_libero.txt`](https://github.com/chengtao-lv/LightX2V/blob/main/scripts/bench/robotics/requirements_libero.txt) and [`requirements_robotwin.txt`](https://github.com/chengtao-lv/LightX2V/blob/main/scripts/bench/robotics/requirements_robotwin.txt).
66
+
67
+ ### Download Checkpoints
68
+
69
+ Download the RealtimeWAM checkpoints from [lightx2v/RealtimeWAM](https://huggingface.co/lightx2v/RealtimeWAM) on Hugging Face. The simplest option is to download the **checkpoints with the action expert's LoRA adapters already merged**.
70
+
71
+ | Checkpoint | Benchmark | Backbone | Data stats |
72
+ | --- | --- | --- | --- |
73
+ | [realtimewam_libero_fast.pt](https://huggingface.co/lightx2v/RealtimeWAM/resolve/main/realtimewam_libero_fast.pt) | LIBERO / LIBERO-Plus | Fast-WAM | [libero_dataset_stats.json](https://huggingface.co/lightx2v/RealtimeWAM/resolve/main/libero_dataset_stats.json) |
74
+ | [realtimewam_libero_faster.pt](https://huggingface.co/lightx2v/RealtimeWAM/resolve/main/realtimewam_libero_faster.pt) | LIBERO / LIBERO-Plus | Faster-WAM | [libero_dataset_stats.json](https://huggingface.co/lightx2v/RealtimeWAM/resolve/main/libero_dataset_stats.json) |
75
+ | [realtimewam_robotwin_fast.pt](https://huggingface.co/lightx2v/RealtimeWAM/resolve/main/realtimewam_robotwin_fast.pt) | RoboTwin 2.0 | Fast-WAM | [robotwin_dataset_stats.json](https://huggingface.co/lightx2v/RealtimeWAM/resolve/main/robotwin_dataset_stats.json) |
76
+ | [realtimewam_robotwin_faster.pt](https://huggingface.co/lightx2v/RealtimeWAM/resolve/main/realtimewam_robotwin_faster.pt) | RoboTwin 2.0 | Faster-WAM | [robotwin_dataset_stats.json](https://huggingface.co/lightx2v/RealtimeWAM/resolve/main/robotwin_dataset_stats.json) |
77
+
78
+ ```bash
79
+ huggingface-cli download lightx2v/RealtimeWAM \
80
+ realtimewam_libero_fast.pt \
81
+ realtimewam_libero_faster.pt \
82
+ realtimewam_robotwin_fast.pt \
83
+ realtimewam_robotwin_faster.pt \
84
+ libero_dataset_stats.json \
85
+ robotwin_dataset_stats.json \
86
+ --local-dir ./checkpoints/RealtimeWAM
87
+ ```
88
+
89
+ ### Inference
90
+
91
+ The end-to-end inference latency of **RealtimeWAM<sup>*</sup>** and **RealtimeWAM<sup>†</sup>** can be measured using the following scripts.
92
+
93
+ ```bash
94
+ # RealtimeWAM*, based on Fast-WAM
95
+ bash scripts/realtimewam/run_libero_fastwam_i2va.sh
96
+
97
+ # RealtimeWAM†, based on Faster-WAM
98
+ bash scripts/realtimewam/run_libero_fasterwam_i2va.sh
99
+ ```
100
+
101
+ We provide example inference inputs in [`examples/realtimewam/assets/`](assets/).
102
+
103
+ The measured latency is reported in the logs under **`RealtimeWAM End-to-End Latency (Excluding Text Encoding)`**, in milliseconds. It includes VAE encoding and video/action inference, while excluding text encoding.
104
+
105
+ Inference latency comparisons are shown below. Speedups are relative to the original model on the same GPU. The scripts above can be used to reproduce the inference latencies reported in our paper. LightX2V achieves slightly lower latency than reported in the paper.
106
+
107
+ | GPU | Fast-WAM (ms) | RealtimeWAM<sup>*</sup> (ms) | Speedup<sup>*</sup> | Faster-WAM (ms) | RealtimeWAM<sup>†</sup> (ms) | Speedup<sup>†</sup> |
108
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: |
109
+ | NVIDIA H100 | 300 | **12.2** | **24.56×** | 219 | **16.1** | **13.56×** |
110
+ | NVIDIA RTX 4090D | 481 | **27.2** | **17.68×** | 362 | **44.7** | **8.11×** |
111
+
112
+ ### Evaluation
113
+
114
+ #### [Optional] Prepare Benchmark Resources
115
+
116
+ Skip this step if the benchmark assets are already installed. Use the repository-pinned benchmark versions; training demonstration datasets are not required for evaluation.
117
+
118
+ * **LIBERO:** Task definitions and initial states are included in the submodule.
119
+ * **LIBERO-Plus:** Download and extract `assets.zip` from `Sylvest/LIBERO-plus` on Hugging Face into `LIBERO-plus/libero/libero/assets/`.
120
+ * **RoboTwin:** Run `bash script/_download_assets.sh` from the RoboTwin root directory to download and configure the simulation assets.
121
+
122
+ For detailed preparation instructions, refer to the original repositories: [LIBERO](https://github.com/Lifelong-Robot-Learning/LIBERO), [LIBERO-Plus](https://github.com/sylvestf/LIBERO-plus#-installation), and [RoboTwin](https://github.com/robotwin-Platform/robotwin).
123
+
124
+ #### Run Evaluation
125
+
126
+ Run the following commands from the LightX2V repository root. Set the Wan2.2 model path and the GPUs to use:
127
+
128
+ ```bash
129
+ export WAN_MODEL_PATH=/path/to/Wan2.2-TI2V-5B
130
+ export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
131
+ ```
132
+
133
+ The examples below evaluate **RealtimeWAM<sup>*</sup>** with one-step action denoising. Use the downloaded checkpoint and its matching dataset statistics. `CKPT_PATH`, `DATASET_STATS_PATH`, and `CONFIG_JSON` select the policy weights, normalization statistics, and inference configuration; `OUT` specifies the result directory.
134
+
135
+ For **LIBERO**, evaluate 40 tasks across four suites, with 50 trials per task. The policy starts after 30 settling steps:
136
+
137
+ ```bash
138
+ source .venvs/libero/bin/activate
139
+ CKPT_PATH=./checkpoints/RealtimeWAM/realtimewam_libero_fast.pt \
140
+ DATASET_STATS_PATH=./checkpoints/RealtimeWAM/libero_dataset_stats.json \
141
+ CONFIG_JSON=configs/realtimewam/libero_fastwam_i2va.json \
142
+ OUT=evaluate_results/libero/realtimewam_fast \
143
+ bash scripts/bench/robotics/run_libero.sh model=realtimewam seed=42 \
144
+ EVALUATION.num_trials=50 EVALUATION.num_steps_wait=30 EVALUATION.replan_steps=10
145
+ ```
146
+
147
+ For **LIBERO-Plus**, reuse the LIBERO checkpoint and statistics:
148
+
149
+ ```bash
150
+ source .venvs/libero/bin/activate
151
+ CKPT_PATH=./checkpoints/RealtimeWAM/realtimewam_libero_fast.pt \
152
+ DATASET_STATS_PATH=./checkpoints/RealtimeWAM/libero_dataset_stats.json \
153
+ CONFIG_JSON=configs/realtimewam/libero_fastwam_i2va.json \
154
+ OUT=evaluate_results/libero_plus/realtimewam_fast \
155
+ bash scripts/bench/robotics/run_libero_plus.sh model=realtimewam seed=42 \
156
+ EVALUATION.num_trials=1 EVALUATION.num_steps_wait=30 EVALUATION.replan_steps=10
157
+ ```
158
+
159
+ For **RoboTwin 2.0**, evaluate 50 tasks under both clean and randomized conditions, with 100 episodes per task and condition using unseen instructions:
160
+
161
+ ```bash
162
+ source .venvs/robotwin/bin/activate
163
+ CKPT_PATH=./checkpoints/RealtimeWAM/realtimewam_robotwin_fast.pt \
164
+ DATASET_STATS_PATH=./checkpoints/RealtimeWAM/robotwin_dataset_stats.json \
165
+ CONFIG_JSON=configs/realtimewam/robotwin_fastwam_i2va.json \
166
+ OUT=evaluate_results/robotwin/realtimewam_fast \
167
+ bash scripts/bench/robotics/run_robotwin.sh model=realtimewam seed=42 \
168
+ EVALUATION.eval_num_episodes=100 EVALUATION.instruction_type=unseen EVALUATION.replan_steps=24
169
+ ```
170
+
171
+ To evaluate **RealtimeWAM<sup>†</sup>**, replace the checkpoint suffix `_fast.pt` with `_faster.pt`, select the corresponding configuration below, and use a separate output directory.
172
+
173
+ | Variant | LIBERO / LIBERO-Plus config | RoboTwin config |
174
+ | --- | --- | --- |
175
+ | RealtimeWAM<sup>*</sup> | `libero_fastwam_i2va.json` | `robotwin_fastwam_i2va.json` |
176
+ | RealtimeWAM<sup>†</sup> | `libero_fasterwam_i2va.json` | `robotwin_fasterwam_i2va.json` |
177
+
178
+ All configurations are under `configs/realtimewam/` and use one action denoising step.
179
+
180
+ The evaluation scripts above can also be used to reproduce the success rates reported in our paper. Results below are success rates (%). NFE denotes the number of denoising steps for video and action generation.
181
+
182
+ | Method | Video NFE | Action NFE | RoboTwin 2.0 Clean ↑ | RoboTwin 2.0 Random ↑ | RoboTwin 2.0 Overall ↑ | LIBERO Overall ↑ |
183
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: |
184
+ | Fast-WAM | 1 | 10 | 91.82 | 91.19 | 91.51 | 97.0 |
185
+ | **RealtimeWAM<sup>*</sup>** | 1 | 1 | 91.96 | 89.72 | 90.84 | 97.0 |
186
+ | Faster-WAM | 1 | 10 | 93.20 | 92.66 | 92.93 | 98.9 |
187
+ | **RealtimeWAM<sup>†</sup>** | 1 | 1 | 92.98 | 92.30 | 92.64 | 99.0 |