Skip to main content

Synthetic Deep Learning GPU benchmark

Project description

Ready, Steady, Go!

It’s fall 2022, and for the first time in years, buying a GPU for Deep Learning experiments does not sound too crazy.

Now, how do we pick one?

Keep in mind, performance depends on many factors, not least your CPU and often SSD.
For experiments, you might be better off with 2 cheaper GPUs - one to run in background, the other used interactively.

My Results

import wandb
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
import numpy as np

I ran the benchmark on a variety of GPUs from vast.ai. The results are automatically synced to Weights & Biases.

sns.set_theme(style="whitegrid")
sns.set_color_codes("pastel")

api = wandb.Api()

runs = api.runs("xl0/ready-steady-go")
summaries = [ dict(r.summary) | {"id": r.id} for r in runs if r.state == "finished"]

df = pd.DataFrame.from_records(summaries)

df = df[["device_name", "model", "bs", "fp16", "throughput"]]
df["fp16"] = df["fp16"].apply(lambda x: "FP16" if x else "FP32")
df = df.replace({"device_name" : {
                        "NVIDIA*": "",
                        "GeForce": "",
                        "Tesla": "",
                        "-": " "}}, regex=True)
df.dropna(inplace=True)

# For each model, normalize performance by top throughput.
for model in df.model.unique():
    df.loc[ df.model == model, "throughput"] /= df.loc[df.model == model, "throughput"].max()
df["throughput"] *= 100
# For each device+model+fp, get the index of the entry with the highest throughput.
max_bs_idx = df.groupby(["device_name", "model", "fp16"])["throughput"].idxmax()

for model in df.model.unique():   
    f, ax = plt.subplots(figsize=(15, 6))
    
    tops = df.loc[max_bs_idx].query(f"model == '{model}'").sort_values("throughput", ascending=False)

    sns.set_color_codes("pastel")
    sns.barplot(ax=ax, data=tops.query("fp16 == 'FP16'"),
                x="throughput", y="device_name", label="FP16", color="b", alpha=1)

    sns.set_color_codes("muted")
    sns.barplot(ax=ax, data=tops.query("fp16 == 'FP32'"),
                x="throughput", y="device_name", label="FP32", color="b", alpha=0.8,
                order=tops.query("fp16 == 'FP16'").sort_values("throughput", ascending=False).device_name)

    ax.legend(ncol=2, loc="lower right", frameon=True)
    ax.set(ylabel=None, xlabel=None, title=model)

f, ax = plt.subplots(figsize=(15, 6))

tops = df.loc[max_bs_idx].sort_values("throughput", ascending=False)
# tops


fp16s = df.loc[max_bs_idx].query("fp16=='FP16'")
grouped = fp16s.groupby(["device_name"], as_index=False)["throughput"]

display_order = grouped.mean().sort_values("throughput", ascending=False)


sns.set_color_codes("pastel")
tt= sns.barplot(ax=ax, data=tops.loc[tops.fp16.eq('FP16')],
            x="throughput", y="device_name", label="FP16", color="b", errwidth=0,
            order=display_order.device_name)

# f, ax = plt.subplots(figsize=(15, 6))

sns.set_color_codes("muted")
sns.barplot(ax=ax, data=tops.loc[tops.fp16.eq('FP32')],
            x="throughput", y="device_name", label="FP32", color="b", errwidth=0,
            order=display_order.device_name)
        

ax.legend(ncol=2, loc="lower right", frameon=True)
_ = ax.set(ylabel=None, xlabel=None, title="Average between all models")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ready_steady_go-0.0.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ready_steady_go-0.0.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file ready_steady_go-0.0.1.tar.gz.

File metadata

  • Download URL: ready_steady_go-0.0.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for ready_steady_go-0.0.1.tar.gz
Algorithm Hash digest
SHA256 16db2f13d1cc6b8ce862a63bd01c3294850a2859a360179c4404ea3081e7598a
MD5 bfe8b3d7db68bad3f3106dc615c289a6
BLAKE2b-256 75148f8416883a046affa0056cf398dec00b87451cbd319ebaf0a305fffdc8d8

See more details on using hashes here.

File details

Details for the file ready_steady_go-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ready_steady_go-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d07a4f5b3631725d9e0314103d3e617aadf76c4a2d193f68b1f7a8ffd0c96281
MD5 72aef2822f0138b4bf385a86549c9e09
BLAKE2b-256 16561cd92786ae4015ff944557ceb63490128072fffb2562fccd96dd764a4faa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page