xDiT diffusion inference#

2026-02-11

27 min read time

Applies to Linux

The rocm/pytorch-xdit Docker image offers a prebuilt, optimized environment based on xDiT for benchmarking diffusion model video and image generation on gfx942 and gfx950 series (AMD Instinct™ MI300X, MI325X, MI350X, and MI355X) GPUs. The image runs ROCm 7.11.0 (preview) based on TheRock and includes the following components:

Software components - xdit:v26.1

Software component

Version

TheRock

1728a81

rccl

d23d18f

composable_kernel

ab0101c

rocm-libraries

a2f7c35

rocm-systems

659737c

torch

91be249

torchvision

b919bd0

triton

a272dfa

accelerate

b521400f

aiter

de14bec0

diffusers

6708f5

xfuser

0a3d7a

yunchang

2c9b712

Follow this guide to pull the required image, spin up a container, download the model, and run a benchmark. For preview and development releases, see amdsiloai/pytorch-xdit.

What’s new#

  • HunyuanVideo 1.5 support

  • Z-Image Turbo support

  • Wan model sharding

Supported models#

The following models are supported for inference performance benchmarking. Some instructions, commands, and recommendations in this documentation might vary by model – select one to get started.

Model
Hunyuan Video
Wan-AI
FLUX
StableDiffusion
Z-Image
Variant
Hunyuan Video
Hunyuan Video 1.5
Wan2.1
Wan2.2
FLUX.1
FLUX.1 Kontext
FLUX.2
stable-diffusion-3.5-large
Z-Image Turbo

Note

To learn more about your specific model see the Hunyuan Video model card on Hugging Face or visit the GitHub page. Note that some models require access authorization before use via an external license agreement through a third party.

Note

To learn more about your specific model see the Hunyuan Video 1.5 model card on Hugging Face or visit the GitHub page. Note that some models require access authorization before use via an external license agreement through a third party.

Note

To learn more about your specific model see the Wan2.1 model card on Hugging Face or visit the GitHub page. Note that some models require access authorization before use via an external license agreement through a third party.

Note

To learn more about your specific model see the Wan2.2 model card on Hugging Face or visit the GitHub page. Note that some models require access authorization before use via an external license agreement through a third party.

Note

To learn more about your specific model see the FLUX.1 model card on Hugging Face or visit the GitHub page. Note that some models require access authorization before use via an external license agreement through a third party.

Note

To learn more about your specific model see the FLUX.1 Kontext model card on Hugging Face or visit the GitHub page. Note that some models require access authorization before use via an external license agreement through a third party.

Note

To learn more about your specific model see the FLUX.2 model card on Hugging Face or visit the GitHub page. Note that some models require access authorization before use via an external license agreement through a third party.

Note

To learn more about your specific model see the stable-diffusion-3.5-large model card on Hugging Face or visit the GitHub page. Note that some models require access authorization before use via an external license agreement through a third party.

Note

To learn more about your specific model see the Z-Image Turbo model card on Hugging Face or visit the GitHub page. Note that some models require access authorization before use via an external license agreement through a third party.

System validation#

Before running AI workloads, it’s important to validate that your AMD hardware is configured correctly and performing optimally.

If you have already validated your system settings, including aspects like NUMA auto-balancing, you can skip this step. Otherwise, complete the procedures in the System validation and optimization guide to properly configure your system settings before starting.

To test for optimal performance, consult the recommended System health benchmarks. This suite of tests will help you verify and fine-tune your system’s configuration.

Pull the Docker image#

For this tutorial, it’s recommended to use the latest rocm/pytorch-xdit:v26.1 Docker image. Pull the image using the following command:

docker pull rocm/pytorch-xdit:v26.1

Validate and benchmark#

Once the image has been downloaded you can follow these steps to run benchmarks and generate outputs.

The following commands are written for Hunyuan Video. See Supported models to switch to another available model.

