Skip to content

Commit

Permalink
core: add rough it/s
Browse files Browse the repository at this point in the history
  • Loading branch information
isidentical committed Nov 4, 2023
1 parent fa8e8eb commit 9ae0a2e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ better understanding of their performance and scalability.
Running on an A100 80G SXM hosted at [fal.ai](https://fal.ai).

<!-- START TABLE -->
| | mean (s) | median (s) | min (s) | max (s) |
|------------------|----------|------------|---------|---------|
| Diffusers SD1.5 | 1.619s | 1.614s | 1.603s | 1.645s |
| Diffusers SDXL | 5.916s | 5.917s | 5.909s | 5.927s |
| | mean (s) | median (s) | min (s) | max (s) | speed (it/s) |
|------------------|----------|------------|---------|---------|--------------|
| Diffusers SD1.5 | 1.619s | 1.614s | 1.603s | 1.645s | 30.97 it/s |
| Diffusers SDXL | 5.916s | 5.917s | 5.909s | 5.927s | 8.45 it/s |
<!-- END TABLE -->

Generation options:
Expand Down
14 changes: 11 additions & 3 deletions benchmarks/update_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
from pathlib import Path

README_PATH = Path(__file__).parent.parent / "README.md"
TABLE_HEADER = "| | mean (s) | median (s) | min (s) | max (s) |\n"
TABLE_DIVIDER = "|------------------|----------|------------|---------|---------|\n"
TABLE_HEADER = (
"| | mean (s) | median (s) | min (s) | max (s) | speed (it/s) |\n"
)
TABLE_DIVIDER = (
"|------------------|----------|------------|---------|---------|--------------|\n"
)
TABLE_ROW_FORMAT = (
"| {name:16} | {mean:7.3f}s | {median:9.3f}s | {min:6.3f}s | {max:6.3f}s |\n"
"| {name:16} | {mean:7.3f}s | {median:9.3f}s "
"| {min:6.3f}s | {max:6.3f}s | {speed:7.2f} it/s |\n"
)
START_MARKER = "<!-- START TABLE -->\n"
END_MARKER = "<!-- END TABLE -->\n"
Expand All @@ -26,6 +31,8 @@ def main():
lines = f.readlines()

table_lines = [TABLE_HEADER, TABLE_DIVIDER]

steps = results["parameters"]["steps"]
for timing in results["timings"]:
benchmark_name = timing["name"]
benchmark_timings = timing["timings"]
Expand All @@ -36,6 +43,7 @@ def main():
median=statistics.median(benchmark_timings),
min=min(benchmark_timings),
max=max(benchmark_timings),
speed=statistics.median(steps / timing for timing in benchmark_timings),
)
)

Expand Down

0 comments on commit 9ae0a2e

Please sign in to comment.