Skip to content

Open-Sora: Democratizing Efficient Video Production for All

Python

[feat] new config 12s/it

zhengzangwb8b0398eaa78
diff --git a/configs/opensora-v1-2/misc/bs.py b/configs/opensora-v1-2/misc/bs.py
index 18fbfe6..77e7f50 100644
--- a/configs/opensora-v1-2/misc/bs.py
+++ b/configs/opensora-v1-2/misc/bs.py
@@ -4,26 +4,26 @@ dataset = dict(
transform_name="resize_crop",
)
-# == Config 1 ==
+# == Config 1: Webvid ==
# base: (512, 408), 12s/it
grad_checkpoint = True
base = ("512", "408")
base_step_time = 12
bucket_config = {
"144p": {
- 1: (100, 300),
- 51: (30, 100),
- 102: (20, 100),
- 204: (8, 20),
- 408: (4, 10),
+ 1: (475, 0),
+ 51: (51, 0),
+ 102: (27, 0),
+ 204: (13, 0),
+ 408: (6, 0),
},
# ---
"240p": {
- 1: (100, 100),
- 51: (24, 10),
- 102: (12, 10),
- 204: (4, 8),
- 408: (2, 8),
+ 1: (297, 200), # 8.25
+ 51: (20, 0),
+ 102: (10, 0),
+ 204: (5, 0),
+ 408: (2, 0),
},
# ---
"512": {
@@ -35,23 +35,25 @@ bucket_config = {
},
# ---
"480p": {
- 1: (50, 50),
- 51: (6, 6),
- 102: (3, 3),
- 204: (1, 2),
+ 1: (89, 0),
+ 51: (5, 0),
+ 102: (2, 0),
+ 204: (1, 0),
},
# ---
"1024": {
- 1: (20, 20),
- 51: (2, 2),
- 102: (1, 1),
+ 1: (36, 0),
+ 51: (1, 0),
},
# ---
- "1080p": {1: (10, 10)},
+ "1080p": {1: (5, 0)},
# ---
- "2048": {1: (5, 5)},
+ "2048": {1: (5, 0)},
}
+# == Config 1 ==
+# base: (512, 408), 16s/it
+
# Acceleration settings
num_workers = 8
num_bucket_build_workers = 16
diff --git a/configs/opensora-v1-2/train/stage1.py b/configs/opensora-v1-2/train/stage1.py
index 59e5b90..242784e 100644
--- a/configs/opensora-v1-2/train/stage1.py
+++ b/configs/opensora-v1-2/train/stage1.py
@@ -25,21 +25,21 @@ dataset = dict(
# }
# webvid
-bucket_config = { # 20s/it
- "144p": {1: (1.0, 100), 51: (1.0, 30), 102: ((1.0, 0.33), 20), 204: ((1.0, 0.1), 8), 408: ((1.0, 0.1), 4)},
+bucket_config = { # 12s/it
+ "144p": {1: (1.0, 475), 51: (1.0, 51), 102: ((1.0, 0.33), 27), 204: ((1.0, 0.1), 13), 408: ((1.0, 0.1), 6)},
# ---
- "256": {1: (0.4, 100), 51: (0.5, 24), 102: ((0.5, 0.33), 12), 204: ((0.5, 0.1), 4), 408: ((0.5, 0.1), 2)},
- "240p": {1: (0.3, 100), 51: (0.4, 24), 102: ((0.4, 0.33), 12), 204: ((0.4, 0.1), 4), 408: ((0.4, 0.1), 2)},
+ "256": {1: (0.4, 297), 51: (0.5, 20), 102: ((0.5, 0.33), 10), 204: ((0.5, 0.1), 5), 408: ((0.5, 0.1), 2)},
+ "240p": {1: (0.3, 297), 51: (0.4, 20), 102: ((0.4, 0.33), 10), 204: ((0.4, 0.1), 5), 408: ((0.4, 0.1), 2)},
# ---
- "360p": {1: (0.2, 60), 51: (0.15, 12), 102: ((0.15, 0.33), 6), 204: ((0.15, 0.1), 2), 408: ((0.15, 0.1), 1)},
- "512": {1: (0.1, 60), 51: (0.3, 12), 102: (0.3, 6), 204: (0.3, 2), 408: (0.3, 1)},
+ "360p": {1: (0.2, 141), 51: (0.15, 8), 102: ((0.15, 0.33), 4), 204: ((0.15, 0.1), 2), 408: ((0.15, 0.1), 1)},
+ "512": {1: (0.1, 141)},
# ---
- "480p": {1: (0.1, 40), 51: (0.3, 6), 102: (0.3, 3), 204: (0.3, 1), 408: (0.0, None)},
+ "480p": {1: (0.1, 89)},
# ---
- "720p": {1: (0.05, 20), 51: (0.3, 2), 102: (0.3, 1), 204: (0.0, None)},
- "1024": {1: (0.05, 20), 51: (0.3, 2), 102: (0.3, 1), 204: (0.0, None)},
+ "720p": {1: (0.05, 36)},
+ "1024": {1: (0.05, 36)},
# ---
- "1080p": {1: (0.1, 10)},
+ "1080p": {1: (0.1, 5)},
# ---
"2048": {1: (0.1, 5)},
}
diff --git a/scripts/misc/search_bs.py b/scripts/misc/search_bs.py
index 3926422..a0fd2cc 100644
--- a/scripts/misc/search_bs.py
+++ b/scripts/misc/search_bs.py
@@ -310,6 +310,8 @@ def main():
# == search for other buckets ==
for (resolution, frames), bounds in buckets.items():
+ if bounds[0] == bounds[1]:
+ continue
try:
batch_size, step_time = benchmark(resolution, frames, *bounds, ref_step_time=base_step_time)
output_bucket_cfg[resolution][frames] = batch_size