The following commands are written for Hunyuan Video 1.5. See Supported models to switch to another available model.

The following commands are written for Wan2.1. See Supported models to switch to another available model.

The following commands are written for Wan2.2. See Supported models to switch to another available model.

The following commands are written for FLUX.1. See Supported models to switch to another available model.

The following commands are written for FLUX.1 Kontext. See Supported models to switch to another available model.

The following commands are written for FLUX.2. See Supported models to switch to another available model.

The following commands are written for stable-diffusion-3.5-large. See Supported models to switch to another available model.

The following commands are written for Z-Image Turbo. See Supported models to switch to another available model.

Choose your setup method#

You can either use an existing Hugging Face cache or download the model fresh inside the container.

If you already have models downloaded on your host system, you can mount your existing cache.

  1. Set your Hugging Face cache location.

    export HF_HOME=/your/hf_cache/location
    
  2. Download the model (if not already cached).

    huggingface-cli download tencent/HunyuanVideo  --revision refs/pr/18 
    
  3. Launch the container with mounted cache.

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        -e HF_HOME=/app/huggingface_models \
        -v $HF_HOME:/app/huggingface_models \
        rocm/pytorch-xdit:v26.1
    

If you prefer to keep the container self-contained or don’t have an existing cache.

  1. Launch the container

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        rocm/pytorch-xdit:v26.1
    
  2. Inside the container, set the Hugging Face cache location and download the model.

    export HF_HOME=/app/huggingface_models
    huggingface-cli download tencent/HunyuanVideo  --revision refs/pr/18 
    

    Warning

    Models will be downloaded to the container’s filesystem and will be lost when the container is removed unless you persist the data with a volume.

If you already have models downloaded on your host system, you can mount your existing cache.

  1. Set your Hugging Face cache location.

    export HF_HOME=/your/hf_cache/location
    
  2. Download the model (if not already cached).

    huggingface-cli download hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-720p_t2v 
    
  3. Launch the container with mounted cache.

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        -e HF_HOME=/app/huggingface_models \
        -v $HF_HOME:/app/huggingface_models \
        rocm/pytorch-xdit:v26.1
    

If you prefer to keep the container self-contained or don’t have an existing cache.

  1. Launch the container

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        rocm/pytorch-xdit:v26.1
    
  2. Inside the container, set the Hugging Face cache location and download the model.

    export HF_HOME=/app/huggingface_models
    huggingface-cli download hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-720p_t2v 
    

    Warning

    Models will be downloaded to the container’s filesystem and will be lost when the container is removed unless you persist the data with a volume.

If you already have models downloaded on your host system, you can mount your existing cache.

  1. Set your Hugging Face cache location.

    export HF_HOME=/your/hf_cache/location
    
  2. Download the model (if not already cached).

    huggingface-cli download Wan-AI/Wan2.1-I2V-14B-720P-Diffusers 
    
  3. Launch the container with mounted cache.

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        -e HF_HOME=/app/huggingface_models \
        -v $HF_HOME:/app/huggingface_models \
        rocm/pytorch-xdit:v26.1
    

If you prefer to keep the container self-contained or don’t have an existing cache.

  1. Launch the container

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        rocm/pytorch-xdit:v26.1
    
  2. Inside the container, set the Hugging Face cache location and download the model.

    export HF_HOME=/app/huggingface_models
    huggingface-cli download Wan-AI/Wan2.1-I2V-14B-720P-Diffusers 
    

    Warning

    Models will be downloaded to the container’s filesystem and will be lost when the container is removed unless you persist the data with a volume.

If you already have models downloaded on your host system, you can mount your existing cache.

  1. Set your Hugging Face cache location.

    export HF_HOME=/your/hf_cache/location
    
  2. Download the model (if not already cached).

    huggingface-cli download Wan-AI/Wan2.2-I2V-A14B-Diffusers 
    
  3. Launch the container with mounted cache.

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        -e HF_HOME=/app/huggingface_models \
        -v $HF_HOME:/app/huggingface_models \
        rocm/pytorch-xdit:v26.1
    

