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")
Metadata
Release files for ready-steady-go 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ready_steady_go-0.0.1.tar.gz | 7.1 kB | Without provenance | Details for ready_steady_go-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ready_steady_go-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for ready_steady_go-0.0.1-py3-none-any.whl |
Total release size: 14.0 kB
Release files / ready_steady_go-0.0.1.tar.gz
| Download URL | ready_steady_go-0.0.1.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16db2f13d1cc6b8ce862a63bd01c3294850a2859a360179c4404ea3081e7598a
|
|
BLAKE2b-256 checksum How to use checksums |
75148f8416883a046affa0056cf398dec00b87451cbd319ebaf0a305fffdc8d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / ready_steady_go-0.0.1-py3-none-any.whl
| Download URL | ready_steady_go-0.0.1-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d07a4f5b3631725d9e0314103d3e617aadf76c4a2d193f68b1f7a8ffd0c96281
|
|
BLAKE2b-256 checksum How to use checksums |
16561cd92786ae4015ff944557ceb63490128072fffb2562fccd96dd764a4faa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for ready-steady-go 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.