Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
239 changes: 96 additions & 143 deletions README.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/5090/double_model_train_benchmark_resnet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/5090/double_model_train_benchmark_vgg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/5090/float_model_inference_benchmark_vgg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/5090/float_model_train_benchmark_mnasnet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/5090/float_model_train_benchmark_resnet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/5090/float_model_train_benchmark_vgg.png
Binary file added fig/5090/half_model_inference_benchmark_vgg.png
Binary file added fig/5090/half_model_train_benchmark_densenet.png
Binary file added fig/5090/half_model_train_benchmark_mnasnet.png
Binary file added fig/5090/half_model_train_benchmark_resnet.png
Binary file added fig/5090/half_model_train_benchmark_vgg.png
191 changes: 191 additions & 0 deletions plot_comparison.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "ccd5f401",
"metadata": {},
"source": [
"Comparing RTX5090-32GB results from different operating system (Windows11/WSL(Debian)/Linux(Fedora)). Using A100-SXM4-40GB results as reference."
]
},
{
"cell_type": "markdown",
"id": "a9af3974",
"metadata": {},
"source": [
"You need to change output dir `output_folder`."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ff083421",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import glob\n",
"import plotly.express as px\n",
"import plotly.graph_objects as go\n",
"import torchvision.models as models\n",
"output_folder = \"fig/5090/\""
]
},
{
"cell_type": "markdown",
"id": "e072b9c4",
"metadata": {},
"source": [
"You need to include the data you want in `CSV_DIC`."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "abd92c0a",
"metadata": {},
"outputs": [],
"source": [
"MODEL_DIC = {\n",
" 'mnasnet': models.mnasnet.__all__[1:],\n",
" 'resnet': models.resnet.__all__[1:],\n",
" 'densenet': models.densenet.__all__[1:],\n",
" 'squeezenet': models.squeezenet.__all__[1:],\n",
" 'vgg': models.vgg.__all__[1:],\n",
" 'mobilenet': models.mobilenet.__all__[1:],\n",
" 'shufflenetv2': models.shufflenetv2.__all__[1:]\n",
"}\n",
"model_list = MODEL_DIC.keys()\n",
"\n",
"REV_MODEL_DIC = {}\n",
"for key, values in MODEL_DIC.items():\n",
" for v in values:\n",
" REV_MODEL_DIC[v] = key\n",
"\n",
"BENCHMARK_TYPE = {\n",
" 'half_model_train_benchmark',\n",
" 'half_model_inference_benchmark', \n",
" 'float_model_train_benchmark',\n",
" 'float_model_inference_benchmark',\n",
" 'double_model_train_benchmark',\n",
" 'double_model_inference_benchmark'\n",
"}\n",
"\n",
"CSV_DIC = {\n",
" 'RTX5090/WIN11': glob.glob('results/5090/Win11/'+'*.csv'),\n",
" 'RTX5090/WSL': glob.glob('results/5090/WSL/'+'*.csv'),\n",
" 'RTX5090/Fedora': glob.glob('results/5090/Fedora/'+'*.csv'),\n",
" 'A100-SXM4-40GB': glob.glob('results/dgx-a100/'+'A100-SXM4-40GB_1*.csv')\n",
"}\n",
"gpu_list = CSV_DIC.keys()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bd6367a5",
"metadata": {},
"outputs": [],
"source": [
"data_buffer = []\n",
"for btype in BENCHMARK_TYPE:\n",
" for gpu in gpu_list:\n",
" found_csv = [item for item in CSV_DIC[gpu] if btype in item]\n",
" df = pd.read_csv(found_csv[0])\n",
" df['run'] = df.index + 1\n",
" df['gpu'] = gpu\n",
" df['benchmark_type'] = btype\n",
" df_melted = df.melt(id_vars=['run', 'gpu', 'benchmark_type'], var_name='model', value_name='latency')\n",
" df_melted['model_type'] = df_melted['model'].map(REV_MODEL_DIC)\n",
" data_buffer.append(df_melted)\n",
"all_data = pd.concat(data_buffer, ignore_index=True)\n",
"all_data = all_data.set_index(['benchmark_type', 'model_type'])\n",
"all_data = all_data.sort_index()\n"
]
},
{
"cell_type": "markdown",
"id": "34460c49",
"metadata": {},
"source": [
"Preview a figure for testing."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a600b299",
"metadata": {},
"outputs": [],
"source": [
"fig = px.box(\n",
" all_data.loc[('double_model_train_benchmark', 'resnet')],\n",
" y=\"latency\",\n",
" color=\"gpu\",\n",
" facet_col=\"model\", # facet_col / facet_row\n",
" title=\"Latency by Model and GPU/\" + \"double_model_train_benchmark\"\n",
")\n",
"fig.update_traces(boxmean=True)\n",
"#fig.update_yaxes(dtick=50)\n",
"\n",
"for annotation in fig.layout.annotations:\n",
" annotation.text = annotation.text.replace(\"model=\", \"\")\n",
" # annotation.textangle = -15\n",
"\n",
"fig.show()\n",
"#fig.write_image(\"output.png\", width=3000, height=1000)\n",
"#fig.write_image(\"output.png\", width=1500, scale=2)"
]
},
{
"cell_type": "markdown",
"id": "2fb8040d",
"metadata": {},
"source": [
"Generate all figures."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "134bec11",
"metadata": {},
"outputs": [],
"source": [
"for idx in all_data.index.unique().tolist():\n",
" fig = px.box(\n",
" all_data.loc[idx],\n",
" y=\"latency\",\n",
" color=\"gpu\",\n",
" facet_col=\"model\", # facet_col / facet_row\n",
" title=\"Latency by Model and GPU/\" + idx[0]\n",
" )\n",
" fig.update_traces(boxmean=True)\n",
" for annotation in fig.layout.annotations:\n",
" annotation.text = annotation.text.replace(\"model=\", \"\")\n",
" fig.write_image(output_folder+idx[0]+'_'+idx[1]+\".png\", width=1500, scale=2)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
1 change: 1 addition & 0 deletions requirement.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ pandas
plotly
cufflinks
psutil
kaleido
Loading