If you prefer to keep the container self-contained or don’t have an existing cache.

  1. Launch the container

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        rocm/pytorch-xdit:v26.1
    
  2. Inside the container, set the Hugging Face cache location and download the model.

    export HF_HOME=/app/huggingface_models
    huggingface-cli download Wan-AI/Wan2.2-I2V-A14B-Diffusers 
    

    Warning

    Models will be downloaded to the container’s filesystem and will be lost when the container is removed unless you persist the data with a volume.

If you already have models downloaded on your host system, you can mount your existing cache.

  1. Set your Hugging Face cache location.

    export HF_HOME=/your/hf_cache/location
    
  2. Download the model (if not already cached).

    huggingface-cli download black-forest-labs/FLUX.1-dev 
    
  3. Launch the container with mounted cache.

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        -e HF_HOME=/app/huggingface_models \
        -v $HF_HOME:/app/huggingface_models \
        rocm/pytorch-xdit:v26.1
    

If you prefer to keep the container self-contained or don’t have an existing cache.

  1. Launch the container

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        rocm/pytorch-xdit:v26.1
    
  2. Inside the container, set the Hugging Face cache location and download the model.

    export HF_HOME=/app/huggingface_models
    huggingface-cli download black-forest-labs/FLUX.1-dev 
    

    Warning

    Models will be downloaded to the container’s filesystem and will be lost when the container is removed unless you persist the data with a volume.

If you already have models downloaded on your host system, you can mount your existing cache.

  1. Set your Hugging Face cache location.

    export HF_HOME=/your/hf_cache/location
    
  2. Download the model (if not already cached).

    huggingface-cli download black-forest-labs/FLUX.1-Kontext-dev 
    
  3. Launch the container with mounted cache.

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        -e HF_HOME=/app/huggingface_models \
        -v $HF_HOME:/app/huggingface_models \
        rocm/pytorch-xdit:v26.1
    

If you prefer to keep the container self-contained or don’t have an existing cache.

  1. Launch the container

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        rocm/pytorch-xdit:v26.1
    
  2. Inside the container, set the Hugging Face cache location and download the model.

    export HF_HOME=/app/huggingface_models
    huggingface-cli download black-forest-labs/FLUX.1-Kontext-dev 
    

    Warning

    Models will be downloaded to the container’s filesystem and will be lost when the container is removed unless you persist the data with a volume.

If you already have models downloaded on your host system, you can mount your existing cache.

  1. Set your Hugging Face cache location.

    export HF_HOME=/your/hf_cache/location
    
  2. Download the model (if not already cached).

    huggingface-cli download black-forest-labs/FLUX.2-dev 
    
  3. Launch the container with mounted cache.

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        -e HF_HOME=/app/huggingface_models \
        -v $HF_HOME:/app/huggingface_models \
        rocm/pytorch-xdit:v26.1
    

If you prefer to keep the container self-contained or don’t have an existing cache.

  1. Launch the container

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        rocm/pytorch-xdit:v26.1
    
  2. Inside the container, set the Hugging Face cache location and download the model.

    export HF_HOME=/app/huggingface_models
    huggingface-cli download black-forest-labs/FLUX.2-dev 
    

    Warning

    Models will be downloaded to the container’s filesystem and will be lost when the container is removed unless you persist the data with a volume.

If you already have models downloaded on your host system, you can mount your existing cache.

  1. Set your Hugging Face cache location.

    export HF_HOME=/your/hf_cache/location
    
  2. Download the model (if not already cached).

    huggingface-cli download stabilityai/stable-diffusion-3.5-large 
    
  3. Launch the container with mounted cache.

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        -e HF_HOME=/app/huggingface_models \
        -v $HF_HOME:/app/huggingface_models \
        rocm/pytorch-xdit:v26.1
    

