Skip to content

Commit

Permalink
Updated Throughput Results
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnateja95 committed Oct 29, 2024
1 parent 943daf6 commit fffdd3b
Show file tree
Hide file tree
Showing 55 changed files with 19,288 additions and 41 deletions.
490 changes: 490 additions & 0 deletions Plots/Fig_10/.ipynb_checkpoints/Figure 10-checkpoint.ipynb

Large diffs are not rendered by default.

320 changes: 320 additions & 0 deletions Plots/Fig_11/.ipynb_checkpoints/Fig_11-checkpoint.ipynb

Large diffs are not rendered by default.

297 changes: 297 additions & 0 deletions Plots/Fig_12/.ipynb_checkpoints/Fig 12-checkpoint.ipynb

Large diffs are not rendered by default.

355 changes: 355 additions & 0 deletions Plots/Fig_13/.ipynb_checkpoints/Fig_13-checkpoint.ipynb

Large diffs are not rendered by default.

333 changes: 333 additions & 0 deletions Plots/Fig_14/.ipynb_checkpoints/Fig 14-checkpoint.ipynb

Large diffs are not rendered by default.

325 changes: 325 additions & 0 deletions Plots/Fig_15/.ipynb_checkpoints/Fig 15-checkpoint.ipynb

Large diffs are not rendered by default.

378 changes: 378 additions & 0 deletions Plots/Fig_16_a/.ipynb_checkpoints/Fig 16 a-checkpoint.ipynb

Large diffs are not rendered by default.

457 changes: 457 additions & 0 deletions Plots/Fig_16_a_b/.ipynb_checkpoints/Fig 16 a b-checkpoint.ipynb

Large diffs are not rendered by default.

360 changes: 360 additions & 0 deletions Plots/Fig_16_a_b/.ipynb_checkpoints/Fig 16 a-checkpoint.ipynb

Large diffs are not rendered by default.

363 changes: 363 additions & 0 deletions Plots/Fig_16_a_b/.ipynb_checkpoints/Fig 16 b-checkpoint.ipynb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

306 changes: 306 additions & 0 deletions Plots/Fig_17/.ipynb_checkpoints/Fig_13_a-checkpoint.ipynb

Large diffs are not rendered by default.

321 changes: 321 additions & 0 deletions Plots/Fig_17/.ipynb_checkpoints/Fig_17-checkpoint.ipynb

Large diffs are not rendered by default.

308 changes: 308 additions & 0 deletions Plots/Fig_18/.ipynb_checkpoints/Fig 14 a-checkpoint.ipynb

Large diffs are not rendered by default.

318 changes: 318 additions & 0 deletions Plots/Fig_18/.ipynb_checkpoints/Fig 18-checkpoint.ipynb

Large diffs are not rendered by default.

