Deploying OpenSora 2.0
This guide provides step-by-step instructions to set up and run OpenSora 2.0 for inference or fine-tuning on HPC-AI.com.
1. Create an Instance with H200 GPU
Log in to HPC-AI.com and navigate to the instance creation page.
Select the H200 GPU option to ensure optimal performance for video generation tasks.
2. Select the Appropriate OpenSora Image
Under the Advanced Images section
- For inference, choose OpenSora 2.0 Inference Image
- For fine-tuning, select OpenSora 2.0 Finetune Image
These images come pre-configured with the necessary dependencies and environments for OpenSora 2.0.
3. Configure Remote Storage
Based on your usage, set up remote storage in the same region of your machine:
- For inference, allocate at least 90GB
- For fine-tuning, allocate at least 120GB
Mount the storage to the container at:
/root/highspeedstorage/commondata
4. Download OpenSora Dataset
Once your instance is running:
Install the MinIO Client (
mc
):curl https://dl.min.io/client/mc/release/linux-amd64/mc \
--create-dirs \
-o $HOME/minio-binaries/mc
chmod +x $HOME/minio-binaries/mc
export PATH=$PATH:$HOME/minio-binaries/Configure Access to the Dataset:
mc config host add s3 http://seaweedfs-s3.seaweedfs:8333 readuser Luchen2017hpc --api s3v4
List Available Datasets:
mc ls s3/share/opensorav2
Download the Dataset:
mc cp -r s3/share/opensorav2 /root/highspeedstorage/commondata/
5. Run Inference or Fine-Tuning
Navigate to the OpenSora directory:
cd /root/highspeedstorage/commondata/opensorav2
For Inference:
torchrun --nproc_per_node 1 --standalone scripts/diffusion/inference.py \
configs/diffusion/inference/t2i2v_256px.py \
--save-dir samples \
--prompt "raining, sea"For Fine-Tuning:
torchrun --nproc_per_node 8 \
scripts/diffusion/train.py \
configs/diffusion/train/stage1.py \
--dataset.data-path ./datasets/Opensora/pexels_mid_necessary_lpf.csv
Ensure that the dataset path corresponds to the location of your downloaded dataset.
Feel free to reach out if you need further assistance or have specific questions about the setup.