Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippvK committed Feb 9, 2024
2 parents df60361 + 0dd6dfd commit 30bc2f7
Show file tree
Hide file tree
Showing 29 changed files with 3,377 additions and 245 deletions.
4 changes: 2 additions & 2 deletions ipynb/Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@
"metadata": {},
"outputs": [],
"source": [
"# !mlonmcu export --session 0 --run 0 run.zip # Export run 0 from session 0 to a zip archive \n",
"# !mlonmcu export --session 0 --run 0 run.zip # Export run 0 from session 0 to a zip archive\n",
"# !mlonmcu export --session 1 session.zip # Export every run of session 1 to a zip archive\n",
"# !mlonmcu export session/ # Export the latest session to a directory"
]
Expand Down Expand Up @@ -2060,7 +2060,7 @@
"COLS = [\"Cycles\", \"Total ROM\", \"Total RAM\"]\n",
"\n",
"fig, axes = plt.subplots(ncols=len(COLS))\n",
"plt.rcParams[\"figure.figsize\"] = (15, 3) # (w, h)\n",
"plt.rcParams[\"figure.figsize\"] = (15, 3) # (w, h)\n",
"\n",
"\n",
"for i, col in enumerate(COLS):\n",
Expand Down
17 changes: 8 additions & 9 deletions ipynb/Examples/CodeSizeComparison/CodeSizeComparison.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1146,10 +1146,7 @@
"TARGET = \"spike\"\n",
"POSTPROCESSES = [\"config2cols\", \"rename_cols\", \"filter_cols\"]\n",
"FEATURES = [[], [\"cmsisnn\"], [\"muriscvnn\"]]\n",
"CONFIG = {\n",
" \"mlif.optimize\": \"s\",\n",
" \"filter_cols.keep\": [\"Model\", \"Total Cycles\", \"ROM code\", \"Features\"]\n",
"}"
"CONFIG = {\"mlif.optimize\": \"s\", \"filter_cols.keep\": [\"Model\", \"Total Cycles\", \"ROM code\", \"Features\"]}"
]
},
{
Expand Down Expand Up @@ -1326,6 +1323,7 @@
" with context.create_session() as session:\n",
" for model in MODELS:\n",
" for features in FEATURES:\n",
"\n",
" def helper(session):\n",
" cfg = CONFIG.copy()\n",
" run = session.create_run(config=cfg)\n",
Expand All @@ -1336,6 +1334,7 @@
" run.add_platform_by_name(PLATFORM, context=context)\n",
" run.add_target_by_name(TARGET, context=context)\n",
" run.add_postprocesses_by_name(POSTPROCESSES)\n",
"\n",
" helper(session)\n",
" session.process_runs(context=context)\n",
" report = session.get_reports()\n",
Expand Down Expand Up @@ -1497,12 +1496,12 @@
],
"source": [
"df = report.df\n",
"df.set_index('Features', inplace=True)\n",
"df.set_index(\"Features\", inplace=True)\n",
"df.index = df.index.map(lambda x: x[0] if len(x) > 0 else \"default\")\n",
"cycles_firsts = (df.groupby('Model')['Total Cycles'].transform('first'))\n",
"rom_firsts = (df.groupby('Model')['ROM code'].transform('first'))\n",
"df[\"Total Cycles (rel.)\"] = (1 / (df[\"Total Cycles\"] / cycles_firsts))\n",
"df[\"ROM code (rel.)\"] = (1 / (df[\"ROM code\"] / rom_firsts))\n",
"cycles_firsts = df.groupby(\"Model\")[\"Total Cycles\"].transform(\"first\")\n",
"rom_firsts = df.groupby(\"Model\")[\"ROM code\"].transform(\"first\")\n",
"df[\"Total Cycles (rel.)\"] = 1 / (df[\"Total Cycles\"] / cycles_firsts)\n",
"df[\"ROM code (rel.)\"] = 1 / (df[\"ROM code\"] / rom_firsts)\n",
"df"
]
},
Expand Down
6 changes: 3 additions & 3 deletions ipynb/Examples/CompareMIPS/CompareMIPS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1186,9 +1186,7 @@
"TARGETS = [\"etiss_pulpino\", \"spike\"]\n",
"POSTPROCESSES = [\"config2cols\", \"filter_cols\"]\n",
"FEATURES = [\"benchmark\"]\n",
"CONFIG = {\n",
" \"filter_cols.keep\": [\"Model\", \"Target\", \"MIPS\", \"config_benchmark.num_runs\"], \"run.export_optional\": True\n",
"}"
"CONFIG = {\"filter_cols.keep\": [\"Model\", \"Target\", \"MIPS\", \"config_benchmark.num_runs\"], \"run.export_optional\": True}"
]
},
{
Expand Down Expand Up @@ -1381,6 +1379,7 @@
" with context.create_session() as session:\n",
" for model in MODELS:\n",
" for target in TARGETS:\n",
"\n",
" def helper(session, num=0):\n",
" cfg = CONFIG.copy()\n",
" cfg[\"benchmark.num_runs\"] = num\n",
Expand All @@ -1392,6 +1391,7 @@
" run.add_platform_by_name(PLATFORM, context=context)\n",
" run.add_target_by_name(target, context=context)\n",
" run.add_postprocesses_by_name(POSTPROCESSES)\n",
"\n",
" for num in [1, 10]: # Removed 50 to cut down runtime\n",
" helper(session, num)\n",
" session.process_runs(context=context)\n",
Expand Down
Loading

0 comments on commit 30bc2f7

Please sign in to comment.