mlonmcu.flow.tvm package

Subpackages

Submodules

mlonmcu.flow.tvm.framework module

Definitions for TVMFramework.

class mlonmcu.flow.tvm.framework.TVMFramework(features=None, config=None)[source]

Bases: Framework

TVM Framework specialization.

DEFAULTS = {'crt_config_dir': '/home/runner/work/mlonmcu/mlonmcu/mlonmcu/../resources/frameworks/tvm/crt_config', 'extra_incs': [], 'extra_libs': []}
FEATURES = {'cmsisnnbyoc', 'muriscvnnbyoc'}
REQUIRED = {'tvm.src_dir'}
property crt_config_dir
property extra_incs
property extra_libs
get_platform_defs(platform)[source]
name = 'tvm'
property tvm_src
mlonmcu.flow.tvm.framework.get_crt_config_dir()[source]

Module contents

TVM framework module.

class mlonmcu.flow.tvm.TVMAOTBackend(runtime='crt', fmt='mlf', system_lib=False, features=None, config=None)[source]

Bases: TVMBackend

DEFAULTS = {'alignment_bytes': 16, 'arena_size': None, 'autotuned_mode': None, 'autotuned_results_file': None, 'custom_unroll': False, 'debug_arena': False, 'desired_layout': None, 'desired_layout_map': None, 'desired_layout_ops': None, 'disable_vectorize': 'auto', 'disabled_passes': [], 'dump': [], 'extra_pass_config': {'tir.usmp.enable': False}, 'extra_target_details': None, 'extra_targets': None, 'generate_wrapper': 'auto', 'num_threads': 4, 'opt_level': 3, 'print_outputs': False, 'refresh_model_info': False, 'relay_debug': None, 'target_device': None, 'target_keys': None, 'target_mabi': None, 'target_march': None, 'target_mattr': None, 'target_mcpu': None, 'target_model': None, 'target_mtriple': None, 'target_num_cores': None, 'tophub_url': None, 'tvmc_custom_script': None, 'tvmc_extra_args': [], 'unpacked_api': False, 'use_tuning_results': False}
FEATURES = {'autotuned', 'cmsisnnbyoc', 'debug_arena', 'disable_legalize', 'fuse_ops', 'moiopt', 'muriscvnnbyoc', 'uma_backends', 'unpacked_api', 'usmp'}
property alignment_bytes
property arena_size
property debug_arena
generate() Tuple[dict, dict][source]
get_tvmc_compile_args(out, dump=None)[source]
get_workspace_size_from_metadata(metadata)[source]
name = 'tvmaot'
property unpacked_api
class mlonmcu.flow.tvm.TVMAOTPlusBackend(runtime='crt', fmt='mlf', system_lib=False, features=None, config=None)[source]

Bases: TVMAOTBackend

DEFAULTS = {'alignment_bytes': 16, 'arena_size': 0, 'autotuned_mode': None, 'autotuned_results_file': None, 'custom_unroll': False, 'debug_arena': False, 'desired_layout': None, 'desired_layout_map': None, 'desired_layout_ops': None, 'disable_vectorize': 'auto', 'disabled_passes': [], 'dump': [], 'extra_pass_config': {'tir.usmp.algorithm': 'hill_climb', 'tir.usmp.enable': True}, 'extra_target_details': None, 'extra_targets': None, 'generate_wrapper': 'auto', 'num_threads': 4, 'opt_level': 3, 'print_outputs': False, 'refresh_model_info': False, 'relay_debug': None, 'target_device': None, 'target_keys': None, 'target_mabi': None, 'target_march': None, 'target_mattr': None, 'target_mcpu': None, 'target_model': None, 'target_mtriple': None, 'target_num_cores': None, 'tophub_url': None, 'tvmc_custom_script': None, 'tvmc_extra_args': [], 'unpacked_api': True, 'use_tuning_results': False}
name = 'tvmaotplus'
class mlonmcu.flow.tvm.TVMCGBackend(runtime='crt', fmt='mlf', system_lib=True, features=None, config=None)[source]

Bases: TVMRTBackend

REQUIRED = {'utvmcg.exe'}
generate() Tuple[dict, dict][source]
get_max_workspace_size_from_metadata(metadata)[source]
name = 'tvmcg'
class mlonmcu.flow.tvm.TVMRTBackend(runtime='crt', fmt='mlf', system_lib=True, features=None, config=None)[source]

Bases: TVMBackend

DEFAULTS = {'arena_size': 1048576, 'autotuned_mode': None, 'autotuned_results_file': None, 'custom_unroll': False, 'debug_arena': False, 'desired_layout': None, 'desired_layout_map': None, 'desired_layout_ops': None, 'disable_vectorize': 'auto', 'disabled_passes': [], 'dump': [], 'extra_pass_config': {}, 'extra_target_details': None, 'extra_targets': None, 'generate_wrapper': 'auto', 'num_threads': 4, 'opt_level': 3, 'print_outputs': False, 'refresh_model_info': False, 'relay_debug': None, 'target_device': None, 'target_keys': None, 'target_mabi': None, 'target_march': None, 'target_mattr': None, 'target_mcpu': None, 'target_model': None, 'target_mtriple': None, 'target_num_cores': None, 'tophub_url': None, 'tvmc_custom_script': None, 'tvmc_extra_args': [], 'use_tuning_results': False}
FEATURES = {'autotuned', 'cmsisnnbyoc', 'debug_arena', 'disable_legalize', 'fuse_ops', 'moiopt', 'muriscvnnbyoc', 'uma_backends'}
property arena_size
property debug_arena
generate() Tuple[dict, dict][source]
get_tvmc_compile_args(out, dump=None)[source]
name = 'tvmrt'