mlonmcu.platform.tvm package

Submodules

mlonmcu.platform.tvm.tvm module

TVM Platform

class mlonmcu.platform.tvm.tvm.TvmPlatform(features=None, config=None)[source]

Bases: TvmBasePlatform, TvmBuildPlatform, TvmTunePlatform

TVM Platform class.

DEFAULTS = {'aggregate': 'none', 'autoscheduler_enable': False, 'autoscheduler_include_simple_tasks': False, 'autoscheduler_log_estimated_latency': True, 'autotuning_append': None, 'autotuning_early_stopping': None, 'autotuning_max_parallel': 1, 'autotuning_mode': None, 'autotuning_num_workers': None, 'autotuning_results_file': None, 'autotuning_tasks': None, 'autotuning_timeout': 100, 'autotuning_trials': 10, 'autotuning_trials_single': None, 'autotuning_use_rpc': False, 'autotuning_visualize': False, 'autotuning_visualize_file': None, 'autotuning_visualize_live': False, 'autotvm_enable': False, 'autotvm_tuner': 'ga', 'enable_wandb': False, 'experimental_tvmc_tune_tasks': False, 'experimental_tvmc_tune_visualize': False, 'fill_mode': None, 'ins_file': None, 'metascheduler_enable': False, 'min_repeat_ms': 0, 'number': 1, 'outs_file': None, 'print_outputs': False, 'print_top': False, 'profile': False, 'project_dir': None, 'repeat': 1, 'rpc_hostname': None, 'rpc_key': None, 'rpc_port': None, 'total_time': False, 'tvmc_custom_script': None, 'use_rpc': False}
FEATURES = {'autoscheduler', 'autotvm', 'benchmark', 'metascheduler', 'tvm_profile', 'tvm_rpc'}
REQUIRED = {'tvm.build_dir', 'tvm.configs_dir', 'tvm.pythonpath'}

mlonmcu.platform.tvm.tvm_backend module

mlonmcu.platform.tvm.tvm_backend.create_tvm_platform_backend(name, platform, base=<class 'mlonmcu.flow.tvm.backend.backend.TVMBackend'>)[source]
mlonmcu.platform.tvm.tvm_backend.get_tvm_platform_backends()[source]
mlonmcu.platform.tvm.tvm_backend.register_tvm_platform_backend(backend_name, b, override=False)[source]

mlonmcu.platform.tvm.tvm_base_platform module

TVM Base Platform

class mlonmcu.platform.tvm.tvm_base_platform.TvmBasePlatform(name, features=None, config=None)[source]

Bases: Platform

TVM base platform class.

DEFAULTS = {'project_dir': None, 'tvmc_custom_script': None}
FEATURES = {}
REQUIRED = {'tvm.build_dir', 'tvm.configs_dir', 'tvm.pythonpath'}
close()[source]
init_directory(path=None, context=None)[source]
invoke_tvmc(command, *args, target=None, live=None, **kwargs)[source]
property tvm_build_dir
property tvm_configs_dir
property tvm_pythonpath
property tvmc_custom_script

mlonmcu.platform.tvm.tvm_build_platform module

TVM Build Platform

class mlonmcu.platform.tvm.tvm_build_platform.TvmBuildPlatform(name, features=None, config=None)[source]

Bases: BuildPlatform

TVM build platform class.

create_backend(name)[source]
get_supported_backends()[source]

mlonmcu.platform.tvm.tvm_rpc_platform module

TVM RPC Platform

class mlonmcu.platform.tvm.tvm_rpc_platform.TvmRpcPlatform(name, features=None, config=None)[source]

Bases: Platform

TVM RPC platform class.

DEFAULTS = {'print_outputs': False, 'rpc_hostname': None, 'rpc_key': None, 'rpc_port': None, 'use_rpc': False}
FEATURES = {'tvm_rpc'}
property rpc_hostname
property rpc_key
property rpc_port
property use_rpc

mlonmcu.platform.tvm.tvm_target module

mlonmcu.platform.tvm.tvm_target.create_tvm_platform_target(name, platform, base=<class 'mlonmcu.target.target.Target'>)[source]
mlonmcu.platform.tvm.tvm_target.name2device(name)[source]

mlonmcu.platform.tvm.tvm_target_platform module

TVM Target Platform

class mlonmcu.platform.tvm.tvm_target_platform.TvmTargetPlatform(name, features=None, config=None)[source]

Bases: TargetPlatform, TvmRpcPlatform

TVM target platform class.

