Skip to content

Stable Diffusion

The benchmark reference for Stable Diffusion can be found in this link, and here is the PR for the minified benchmark implementation: link.

This video explains all the following steps:

IMAGE ALT TEXT HERE

Project setup

An important requirement is that you must have Docker installed.

# Create Python environment and install MLCube Docker runner 
virtualenv -p python3 ./env && source ./env/bin/activate && pip install pip==24.0
pip install mlcube-docker
# Fetch the implementation from GitHub
git clone https://github.com/mlcommons/training && cd ./training
git fetch origin pull/696/head:feature/mlcube_sd && git checkout feature/mlcube_sd
cd ./stable_diffusion/mlcube

Inside the mlcube directory run the following command to check implemented tasks.

mlcube describe

MLCube tasks

  • Core tasks:

Download dataset.

mlcube run --task=download_data

Download models.

mlcube run --task=download_models

Train.

mlcube run --task=train
  • Demo tasks:

Download demo dataset.

mlcube run --task=download_demo

Download models.

mlcube run --task=download_models

Train demo.

mlcube run --task=demo

Execute the complete pipeline

You can execute the complete pipeline with one single command.

  • Core pipeline:
mlcube run --task=download_data,download_models,train
  • Demo pipeline:

Tested in an Nvidia A100 (40G)

mlcube run --task=download_demo,download_models,demo

Note: To rebuild the image use the flag: -Pdocker.build_strategy=always during the mlcube run command.