From a1b4a475e1c9aee6fa15ba2c85797ec87377021b Mon Sep 17 00:00:00 2001 From: Angelos Katharopoulos Date: Wed, 6 Dec 2023 15:22:46 -0800 Subject: [PATCH] Clarification in the stable diffusion readme --- stable_diffusion/README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/stable_diffusion/README.md b/stable_diffusion/README.md index 170ce6b9..edd3a0ed 100644 --- a/stable_diffusion/README.md +++ b/stable_diffusion/README.md @@ -65,8 +65,9 @@ Performance ----------- The following table compares the performance of the UNet in stable diffusion. -We report throughput in images per second for the provided `txt2image.py` -script and the `diffusers` library using the MPS PyTorch backend. +We report throughput in images per second **processed by the UNet** for the +provided `txt2image.py` script and the `diffusers` library using the MPS +PyTorch backend. At the time of writing this comparison convolutions are still some of the least optimized operations in MLX. Despite that, MLX still achieves **~40% higher @@ -93,3 +94,7 @@ The above experiments were made on an M2 Ultra with PyTorch version 2.1, diffusers version 0.21.4 and transformers version 4.33.3. For the generation we used classifier free guidance which means that the above batch sizes result double the images processed by the UNet. + +Note that the above table means that it takes about 90 seconds to fully +generate 16 images with MLX and 50 diffusion steps with classifier free +guidance and about 120 for PyTorch.