DEFAULTS = {'aggregate': 'none', 'fill_mode': None, 'ins_file': None, 'number': 1, 'outs_file': None, 'print_outputs': False, 'print_top': False, 'profile': False, 'repeat': 1, 'rpc_hostname': None, 'rpc_key': None, 'rpc_port': None, 'total_time': False, 'use_rpc': False}
FEATURES = {'benchmark', 'tvm_profile', 'tvm_rpc'}
REQUIRED = {}
property aggregate
create_target(name)[source]
property fill_mode
flash(elf, target, timeout=120)[source]
get_supported_targets()[source]
get_tvmc_run_args()[source]
property ins_file
invoke_tvmc_run(*args, target=None)[source]
monitor(target, timeout=60)[source]
property number
property outs_file
property print_top
property profile
property repeat
run(elf, target, timeout=120)[source]
property total_time

mlonmcu.platform.tvm.tvm_tune_platform module

TVM Tune Platform

class mlonmcu.platform.tvm.tvm_tune_platform.TvmTunePlatform(name, features=None, config=None)[source]

Bases: TunePlatform, TvmTargetPlatform

TVM Tune platform class.

DEFAULTS = {'aggregate': 'none', 'autoscheduler_enable': False, 'autoscheduler_include_simple_tasks': False, 'autoscheduler_log_estimated_latency': True, 'autotuning_append': None, 'autotuning_early_stopping': None, 'autotuning_max_parallel': 1, 'autotuning_mode': None, 'autotuning_num_workers': None, 'autotuning_results_file': None, 'autotuning_tasks': None, 'autotuning_timeout': 100, 'autotuning_trials': 10, 'autotuning_trials_single': None, 'autotuning_use_rpc': False, 'autotuning_visualize': False, 'autotuning_visualize_file': None, 'autotuning_visualize_live': False, 'autotvm_enable': False, 'autotvm_tuner': 'ga', 'enable_wandb': False, 'experimental_tvmc_tune_tasks': False, 'experimental_tvmc_tune_visualize': False, 'fill_mode': None, 'ins_file': None, 'metascheduler_enable': False, 'min_repeat_ms': 0, 'number': 1, 'outs_file': None, 'print_outputs': False, 'print_top': False, 'profile': False, 'repeat': 1, 'rpc_hostname': None, 'rpc_key': None, 'rpc_port': None, 'total_time': False, 'use_rpc': False}
FEATURES = {'autoscheduler', 'autotvm', 'benchmark', 'metascheduler', 'tvm_profile', 'tvm_rpc'}
REQUIRED = {}
property enable_wandb
property experimental_tvmc_tune_tasks
property experimental_tvmc_tune_visualize
get_autoscheduler_tune_args(model, backend, target, out, trials_global, early_stopping)[source]
get_autotvm_tune_args(model, backend, target, out, trials_global, early_stopping)[source]
get_metascheduler_tune_args(model, backend, target, out, trials_global, trials_single, early_stopping)[source]
get_tune_args(model, backend, target, out, trials, early_stopping)[source]
invoke_tvmc_tune(*args, target=None, **kwargs)[source]
property min_repeat_ms
property tune_tasks

Module contents

MLonMCU TVM platform

class mlonmcu.platform.tvm.TvmPlatform(features=None, config=None)[source]

Bases: TvmBasePlatform, TvmBuildPlatform, TvmTunePlatform

TVM Platform class.

DEFAULTS = {'aggregate': 'none', 'autoscheduler_enable': False, 'autoscheduler_include_simple_tasks': False, 'autoscheduler_log_estimated_latency': True, 'autotuning_append': None, 'autotuning_early_stopping': None, 'autotuning_max_parallel': 1, 'autotuning_mode': None, 'autotuning_num_workers': None, 'autotuning_results_file': None, 'autotuning_tasks': None, 'autotuning_timeout': 100, 'autotuning_trials': 10, 'autotuning_trials_single': None, 'autotuning_use_rpc': False, 'autotuning_visualize': False, 'autotuning_visualize_file': None, 'autotuning_visualize_live': False, 'autotvm_enable': False, 'autotvm_tuner': 'ga', 'enable_wandb': False, 'experimental_tvmc_tune_tasks': False, 'experimental_tvmc_tune_visualize': False, 'fill_mode': None, 'ins_file': None, 'metascheduler_enable': False, 'min_repeat_ms': 0, 'number': 1, 'outs_file': None, 'print_outputs': False, 'print_top': False, 'profile': False, 'project_dir': None, 'repeat': 1, 'rpc_hostname': None, 'rpc_key': None, 'rpc_port': None, 'total_time': False, 'tvmc_custom_script': None, 'use_rpc': False}
FEATURES = {'autoscheduler', 'autotvm', 'benchmark', 'metascheduler', 'tvm_profile', 'tvm_rpc'}
REQUIRED = {'tvm.build_dir', 'tvm.configs_dir', 'tvm.pythonpath'}