Skip to content

Commit

Permalink
core: sort benchmarks by speed
Browse files Browse the repository at this point in the history
  • Loading branch information
isidentical committed Nov 4, 2023
1 parent 879ada1 commit 627257f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Running on an A100 80G SXM hosted at [fal.ai](https://fal.ai).
### SD1.5 Benchmarks
| | mean (s) | median (s) | min (s) | max (s) | speed (it/s) |
|------------------|----------|------------|---------|---------|--------------|
| Diffusers (fp16, SDPA) | 1.591s | 1.590s | 1.581s | 1.601s | 31.44 it/s |
| Diffusers (fp16, xformers) | 1.758s | 1.759s | 1.746s | 1.772s | 28.43 it/s |
| Diffusers (fp16, SDPA) | 1.591s | 1.590s | 1.581s | 1.601s | 31.44 it/s |
| Diffusers (fp16, SDPA, compiled) | 1.352s | 1.351s | 1.348s | 1.356s | 37.01 it/s |
| Diffusers (fp16, SDPA, compiled, NCHW channels last) | 1.066s | 1.065s | 1.062s | 1.076s | 46.95 it/s |
| TensorRT 9.0 (cuda graphs, static shapes) | 0.819s | 0.818s | 0.817s | 0.821s | 61.14 it/s |
Expand Down
8 changes: 6 additions & 2 deletions benchmarks/update_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ def main():

all_rows = defaultdict(list)
steps = results["parameters"]["steps"]
for timing in results["timings"]:
for timing in sorted(
results["timings"],
key=lambda timing: statistics.mean(timing["timings"]),
reverse=True,
):
benchmark_name = timing["name"]
benchmark_timings = timing["timings"]
row = TABLE_ROW_FORMAT.format(
Expand All @@ -47,7 +51,7 @@ def main():
all_rows[timing["category"]].append(row)

tables = []
for category, rows in all_rows.items():
for category, rows in sorted(all_rows.items(), key=lambda kv: kv[0]):
tables.append(f"### {category} Benchmarks\n")
tables.append(TABLE_HEADER)
tables.append(TABLE_DIVIDER)
Expand Down

0 comments on commit 627257f

Please sign in to comment.