If you prefer to keep the container self-contained or don’t have an existing cache.

  1. Launch the container

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        rocm/pytorch-xdit:v26.1
    
  2. Inside the container, set the Hugging Face cache location and download the model.

    export HF_HOME=/app/huggingface_models
    huggingface-cli download stabilityai/stable-diffusion-3.5-large 
    

    Warning

    Models will be downloaded to the container’s filesystem and will be lost when the container is removed unless you persist the data with a volume.

If you already have models downloaded on your host system, you can mount your existing cache.

  1. Set your Hugging Face cache location.

    export HF_HOME=/your/hf_cache/location
    
  2. Download the model (if not already cached).

    huggingface-cli download Tongyi-MAI/Z-Image-Turbo 
    
  3. Launch the container with mounted cache.

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        -e HF_HOME=/app/huggingface_models \
        -v $HF_HOME:/app/huggingface_models \
        rocm/pytorch-xdit:v26.1
    

If you prefer to keep the container self-contained or don’t have an existing cache.

  1. Launch the container

    docker run \
        -it --rm \
        --cap-add=SYS_PTRACE \
        --security-opt seccomp=unconfined \
        --user root \
        --device=/dev/kfd \
        --device=/dev/dri \
        --group-add video \
        --ipc=host \
        --network host \
        --privileged \
        --shm-size 128G \
        --name pytorch-xdit \
        -e HSA_NO_SCRATCH_RECLAIM=1 \
        -e OMP_NUM_THREADS=16 \
        -e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
        rocm/pytorch-xdit:v26.1
    
  2. Inside the container, set the Hugging Face cache location and download the model.

    export HF_HOME=/app/huggingface_models
    huggingface-cli download Tongyi-MAI/Z-Image-Turbo 
    

    Warning

    Models will be downloaded to the container’s filesystem and will be lost when the container is removed unless you persist the data with a volume.

Run inference#

  1. Clone the ROCm Model Automation and Dashboarding (ROCm/MAD) repository to a local directory and install the required packages on the host machine.

    git clone https://github.com/ROCm/MAD
    cd MAD
    pip install -r requirements.txt
    
  2. On the host machine, use this command to run the performance benchmark test on the Hunyuan Video model using one node.

    export MAD_SECRETS_HFTOKEN="your personal Hugging Face token to access gated models"
    madengine run \
        --tags pyt_xdit_hunyuanvideo \
        --keep-model-dir \
        --live-output
    

MAD launches a Docker container with the name container_ci-pyt_xdit_hunyuanvideo. The throughput and serving reports of the model are collected in the following paths: pyt_xdit_hunyuanvideo_throughput.csv and pyt_xdit_hunyuanvideo_serving.csv.

To run the benchmarks for Hunyuan Video, use the following command:

cd /app/Hunyuanvideo
   mkdir results
   torchrun --nproc_per_node=8 run.py \
   --model tencent/HunyuanVideo \
   --prompt "In the large cage, two puppies were wagging their tails at each other." \
   --batch_size 1 \
   --height 720 --width 1280 \
   --seed 1168860793 \
   --num_frames 129 \
   --num_inference_steps 50 \
   --warmup_steps 1 \
   --n_repeats 1 \
   --sleep_dur 10 \
   --ulysses_degree 8 \
   --enable_tiling --enable_slicing \
   --guidance_scale 6.0 \
   --use_torch_compile \
   --attention_backend aiter \
   --benchmark_output_directory results

The generated video will be stored under the results directory.

  1. Clone the ROCm Model Automation and Dashboarding (ROCm/MAD) repository to a local directory and install the required packages on the host machine.

    git clone https://github.com/ROCm/MAD
    cd MAD
    pip install -r requirements.txt
    
  2. On the host machine, use this command to run the performance benchmark test on the Hunyuan Video 1.5 model using one node.

    export MAD_SECRETS_HFTOKEN="your personal Hugging Face token to access gated models"
    madengine run \
        --tags pyt_xdit_hunyuanvideo_1_5 \
        --keep-model-dir \
        --live-output
    

