mlonmcu.session.postprocess package

Submodules

mlonmcu.session.postprocess.postprocess module

Definitions of base classes for MLonMCU postprocesses.

class mlonmcu.session.postprocess.postprocess.Postprocess(name, config=None, features=None)[source]

Bases: object

Abstract postprocess.

DEFAULTS = {}
FEATURES = {}
OPTIONAL = {}
REQUIRED = {}
process_features(features)[source]

Utility which handles postprocess_features.

class mlonmcu.session.postprocess.postprocess.RunPostprocess(name, config=None, features=None)[source]

Bases: Postprocess

Run postprocess which is applied to a single run.

post_run(report, artifacts)[source]

Called at the end of a run.

class mlonmcu.session.postprocess.postprocess.SessionPostprocess(name, config=None, features=None)[source]

Bases: Postprocess

Session postprocess which is applied to multiple runs at the end of a session. (multi-row)

post_session(report)[source]

Called at the end of a session.

mlonmcu.session.postprocess.postprocesses module

Collection of (example) postprocesses integrated in MLonMCU.

class mlonmcu.session.postprocess.postprocesses.AnalyseCoreVCountsPostprocess(features=None, config=None)[source]

Bases: RunPostprocess

Counting static instructions.

DEFAULTS = {'to_df': False, 'to_file': True}
post_run(report, artifacts)[source]

Called at the end of a run.

property to_df

Get to_df property.

property to_file

Get to_file property.

class mlonmcu.session.postprocess.postprocesses.AnalyseDumpPostprocess(features=None, config=None)[source]

Bases: RunPostprocess

Counting static instructions.

DEFAULTS = {'to_df': False, 'to_file': True}
post_run(report, artifacts)[source]

Called at the end of a run.

property to_df

Get to_df property.

property to_file

Get to_file property.

class mlonmcu.session.postprocess.postprocesses.AnalyseInstructionsPostprocess(features=None, config=None)[source]

Bases: RunPostprocess

Counting specific types of instructions.

DEFAULTS = {'corev': False, 'groups': True, 'seq_depth': 3, 'sequences': True, 'to_df': False, 'to_file': True, 'top': 10}
property corev

Get corev property.

property groups

Get groups property.

post_run(report, artifacts)[source]

Called at the end of a run.

property seq_depth

get seq_depth property.

property sequences

get sequences property.

property to_df

Get to_df property.

property to_file

Get to_file property.

property top

get top property.

class mlonmcu.session.postprocess.postprocesses.AnalyseLinkerMapPostprocess(features=None, config=None)[source]

Bases: RunPostprocess

Calculate memory footprints.

DEFAULTS = {'ignore': [], 'per_func': True, 'per_library': True, 'per_object': True, 'sum': False, 'to_df': False, 'to_file': True}
property ignore

Get ignore property.

property per_func

Get per_func property.

property per_library

Get per_library property.

property per_object

Get per_object property.

post_run(report, artifacts)[source]

Called at the end of a run.

property sum

Get sum property.

property to_df

Get to_df property.

property to_file

Get to_file property.

class mlonmcu.session.postprocess.postprocesses.Artifact2ColumnPostprocess(features=None, config=None)[source]

Bases: RunPostprocess

Postprocess for converting artifacts to columns in the report.

DEFAULTS = {'file2colname': {}}
property file2colname

Get file2colname property.

post_run(report, artifacts)[source]

Called at the end of a run.

class mlonmcu.session.postprocess.postprocesses.Bytes2kBPostprocess(features=None, config=None)[source]

Bases: SessionPostprocess

Postprocess which can be used to scale the memory related columns from Bytes to KiloBytes.

post_session(report)[source]

Called at the end of a session.

class mlonmcu.session.postprocess.postprocesses.CompareRowsPostprocess(features=None, config=None)[source]

Bases: SessionPostprocess

TODO

DEFAULTS = {'baseline': 0, 'group_by': None, 'invert': False, 'percent': False, 'substract': False, 'to_compare': None}
property baseline

Get baseline property.

property group_by

Get group_by property.

property invert

Get invert property.

property percent

Get percent property.

post_session(report)[source]

Called at the end of a session.

property substract

Get substract property.

property to_compare

Get to_compare property.

class mlonmcu.session.postprocess.postprocesses.Config2ColumnsPostprocess(features=None, config=None)[source]

Bases: SessionPostprocess

Postprocess which can be used to transform (explode) the ‘Config’ Column in a dataframe for easier filtering.

DEFAULTS = {'drop': True, 'limit': []}
property drop

Get drop property.

property limit

Get limit property.

post_session(report)[source]

Called at the end of a session.

class mlonmcu.session.postprocess.postprocesses.ExportOutputsPostprocess(features=None, config=None)[source]

