Skip to content

Commit 0c9fbc7

Browse files
committed
update latency graph rtx8000, update readme.md results section
1 parent 437689b commit 0c9fbc7

4 files changed

Lines changed: 9 additions & 12 deletions

File tree

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.formatting.provider": "black"
3+
}

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,7 @@ python ./scripts/benchmark.py
122122

123123
### Results
124124

125-
|device |precision|n_samples|latency |memory|
126-
|----------------|---------|---------|-------------|------|
127-
|NVIDIA RTX A6000|single |1 |4736.85498 ms|8.97G |
128-
|NVIDIA RTX A6000|half |1 |4775.88759 ms|4.48G |
129-
|NVIDIA RTX A6000|single |2 |8786.72098 ms|11.1G |
130-
|NVIDIA RTX A6000|half |2 |8834.01660 ms|8.78G |
131-
125+
<img src="./docs/pictures/pretty_benchmark_sd_txt2img_latency.png" alt="Stable Diffusion Text2Image Latency (seconds)" width="850"/>
132126

133127
## Links
134128

docs/benchmark.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ We believe Ampere GPUs enjoy a relatively "smaller" speedup from half-precision
2323

2424
We run these same inference jobs CPU devices to put in perspective the inference speed performance observed on GPU.
2525

26-
<img src="./pictures/pretty_benchmark_sd_txt2img_gpu_vs_cpu.png" alt="Stable Diffusion Text2Image Latency (seconds)" width="700"/>
26+
<img src="./pictures/pretty_benchmark_sd_txt2img_gpu_vs_cpu.png" alt="Stable Diffusion Text2Image GPU v CPU" width="700"/>
2727

2828

2929
We note that:
@@ -58,7 +58,7 @@ Our throughput benchmark pushes the batch size to the maximum for each GPU, and
5858

5959
We run a series of throughput experiment in pytorch with half-precision and using the maximum batch size that can be used for each GPU:
6060

61-
<img src="./pictures/pretty_benchmark_sd_txt2img_throughput.png" alt="Stable Diffusion Text2Image Throughput (images/minute)]" width="390"/>
61+
<img src="./pictures/pretty_benchmark_sd_txt2img_throughput.png" alt="Stable Diffusion Text2Image Throughput (images/minute)" width="390"/>
6262

6363
We note:
6464
* Once again, A100 80GB is the top performer and has the highest throughput.
@@ -67,20 +67,20 @@ We note:
6767

6868
As a concrete example, the chart below shows how A100 80GB's throughput increases by `64%` when we changed the batch size from 1 to 28 (the largest without causing an out of memory error). It is also interesting to see that the increase is not linear and flattens out when batch size reaches a certain value, at which point the tensor cores on the GPU are saturated and any new data in the GPU memory will have to be queued up before getting their own computing resources.
6969

70-
<img src="./pictures/pretty_benchmark_sd_txt2img_batchsize_vs_throughput.png" alt="Stable Diffusion Text2Image Throughput (images/minute)" width="380"/>
70+
<img src="./pictures/pretty_benchmark_sd_txt2img_batchsize_vs_throughput.png" alt="Stable Diffusion Text2Image Batch size vs Throughput (images/minute)" width="380"/>
7171

7272

7373
## Precision
7474

7575
We are curious about whether half-precision introduces degradations to the quality of the output images. To test this out, we fixed the text prompt as well as the "latent" input vector and fed them to the single-precision model and the half-precision model. We ran the inference for 100 steps and saved both models' outputs at each step, as well as the difference map:
7676

77-
![Stable Diffusion Text2Image Throughput (images/minute)](./pictures/benchmark_sd_precision_history.gif)
77+
![Evolution of precision v degradation across 100 steps](./pictures/benchmark_sd_precision_history.gif)
7878

7979
Our observation is that there are indeed visible differences between the single-precision output and the half-precision output, especially in the early steps. The differences often decrease with the number of steps, but might not always vanish.
8080

8181
Interestingly, such a difference may not imply artifacts in half-precision's outputs. For example, in step 70, the picture below shows half-precision didn't produce the artifact in the single-precision output (an extra front leg):
8282

83-
![Stable Diffusion Text2Image Throughput (images/minute)](./pictures/benchmark_sd_precision_step_70.png)
83+
![Precision v Degradation at step 70](./pictures/benchmark_sd_precision_step_70.png)
8484

8585
---
8686

18.2 KB
Loading

0 commit comments

Comments
 (0)