160 changes: 160 additions & 0 deletions Plots/Fig_18/.ipynb_checkpoints/get_SN40L_results-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "ce6e6f7c",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "b1432d29",
"metadata": {},
"outputs": [],
"source": [
"\n",
"\n",
"file_name = \"SN40L_updated_results.csv\"\n",
"\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "35cfc93b",
"metadata": {},
"outputs": [],
"source": [
"import csv\n",
"\n",
"def read_csv_without_header(csv_file):\n",
" with open(csv_file, \"r\", newline=\"\") as f:\n",
" reader = csv.reader(f)\n",
" next(reader)\n",
"\n",
" rows = []\n",
" for row in reader:\n",
" rows.append(row)\n",
" return rows\n",
"\n",
"\n",
"def get_matching_row(hardware, numhardware, framework, network, inp_out, batch):\n",
" csv_file = \"../SN40L_updated_results.csv\"\n",
" rows = read_csv_without_header(csv_file)\n",
" \n",
" for row in rows:\n",
" if row != []:\n",
" Hardware = str(row[0]) \n",
" Num_of_Hardware = int(row[1])\n",
" Framework = str(row[2])\n",
" Model = str(row[3])\n",
" Input_Output_Length = int(row[4]) \n",
" Batch_Size = int(row[5])\n",
" Throughput = float(row[6])\n",
" \n",
" \n",
" if Hardware == hardware:\n",
" if Num_of_Hardware == numhardware:\n",
" if Framework == framework:\n",
" if Model == network:\n",
" if Input_Output_Length == inp_out:\n",
" if Batch_Size == batch:\n",
" latency = float((batch*(Input_Output_Length + Input_Output_Length))/Throughput)\n",
" \n",
" list_1 = [Hardware,Num_of_Hardware,Framework,Model,Input_Output_Length,Batch_Size,latency,Throughput]\n",
" \n",
" with open(\"SN40L_latency_throughput.csv\", 'a', newline = '') as csvfile:\n",
" writer = csv.writer(csvfile)\n",
" writer.writerow(list_1) \n",
" \n",
" csvfile.close()\n",
" \n",
"def get_data_rows():\n",
" \n",
" for framework in [\"sambaflow\"]:\n",
" for hardware in [\"SambaNova SN40L\"]:\n",
" for network in [\"meta-llama/Meta-Llama-3-70B\"]:\n",
" inp_out_list = []\n",
" for inp_out in [128, 256, 512, 1024, 2048]:\n",
" for numhardware in [8]:\n",
" for batch in [1,16]:\n",
" get_matching_row(hardware, numhardware, framework, network, inp_out, batch)\n",
"get_data_rows() "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "97aab62d",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "fbf08689",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "103697c9",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "9bf8c083",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "7a35ca51",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "1cfc74dc",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.11.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
281 changes: 281 additions & 0 deletions Plots/Fig_19/.ipynb_checkpoints/Fig 14 b-checkpoint.ipynb

Large diffs are not rendered by default.

293 changes: 293 additions & 0 deletions Plots/Fig_19/.ipynb_checkpoints/Fig 19-checkpoint.ipynb

Large diffs are not rendered by default.

281 changes: 281 additions & 0 deletions Plots/Fig_1_a/.ipynb_checkpoints/Fig_1_a-checkpoint.ipynb

Large diffs are not rendered by default.

176 changes: 176 additions & 0 deletions Plots/Fig_1_b/.ipynb_checkpoints/Heatmap-checkpoint.ipynb

Large diffs are not rendered by default.

311 changes: 311 additions & 0 deletions Plots/Fig_20/.ipynb_checkpoints/Fig 20-checkpoint.ipynb

Large diffs are not rendered by default.

675 changes: 675 additions & 0 deletions Plots/Fig_21/.ipynb_checkpoints/Fig 21-checkpoint.ipynb

Large diffs are not rendered by default.

276 changes: 276 additions & 0 deletions Plots/Fig_22/.ipynb_checkpoints/Fig 22-checkpoint.ipynb

Large diffs are not rendered by default.

424 changes: 424 additions & 0 deletions Plots/Fig_23/.ipynb_checkpoints/Fig 23-checkpoint.ipynb

Large diffs are not rendered by default.

371 changes: 371 additions & 0 deletions Plots/Fig_24/.ipynb_checkpoints/Fig 24-checkpoint.ipynb

Large diffs are not rendered by default.

330 changes: 330 additions & 0 deletions Plots/Fig_25/.ipynb_checkpoints/Fig 25-checkpoint.ipynb

Large diffs are not rendered by default.

336 changes: 336 additions & 0 deletions Plots/Fig_29/.ipynb_checkpoints/Fig 29-checkpoint.ipynb

Large diffs are not rendered by default.

240 changes: 240 additions & 0 deletions Plots/Fig_2_a/.ipynb_checkpoints/Fig 2 a-checkpoint.ipynb

Large diffs are not rendered by default.

206 changes: 206 additions & 0 deletions Plots/Fig_2_a/.ipynb_checkpoints/Fig 2 b-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "6527cb23",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "af24bbbf",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "0a21ad9d",
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from matplotlib.ticker import FuncFormatter\n",
"import csv\n",
"\n",
"def read_csv_without_header(csv_file):\n",
" with open(csv_file, \"r\", newline=\"\") as f:\n",
" reader = csv.reader(f)\n",
" next(reader)\n",
"\n",
" rows = []\n",
" for row in reader:\n",
" rows.append(row)\n",
" return rows\n",
"\n",
"\n",
"def get_matching_row(hardware, numhardware, framework, network, KV_block_size, batch):\n",
" csv_file = \"All_results.csv\"\n",
" rows = read_csv_without_header(csv_file)\n",
" \n",
" for row in rows:\n",
" if row != []:\n",
" Hardware = str(row[0]) \n",
" Num_of_Hardware = int(row[1])\n",
" Framework = str(row[2])\n",
" Model = str(row[3])\n",
" Input_Output_Length = int(row[4]) \n",
" Batch_Size = int(row[5])\n",
" Latency = float(row[6])\n",
" Throughput = float(row[7])\n",
" \n",
" if Hardware == hardware:\n",
" if Num_of_Hardware == numhardware:\n",
" if Framework == framework:\n",
" if Model == network:\n",
" if Input_Output_Length == inp_out:\n",
" if Batch_Size == batch:\n",
" return Throughput\n",
" return None\n",
" \n",
"\n",
"def get_data_rows():\n",
" \n",
" results_data = []\n",
" \n",
" for KV_block_size in [8, 16, 32, 64, 128]:\n",
" batch_row = []\n",
" for batch in [1, 16, 32, 64]:\n",
" for hardware in [\"Nvidia A100 GPU\"]:\n",
" for numhardware in [1]:\n",
" for network in [\"meta-llama/Meta-Llama-3-8B\"]:\n",
" for framework in [\"vLLM\"]:\n",
" throughput = get_matching_row(hardware, numhardware, framework, network, KV_block_size, batch)\n",
" batch_row.append(throughput)\n",
" results_data.append(batch_row)\n",
" \n",
" x_axis_labels = [1, 16, 32, 64]\n",
" legends = [8, 16, 32, 64, 128]\n",
"\n",
" colors = ['#08519c', '#a63603', '#006d2c', '#a50f15', '#54278f']\n",
" symbols = ['o', 'p', 'd', 's', 'v']\n",
" \n",
" return results_data, x_axis_labels, legends, colors, symbols\n",
"\n",
"\n",
"\n",
"def plot_multiple_lines(lines_data, x_axis_labels, legends, colors, symbols, title, xlabel, \n",
" ylabel, linewidth, markersize, fontsize, n_cols_legend,\n",
" fig_plot_length, fig_plot_height, legend_title, save_pdf, labelspacing, columnspacing):\n",
" \n",
" plt.figure(figsize=(fig_plot_length, fig_plot_height))\n",
" plt.rcParams['font.family'] = 'Century Schoolbook'\n",
" \n",
" for i, line_data in enumerate(lines_data):\n",
" \n",
" valid_y_axis = [x for x in line_data if x is not None]\n",
" valid_x_axis = x_axis_labels[0:len(valid_y_axis)]\n",
" \n",
" plt.plot(valid_x_axis, valid_y_axis, color=colors[i], marker=symbols[i], \n",
" label=str(legends[i]), linewidth = linewidth, markersize = markersize)\n",
" \n",
" for x_value in x_axis_labels:\n",
" plt.axvline(x=x_value, color='gray', linestyle='-', alpha=0.5)\n",
" \n",
" \n",
" plt.title(title, fontsize = fontsize)\n",
" \n",
" plt.xlabel(xlabel, fontsize = fontsize)\n",
" plt.ylabel(ylabel, fontsize = fontsize)\n",
" \n",
" plt.xticks(x_axis_labels, fontsize = fontsize)\n",
" plt.yticks(fontsize = fontsize)\n",
" \n",
" def thousands_formatter(x, pos):\n",
" return f'{int(x/1000)}k'\n",
" \n",
" plt.gca().yaxis.set_major_formatter(FuncFormatter(thousands_formatter))\n",
" \n",
" plt.legend(title=legend_title, loc='lower center', bbox_to_anchor=(0.5, -0.72), \n",
" ncol=n_cols_legend, fontsize = fontsize, title_fontsize = fontsize, frameon = False, \n",
" handlelength = 0, labelspacing = labelspacing, columnspacing = columnspacing)\n",
" \n",
" plt.savefig(save_pdf, dpi=300, bbox_inches='tight', pad_inches=0.03)\n",
" plt.show()\n",
" \n",
"\n",
"lines_data, x_axis_labels, legends, colors, symbols = get_data_rows()\n",
"\n",
"plot_title = \"vLLM: Batch Size vs Input/Output Length \\n of LLaMA-3-8B on a Single A100 GPU\"\n",
"x_axis_title = \"Batch Size\"\n",
"y_axis_title = \"Throughput (Tokens/sec)\"\n",
"\n",
"linewidth = 3\n",
"markersize = 8\n",
"fontsize = 20\n",
"\n",
"n_cols_legend = len(legends) \n",
"\n",
"fig_plot_length = 6\n",
"fig_plot_height = 2.8\n",
"\n",
"labelspacing = 0.2\n",
"columnspacing = 0.6\n",
"\n",
"legend_title = \"Input/Output Length\"\n",
"\n",
"save_pdf = \"llama_3_batch_size_vs_input_length_vLLM.pdf\"\n",
"\n",
"plot_multiple_lines(lines_data, x_axis_labels, legends, colors, symbols, \n",
" plot_title, x_axis_title, y_axis_title, \n",
" linewidth, markersize, fontsize, n_cols_legend, \n",
" fig_plot_length, fig_plot_height, legend_title, save_pdf, labelspacing, columnspacing)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b05bfb94",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "e599f039",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "5e76e5f8",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.11.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
221 changes: 221 additions & 0 deletions Plots/Fig_2_b/.ipynb_checkpoints/Fig 2 b-checkpoint.ipynb

Large diffs are not rendered by default.

418 changes: 418 additions & 0 deletions Plots/Fig_3/.ipynb_checkpoints/Fig 3-checkpoint.ipynb

Large diffs are not rendered by default.

277 changes: 277 additions & 0 deletions Plots/Fig_30/.ipynb_checkpoints/Fig_30-checkpoint.ipynb

Large diffs are not rendered by default.

305 changes: 305 additions & 0 deletions Plots/Fig_31/.ipynb_checkpoints/Fig 31-checkpoint.ipynb

Large diffs are not rendered by default.

342 changes: 342 additions & 0 deletions Plots/Fig_32/.ipynb_checkpoints/Fig_32-checkpoint.ipynb

Large diffs are not rendered by default.

326 changes: 326 additions & 0 deletions Plots/Fig_33/.ipynb_checkpoints/Fig_33-checkpoint.ipynb

Large diffs are not rendered by default.

270 changes: 270 additions & 0 deletions Plots/Fig_34/.ipynb_checkpoints/Fig_34-checkpoint.ipynb

Large diffs are not rendered by default.

319 changes: 319 additions & 0 deletions Plots/Fig_35/.ipynb_checkpoints/Fig_25_llama_cpp-checkpoint.ipynb

Large diffs are not rendered by default.

315 changes: 315 additions & 0 deletions Plots/Fig_35/.ipynb_checkpoints/Fig_25_vLLM-checkpoint.ipynb

Large diffs are not rendered by default.

328 changes: 328 additions & 0 deletions Plots/Fig_35/.ipynb_checkpoints/Fig_35-checkpoint.ipynb

Large diffs are not rendered by default.

330 changes: 330 additions & 0 deletions Plots/Fig_36/.ipynb_checkpoints/Fig_36-checkpoint.ipynb

Large diffs are not rendered by default.

315 changes: 315 additions & 0 deletions Plots/Fig_37/.ipynb_checkpoints/Fig_26_llamacpp-checkpoint.ipynb

Large diffs are not rendered by default.

315 changes: 315 additions & 0 deletions Plots/Fig_37/.ipynb_checkpoints/Fig_26_vLLM-checkpoint.ipynb

Large diffs are not rendered by default.

326 changes: 326 additions & 0 deletions Plots/Fig_37/.ipynb_checkpoints/Fig_37-checkpoint.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit fffdd3b

Please sign in to comment.