Bases: RunPostprocess

Postprocess for writing model outputs to a directory.

DEFAULTS = {'archive_fmt': None, 'dest': None, 'fmt': 'bin', 'skip_dequant': False, 'use_ref': False}
property archive_fmt

Get archive_fmt property.

property dest

Get dest property.

property fmt

Get fmt property.

post_run(report, artifacts)[source]

Called at the end of a run.

property skip_dequant

Get skip_dequant property.

property use_ref

Get use_ref property.

class mlonmcu.session.postprocess.postprocesses.Features2ColumnsPostprocess(features=None, config=None)[source]

Bases: SessionPostprocess

Postprocess which can be used to transform (explode) the ‘Features’ Column in a dataframe for easier filtering.

DEFAULTS = {'drop': True, 'limit': []}
property drop

Get drop property.

property limit

Get limit property.

post_session(report)[source]

Called at the end of a session.

class mlonmcu.session.postprocess.postprocesses.FilterColumnsPostprocess(features=None, config=None)[source]

Bases: SessionPostprocess

Postprocess which can be used to drop unwanted columns from a report.

DEFAULTS = {'drop': None, 'drop_const': False, 'drop_empty': False, 'drop_nan': False, 'keep': None}
property drop

Get drop property.

property drop_const

Get drop_const property.

property drop_empty

Get drop_empty property.

property drop_nan

Get drop_nan property.

property keep

Get keep property.

post_session(report)[source]

Called at the end of a session.

class mlonmcu.session.postprocess.postprocesses.MyPostprocess(features=None, config=None)[source]

Bases: SessionPostprocess

TODO

DEFAULTS = {}
post_session(report)[source]

TODO

class mlonmcu.session.postprocess.postprocesses.PassConfig2ColumnsPostprocess(features=None, config=None)[source]

Bases: SessionPostprocess

Postprocess which can be used to transform (explode) the TVM pass_config into separate columns. requires prior Config2Columns pass.

post_session(report)[source]

Called at the end of a session.

class mlonmcu.session.postprocess.postprocesses.ProfileFunctionsPostprocess(features=None, config=None)[source]

Bases: RunPostprocess

Instr-trace based profiling of pcs/functions/objects/libraries.

DEFAULTS = {'min_weight': None, 'per_func': True, 'per_library': False, 'per_object': False, 'to_df': False, 'to_file': True, 'topk': None}
property min_weight

Get min_weight property.

property per_func

Get per_func property.

property per_library

Get per_library property.

property per_object

Get per_object property.

property per_pc

Get per_pc property.

post_run(report, artifacts)[source]

Called at the end of a run.

property to_df

Get to_df property.

property to_file

Get to_file property.

property topk

Get topk property.

class mlonmcu.session.postprocess.postprocesses.RenameColumnsPostprocess(features=None, config=None)[source]

Bases: SessionPostprocess

Postprocess which can rename columns based on a provided mapping.

DEFAULTS = {'mapping': {}, 'merge': True}
property mapping
property merge
post_session(report)[source]

Called at the end of a session.

class mlonmcu.session.postprocess.postprocesses.StageTimesGanttPostprocess(features=None, config=None)[source]

Bases: SessionPostprocess

Write Mermaid markdown file for stage times.

DEFAULTS = {}
post_session(report)[source]

Called at the end of a session.

class mlonmcu.session.postprocess.postprocesses.ValidateLabelsPostprocess(features=None, config=None)[source]

Bases: RunPostprocess

Postprocess for comparing model outputs with golden reference.

DEFAULTS = {'classify_metrics': 'topk_label(n=1);topk_label(n=2)', 'report': False}
property classify_metrics

Get classify_metrics property.

post_run(report, artifacts)[source]

Called at the end of a run.

property report

Get report property.

class mlonmcu.session.postprocess.postprocesses.ValidateOutputsPostprocess(features=None, config=None)[source]

Bases: RunPostprocess

Postprocess for comparing model outputs with golden reference.

DEFAULTS = {'report': False, 'validate_metrics': 'topk(n=1);topk(n=2)', 'validate_range': True}
post_run(report, artifacts)[source]

Called at the end of a run.

property report

Get report property.

property validate_metrics

Get validate_metrics property.

property validate_range

Get validate_range property.

class mlonmcu.session.postprocess.postprocesses.VisualizePostprocess(features=None, config=None)[source]

Bases: SessionPostprocess

A very simple example on how to generate a plot of the results using a postprocess.

DEFAULTS = {'format': 'png'}
property format

Get format property.

post_session(report)[source]

Called at the end of a session.

mlonmcu.session.postprocess.postprocesses.match_rows(df, cols)[source]

Helper function to group similar rows in a dataframe.

Module contents

MLonMCU postprocess submodule