MAD launches a Docker container with the name container_ci-pyt_xdit_hunyuanvideo_1_5. The throughput and serving reports of the model are collected in the following paths: pyt_xdit_hunyuanvideo_1_5_throughput.csv and pyt_xdit_hunyuanvideo_1_5_serving.csv.

To run the benchmarks for Hunyuan Video 1.5, use the following command:

cd /app/Hunyuanvideo_1_5
   mkdir results
   torchrun --nproc_per_node=8 /app/Hunyuanvideo_1_5/run.py \
   --model hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-720p_t2v \
   --prompt "In the large cage, two puppies were wagging their tails at each other." \
   --task t2v \
   --height 720 --width 1280 \
   --seed 1168860793 \
   --num_frames 129 \
   --num_inference_steps 50 \
   --num_repetitions 1 \
   --ulysses_degree 8 \
   --enable_tiling --enable_slicing \
   --use_torch_compile \
   --attention_backend aiter \
   --benchmark_output_directory results

The generated video will be stored under the results directory.

  1. Clone the ROCm Model Automation and Dashboarding (ROCm/MAD) repository to a local directory and install the required packages on the host machine.

    git clone https://github.com/ROCm/MAD
    cd MAD
    pip install -r requirements.txt
    
  2. On the host machine, use this command to run the performance benchmark test on the Wan2.1 model using one node.

    export MAD_SECRETS_HFTOKEN="your personal Hugging Face token to access gated models"
    madengine run \
        --tags pyt_xdit_wan_2_1 \
        --keep-model-dir \
        --live-output
    

MAD launches a Docker container with the name container_ci-pyt_xdit_wan_2_1. The throughput and serving reports of the model are collected in the following paths: pyt_xdit_wan_2_1_throughput.csv and pyt_xdit_wan_2_1_serving.csv.

To run the benchmarks for Wan2.1, use the following command:

cd /app/Wan
   mkdir results
   torchrun --nproc_per_node=8 /app/Wan/run.py \
   --model Wan-AI/Wan2.1-I2V-14B-720P-Diffusers \
   --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside." \
   --task i2v \
   --height 720 \
   --width 1280 \
   --img_file_path /app/Wan/i2v_input.JPG \
   --num_frames 81 \
   --ulysses_degree 8 \
   --seed 42 \
   --num_repetitions 1 \
   --num_inference_steps 40 \
   --use_torch_compile \
   --attention_backend aiter \
   --benchmark_output_directory results

The generated video will be stored under the results directory.

  1. Clone the ROCm Model Automation and Dashboarding (ROCm/MAD) repository to a local directory and install the required packages on the host machine.

    git clone https://github.com/ROCm/MAD
    cd MAD
    pip install -r requirements.txt
    
  2. On the host machine, use this command to run the performance benchmark test on the Wan2.2 model using one node.

    export MAD_SECRETS_HFTOKEN="your personal Hugging Face token to access gated models"
    madengine run \
        --tags pyt_xdit_wan_2_2 \
        --keep-model-dir \
        --live-output
    

MAD launches a Docker container with the name container_ci-pyt_xdit_wan_2_2. The throughput and serving reports of the model are collected in the following paths: pyt_xdit_wan_2_2_throughput.csv and pyt_xdit_wan_2_2_serving.csv.

To run the benchmarks for Wan2.2, use the following command:

cd /app/Wan
   mkdir results
   torchrun --nproc_per_node=8 /app/Wan/run.py \
   --model Wan-AI/Wan2.2-I2V-A14B-Diffusers \
   --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside." \
   --task i2v \
   --height 720 \
   --width 1280 \
   --img_file_path /app/Wan/i2v_input.JPG \
   --num_frames 81 \
   --ulysses_degree 8 \
   --seed 42 \
   --num_repetitions 1 \
   --num_inference_steps 40 \
   --use_torch_compile \
   --attention_backend aiter \
   --benchmark_output_directory results

