Skip to content

Commit d43c166

Browse files
committed
[bugfix] Make Dreamverse Modal max-autotune opt-in
1 parent f4df67b commit d43c166

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

apps/dreamverse/dreamverse/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def _optional_env(*names: str) -> str | None:
164164

165165
DEVTOOLS_ENABLED = _env_bool("FASTVIDEO_ENABLE_DEVTOOLS", False)
166166
PROMPT_SAFETY_ENABLED = _env_bool("FASTVIDEO_ENABLE_PROMPT_SAFETY", False)
167+
DREAMVERSE_MAX_AUTOTUNE = _env_bool("DREAMVERSE_MAX_AUTOTUNE", True)
167168

168169

169170
def _resolve_devtools_paths(

apps/dreamverse/dreamverse/video_generation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
MODEL_CONFIG,
2626
NUM_FRAMES,
2727
NUM_INFERENCE_STEPS,
28+
DREAMVERSE_MAX_AUTOTUNE,
2829
)
2930

3031
# Multi-frame decoded continuation defaults from
@@ -257,6 +258,7 @@ def initialize(self, model_config: dict | None = None) -> None:
257258
or self.current_model_config["model_path"])
258259

259260
enable_compile = os.getenv("ENABLE_TORCH_COMPILE", "1") == "1"
261+
compile_mode = "max-autotune-no-cudagraphs" if DREAMVERSE_MAX_AUTOTUNE else None
260262

261263
components = ComponentConfig(
262264
config_root=config_model_path,
@@ -283,7 +285,7 @@ def initialize(self, model_config: dict | None = None) -> None:
283285
vae_enabled=enable_compile,
284286
backend="inductor",
285287
fullgraph=True,
286-
mode="max-autotune-no-cudagraphs",
288+
mode=compile_mode,
287289
dynamic=False,
288290
),
289291
use_fsdp_inference=False,

apps/dreamverse/scripts/modal/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@ knobs below live in the image or `modal_app.py` unless you intentionally change
9797
- `FASTVIDEO_ENABLE_DEVTOOLS`: enable Dreamverse devtools behavior.
9898
- `FASTVIDEO_PROMPT_PROVIDER` / `FASTVIDEO_PROMPT_*_MODEL`: try prompt-rewriter provider or model choices.
9999
- `FASTVIDEO_ENABLE_STARTUP_WARMUP`: trade slower startup for a warmer first request.
100+
- `DREAMVERSE_MAX_AUTOTUNE`: opt into PyTorch Inductor max-autotune for the compiled Dreamverse runtime.
101+
102+
The Modal wrapper we provide defaults to torch compile without Inductor max-autotune.
103+
This shortens compile/warmup time and reduces cost. If you prefer
104+
the fastest generation, opt into max-autotune via:
105+
106+
```bash
107+
DREAMVERSE_IMAGE=ghcr.io/<org>/<repo>/dreamverse:<tag> \
108+
DREAMVERSE_MAX_AUTOTUNE=1 \
109+
modal deploy apps/dreamverse/scripts/modal/modal_app.py
110+
```
100111

101112
### Autoscaling and cost safety
102113

apps/dreamverse/scripts/modal/modal_app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"FASTVIDEO_ENABLE_STARTUP_WARMUP": "1",
2323
"FASTVIDEO_GPU_COUNT": "1",
2424
"ENABLE_TORCH_COMPILE": "1",
25+
"DREAMVERSE_MAX_AUTOTUNE": os.environ.get("DREAMVERSE_MAX_AUTOTUNE", "0"),
2526
"STREAM_MODE": "av_fmp4",
2627
})
2728

0 commit comments

Comments
 (0)