Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #890

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.6.3
hooks:
- id: ruff
args:
Expand All @@ -21,7 +21,7 @@ repos:
- id: check-executables-have-shebangs
- id: requirements-txt-fixer
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.6.0
rev: v9.9.1
hooks:
- id: eslint
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
Expand Down
101 changes: 48 additions & 53 deletions benchmarks/async_benchmark.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@
"metadata": {},
"outputs": [],
"source": [
"from IPython.core.interactiveshell import InteractiveShell\n",
"from IPython.display import display, Markdown, SVG, HTML\n",
"import pandas as pd\n",
"import altair as alt\n",
"import re\n",
"import pickle\n",
"from utils import seconds_to_ms, ms_to_seconds\n",
"from benchmark_result import get_benchmark_results, BenchmarkType, SchedulerType, get_broadcast_source, get_async_source\n",
"from benchmarks.utils import echo\n",
"from benchmarks.throughput import make_benchmark, make_multiple_message_benchmark"
"\n",
"import altair as alt\n",
"import pandas as pd\n",
"from benchmark_result import get_async_source"
]
},
{
Expand All @@ -24,8 +19,7 @@
"metadata": {},
"outputs": [],
"source": [
"#benchmark_results = get_benchmark_results()\n",
"from benchmark_result import BenchmarkResult, Result \n",
"# benchmark_results = get_benchmark_results()\n",
"with open('saved_results.pkl', 'rb') as saved_results:\n",
" benchmark_results = pickle.load(saved_results)"
]
Expand Down Expand Up @@ -118,9 +112,9 @@
"outputs": [],
"source": [
"source = get_async_source(benchmark_results)\n",
"dview = pd.DataFrame(source['DirectView']) \n",
"dview = pd.DataFrame(source['DirectView'])\n",
"dview['Scheduler name'] = 'DirectView'\n",
"dview['Speedup'] = 1\n"
"dview['Speedup'] = 1"
]
},
{
Expand Down Expand Up @@ -288,9 +282,13 @@
"source": [
"datas = []\n",
"for scheduler_name, scheduler_results in source.items():\n",
" data = pd.DataFrame(scheduler_results) \n",
" data = pd.DataFrame(scheduler_results)\n",
" data['Scheduler name'] = scheduler_name\n",
" data['Speedup'] = 1 if scheduler_name == 'DirectView' else dview['Duration in ms'] / data['Duration in ms']\n",
" data['Speedup'] = (\n",
" 1\n",
" if scheduler_name == 'DirectView'\n",
" else dview['Duration in ms'] / data['Duration in ms']\n",
" )\n",
" datas.append(data)\n",
"data = pd.concat(datas)\n",
"data"
Expand Down Expand Up @@ -386,8 +384,14 @@
"metadata": {},
"outputs": [],
"source": [
"data['Messages per engine per second'] = round(data['Number of messages'] / data['Duration in ms'] * 1000, 2)\n",
"data['Total messages per second'] = round(((data['Number of messages'] * data['Number of engines']) / data['Duration in ms']) * 1000, 2)"
"data['Messages per engine per second'] = round(\n",
" data['Number of messages'] / data['Duration in ms'] * 1000, 2\n",
")\n",
"data['Total messages per second'] = round(\n",
" ((data['Number of messages'] * data['Number of engines']) / data['Duration in ms'])\n",
" * 1000,\n",
" 2,\n",
")"
]
},
{
Expand Down Expand Up @@ -598,7 +602,7 @@
],
"source": [
"dview = data[data['Number of messages'] == 100]\n",
"dview['Number of engines'].unique()\n"
"dview['Number of engines'].unique()"
]
},
{
Expand Down Expand Up @@ -670,17 +674,13 @@
],
"source": [
"alt.Chart(dview).mark_line(point=True).encode(\n",
" alt.X(\n",
" 'Number of engines',\n",
" scale=alt.Scale(type='log', base=2)\n",
" ),\n",
" alt.Y(\n",
" 'Messages per engine per second',\n",
" scale=alt.Scale(type='log')\n",
" ),\n",
" alt.X('Number of engines', scale=alt.Scale(type='log', base=2)),\n",
" alt.Y('Messages per engine per second', scale=alt.Scale(type='log')),\n",
" color='Scheduler name:N',\n",
" tooltip='Messages per engine per second',\n",
").configure_axis(labelFontSize=20, titleFontSize=20).properties(title='Runtime of apply using DirectView', width=1080).interactive().display(renderer='svg')"
").configure_axis(labelFontSize=20, titleFontSize=20).properties(\n",
" title='Runtime of apply using DirectView', width=1080\n",
").interactive().display(renderer='svg')"
]
},
{
Expand Down Expand Up @@ -752,17 +752,13 @@
],
"source": [
"alt.Chart(dview).mark_line(point=True).encode(\n",
" alt.X(\n",
" 'Number of engines',\n",
" scale=alt.Scale(type='log', base=2)\n",
" ),\n",
" alt.Y(\n",
" 'Total messages per second',\n",
" scale=alt.Scale(type='log')\n",
" ),\n",
" alt.X('Number of engines', scale=alt.Scale(type='log', base=2)),\n",
" alt.Y('Total messages per second', scale=alt.Scale(type='log')),\n",
" color='Scheduler name:N',\n",
" tooltip='Total messages per second',\n",
").configure_axis(labelFontSize=20, titleFontSize=20).properties(title='Runtime of apply using DirectView', width=1080).interactive().display(renderer='svg')"
").configure_axis(labelFontSize=20, titleFontSize=20).properties(\n",
" title='Runtime of apply using DirectView', width=1080\n",
").interactive().display(renderer='svg')"
]
},
{
Expand Down Expand Up @@ -958,16 +954,15 @@
"for scheduler_name in data['Scheduler name'].unique():\n",
" scheduler_data = data[data['Scheduler name'] == scheduler_name]\n",
" alt.Chart(scheduler_data).mark_line(point=True).encode(\n",
" alt.X(\n",
" 'Number of messages',\n",
" scale=alt.Scale(type='log')\n",
" ),\n",
" alt.X('Number of messages', scale=alt.Scale(type='log')),\n",
" alt.Y(\n",
" 'Messages per engine per second',\n",
" ),\n",
" color='Number of engines:N',\n",
" tooltip='Duration in ms', \n",
" ).configure_axis(labelFontSize=20, titleFontSize=20).properties(title=scheduler_name, width=800).interactive().display(renderer='svg')"
" tooltip='Duration in ms',\n",
" ).configure_axis(labelFontSize=20, titleFontSize=20).properties(\n",
" title=scheduler_name, width=800\n",
" ).interactive().display(renderer='svg')"
]
},
{
Expand Down Expand Up @@ -1042,20 +1037,18 @@
}
],
"source": [
"data['combined']= data['Scheduler name'] + ' ' + data['Number of engines'].astype(str)\n",
"data['combined'] = data['Scheduler name'] + ' ' + data['Number of engines'].astype(str)\n",
"alt.Chart(data[data['Scheduler name'] != 'DirectView']).mark_line(point=True).encode(\n",
" alt.X(\n",
" 'Number of messages',\n",
" scale=alt.Scale(type='log')\n",
" ),\n",
" alt.X('Number of messages', scale=alt.Scale(type='log')),\n",
" alt.Y(\n",
" 'Speedup',\n",
" ),\n",
" color='Number of engines:N',\n",
" strokeDash=alt.StrokeDash(shorthand='Scheduler name', legend=None),\n",
" tooltip='combined',\n",
"\n",
").properties(title='schedulers vs directView scaling engines', width=800).interactive().display(renderer='svg')\n"
").properties(\n",
" title='schedulers vs directView scaling engines', width=800\n",
").interactive().display(renderer='svg')"
]
},
{
Expand Down Expand Up @@ -1557,14 +1550,16 @@
}
],
"source": [
"for engine in data['Number of engines'].unique(): \n",
"for engine in data['Number of engines'].unique():\n",
" alt.Chart(data[data['Number of engines'] == engine]).mark_bar().encode(\n",
" x='Scheduler name',\n",
" y='Duration in ms',\n",
" color='Scheduler name:N',\n",
" column='Number of messages:N', \n",
" tooltip='Duration in ms'\n",
" ).properties(title=f'Runtime on {engine} engines:').interactive().display(renderer='svg')"
" column='Number of messages:N',\n",
" tooltip='Duration in ms',\n",
" ).properties(title=f'Runtime on {engine} engines:').interactive().display(\n",
" renderer='svg'\n",
" )"
]
}
],
Expand Down
Loading
Loading