The generated video will be stored under the results directory.

  1. Clone the ROCm Model Automation and Dashboarding (ROCm/MAD) repository to a local directory and install the required packages on the host machine.

    git clone https://github.com/ROCm/MAD
    cd MAD
    pip install -r requirements.txt
    
  2. On the host machine, use this command to run the performance benchmark test on the FLUX.1 model using one node.

    export MAD_SECRETS_HFTOKEN="your personal Hugging Face token to access gated models"
    madengine run \
        --tags pyt_xdit_flux \
        --keep-model-dir \
        --live-output
    

MAD launches a Docker container with the name container_ci-pyt_xdit_flux. The throughput and serving reports of the model are collected in the following paths: pyt_xdit_flux_throughput.csv and pyt_xdit_flux_serving.csv.

To run the benchmarks for FLUX.1, use the following command:

cd /app/Flux
   mkdir results
   torchrun --nproc_per_node=8 /app/Flux/run.py \
   --model black-forest-labs/FLUX.1-dev \
   --seed 42 \
   --prompt "A small cat" \
   --height 1024 \
   --width 1024 \
   --num_inference_steps 25 \
   --max_sequence_length 256 \
   --warmup_steps 5 \
   --no_use_resolution_binning \
   --ulysses_degree 8 \
   --use_torch_compile \
   --guidance_scale 0.0 \
   --num_repetitions 50 \
   --attention_backend aiter \
   --benchmark_output_directory results

The generated video will be stored under the results directory.

You may also use run_usp.py which implements USP without modifying the default diffusers pipeline.

  1. Clone the ROCm Model Automation and Dashboarding (ROCm/MAD) repository to a local directory and install the required packages on the host machine.

    git clone https://github.com/ROCm/MAD
    cd MAD
    pip install -r requirements.txt
    
  2. On the host machine, use this command to run the performance benchmark test on the FLUX.1 Kontext model using one node.

    export MAD_SECRETS_HFTOKEN="your personal Hugging Face token to access gated models"
    madengine run \
        --tags pyt_xdit_flux_kontext \
        --keep-model-dir \
        --live-output
    

MAD launches a Docker container with the name container_ci-pyt_xdit_flux_kontext. The throughput and serving reports of the model are collected in the following paths: pyt_xdit_flux_kontext_throughput.csv and pyt_xdit_flux_kontext_serving.csv.

To run the benchmarks for FLUX.1 Kontext, use the following command:

cd /app/Flux
   mkdir results
   torchrun --nproc_per_node=8 /app/Flux/run_usp.py \
   --model black-forest-labs/FLUX.1-Kontext-dev \
   --seed 42 \
   --prompt "Add a cool hat to the cat" \
   --height 1024 \
   --width 1024 \
   --num_inference_steps 30 \
   --max_sequence_length 512 \
   --warmup_steps 5 \
   --no_use_resolution_binning \
   --ulysses_degree 8 \
   --use_torch_compile \
   --img_file_path /app/Flux/cat.png \
   --model_type flux_kontext \
   --guidance_scale 2.5 \
   --num_repetitions 25 \
   --attention_backend aiter \
   --benchmark_output_directory results

The generated video will be stored under the results directory.

  1. Clone the ROCm Model Automation and Dashboarding (ROCm/MAD) repository to a local directory and install the required packages on the host machine.

    git clone https://github.com/ROCm/MAD
    cd MAD
    pip install -r requirements.txt
    
  2. On the host machine, use this command to run the performance benchmark test on the FLUX.2 model using one node.

    export MAD_SECRETS_HFTOKEN="your personal Hugging Face token to access gated models"
    madengine run \
        --tags pyt_xdit_flux_2 \
        --keep-model-dir \
        --live-output
    

