-
-
Notifications
You must be signed in to change notification settings - Fork 229
Expand file tree
/
Copy path.dstack.yml
More file actions
63 lines (57 loc) · 1.63 KB
/
.dstack.yml
File metadata and controls
63 lines (57 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
type: task
name: wan22
repos:
# Clones it to `/workflow` (the default working directory)
- https://github.com/Wan-Video/Wan2.2.git
python: 3.12
nvcc: true
env:
- PROMPT="Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."
# Required for storing cache on a volume
- UV_LINK_MODE=copy
commands:
# Install flash-attn
- |
uv pip install torch
uv pip install flash-attn --no-build-isolation
# Install dependencies
- |
uv pip install . decord librosa
uv pip install "huggingface_hub[cli]"
hf download Wan-AI/Wan2.2-T2V-A14B --local-dir /root/.cache/Wan2.2-T2V-A14B
# Generate video
- |
if [ ${DSTACK_GPUS_NUM} -gt 1 ]; then
torchrun \
--nproc_per_node=${DSTACK_GPUS_NUM} \
generate.py \
--task t2v-A14B \
--size 1280*720 \
--ckpt_dir /root/.cache/Wan2.2-T2V-A14B \
--dit_fsdp --t5_fsdp --ulysses_size ${DSTACK_GPUS_NUM} \
--save_file ${DSTACK_RUN_NAME}.mp4 \
--prompt "${PROMPT}"
else
python generate.py \
--task t2v-A14B \
--size 1280*720 \
--ckpt_dir /root/.cache/Wan2.2-T2V-A14B \
--offload_model True \
--convert_model_dtype \
--save_file ${DSTACK_RUN_NAME}.mp4 \
--prompt "${PROMPT}"
fi
# Upload video
- curl https://bashupload.com/ -T ./${DSTACK_RUN_NAME}.mp4
resources:
gpu:
name: [H100, H200]
count: 1..8
disk: 300GB
# Change to on-demand for disabling spot
spot_policy: auto
volumes:
# Cache pip packages and HF models
- instance_path: /root/dstack-cache
path: /root/.cache/
optional: true