Skip to content
heliaAOT
API Reference
HELIA HUB

converter

The AotConverter class is responsible for converting a model into an AOT inference C module.

Classes

Name Description
AotConverter Performs the AOT conversion process.
ConversionResult What a finished conversion wrote.

Copyright 2025 Ambiq. All Rights Reserved.

Machine-readable model

  • ConversionResultclassWhat a finished conversion wrote, as AotConverter.convert() returns it.
  • AotConverterclassConverts a trained model into a self-contained AOT inference C module.
class

What a finished conversion wrote, as AotConverter.convert() returns it.

helia_aot/converter.py:79

ConversionResult(
output: Path,
prefix: str,
plan: OptimizationPlan,
report: OptimizationReport,
work_dir: Path | None,
operators: tuple[OperatorView, ...] | None = None,
tensors: tuple[TensorView, ...] | None = None,
regions: tuple[RegionView, ...] | None = None,
placements: Mapping[str, PlacementView] | None = None,
) -> None

dataclass

What a finished conversion wrote, as AotConverter.convert() returns it.

A result compares and hashes by identity, so it can key a dict or join a set. To compare two conversions, compare their plan and report, which compare by value.

attribute

output

Python

helia_aot/converter.py:111

output: Path

The module directory, module.path joined with module.name, or the .zip or .pack archive that module.path names.

attribute

work_dir

Python

helia_aot/converter.py:115

work_dir: Path | None

The temporary work directory, which holds the generated sources under module.name, when keep_work_dir kept it; otherwise None, as the conversion removed it.

attribute

operators

Python

helia_aot/converter.py:116

operators: tuple[OperatorView, ...] | None = None

With result_views, the generated operators in execution order, which is the order the generated operator callback reports them in; otherwise None.

attribute

tensors

Python

helia_aot/converter.py:117

tensors: tuple[TensorView, ...] | None = None

With result_views, the module’s tensors in the order of its tensor enumeration; otherwise None.

attribute

regions

Python

helia_aot/converter.py:118

regions: tuple[RegionView, ...] | None = None

With result_views, the module’s arena regions, where regions[i].id == i; otherwise None.

attribute

helia_aot/converter.py:119

placements: Mapping[str, PlacementView] | None = None

With result_views, each tensor’s placement, keyed by tensor id; otherwise None.

class

Converts a trained model into a self-contained AOT inference C module.

helia_aot/converter.py:122

AotConverter(config: ConvertArgs, registry_context: RegistryContext | None = None)

Converts a trained model into a self-contained AOT inference C module.

The converter owns the six-stage pipeline (Load, Transform, Resolve, Plan, Emit, Export) described on convert(), which is the single entry point; the CLI is a thin wrapper around it. All behavior is driven by the ConvertArgs config supplied at construction, and every dispatch (parsers, operator classes, transforms) goes through the registry context, so a caller can extend the compiler without patching it.

Parameters of AotConverter
NameTypeDefaultDescription
configConvertArgsRequiredConversion parameters.
registry_contextRegistryContext | NoneNoneOptional registry context for parser/operator/transform dispatch. If omitted, a fresh default frozen context is created.
method

convert

Python

Convert the model to an AOT module.

helia_aot/converter.py:153

convert() -> ConversionResult

Convert the model to an AOT module.

Code is generated in a temporary work directory that is removed once the conversion ends, whether it succeeds or fails, unless keep_work_dir is set.

Returns of convert
ValueTypeDescription
ConversionResultConversionResultWhere the module was written, its prefix, its
ConversionResultoptimization plan and report, the kept work directory, and, with
ConversionResult``result_views``, its operators, tensors, regions and placements.
Errors raised by convert
TypeDescription
InvalidConfigErrorBefore the model loads, if an ``operators[]`` attribute key or value is one that no operator the rule reaches in the registry context takes, or if ``module.path`` cannot be written: a directory path that names a file, an archive path that names a directory, a symbolic link to nothing, a path under a file or under a directory it cannot search, a location without write permission, or a file name the file system cannot hold.
ModelLoadErrorIf the model file is missing, unreadable or not a LiteRT model.
HeliaAotErrorAnother subclass naming what stopped the conversion.