MAD launches a Docker container with the name container_ci-pyt_xdit_flux_2. The throughput and serving reports of the model are collected in the following paths: pyt_xdit_flux_2_throughput.csv and pyt_xdit_flux_2_serving.csv.

To run the benchmarks for FLUX.2, use the following command:

cd /app/Flux
   mkdir results
   torchrun --nproc_per_node=8 /app/Flux/run_usp.py \
   --model black-forest-labs/FLUX.2-dev \
   --seed 42 \
   --prompt "Add a cool hat to the cat" \
   --height 1024 \
   --width 1024 \
   --num_inference_steps 50 \
   --max_sequence_length 512 \
   --warmup_steps 5 \
   --no_use_resolution_binning \
   --ulysses_degree 8 \
   --use_torch_compile \
   --img_file_paths /app/Flux/cat.png \
   --model_type flux2 \
   --guidance_scale 4.0 \
   --num_repetitions 25 \
   --attention_backend aiter \
   --benchmark_output_directory results

The generated video will be stored under the results directory.

  1. Clone the ROCm Model Automation and Dashboarding (ROCm/MAD) repository to a local directory and install the required packages on the host machine.

    git clone https://github.com/ROCm/MAD
    cd MAD
    pip install -r requirements.txt
    
  2. On the host machine, use this command to run the performance benchmark test on the stable-diffusion-3.5-large model using one node.

    export MAD_SECRETS_HFTOKEN="your personal Hugging Face token to access gated models"
    madengine run \
        --tags pyt_xdit_sd_3_5 \
        --keep-model-dir \
        --live-output
    

MAD launches a Docker container with the name container_ci-pyt_xdit_sd_3_5. The throughput and serving reports of the model are collected in the following paths: pyt_xdit_sd_3_5_throughput.csv and pyt_xdit_sd_3_5_serving.csv.

To run the benchmarks for stable-diffusion-3.5-large, use the following command:

cd /app/StableDiffusion3.5
   mkdir results
   torchrun --nproc_per_node=8 /app/StableDiffusion3.5/run.py \
   --model stabilityai/stable-diffusion-3.5-large \
   --prompt "A capybara holding a sign that reads Hello World" \
   --num_repetitions 50 \
   --num_inference_steps 28 \
   --pipefusion_parallel_degree 4 \
   --use_cfg_parallel \
   --use_torch_compile \
   --dtype torch.float16 \
   --attention_backend aiter \
   --benchmark_output_directory results

The generated video will be stored under the results directory.

  1. Clone the ROCm Model Automation and Dashboarding (ROCm/MAD) repository to a local directory and install the required packages on the host machine.

    git clone https://github.com/ROCm/MAD
    cd MAD
    pip install -r requirements.txt
    
  2. On the host machine, use this command to run the performance benchmark test on the Z-Image Turbo model using one node.

    export MAD_SECRETS_HFTOKEN="your personal Hugging Face token to access gated models"
    madengine run \
        --tags pyt_xdit_z_image_turbo \
        --keep-model-dir \
        --live-output
    

MAD launches a Docker container with the name container_ci-pyt_xdit_z_image_turbo. The throughput and serving reports of the model are collected in the following paths: pyt_xdit_z_image_turbo_throughput.csv and pyt_xdit_z_image_turbo_serving.csv.

To run the benchmarks for Z-Image Turbo, use the following command:

cd /app/Z-Image
   mkdir results
   torchrun --nproc_per_node=2 /app/Z-Image/run.py \
   --model Tongyi-MAI/Z-Image-Turbo \
   --seed 42 \
   --prompt "A crowded beach" \
   --height 1088 \
   --width 1920 \
   --num_inference_steps 9 \
   --ulysses_degree 2 \
   --use_torch_compile \
   --guidance_scale 0.0 \
   --num_repetitions 50 \
   --attention_backend aiter \
   --benchmark_output_directory results

The generated video will be stored under the results directory.