ConvertArgs
PythonConfiguration for the conversion process.
ConvertArgs()Configuration for the conversion process.
path
Pythonpath: Path | None = Field(None, exclude=True, description='Path to yaml configuration')Path to the YAML configuration it was loaded from, if any.
model
Pythonmodel: ModelArgs = Field(default_factory=ModelArgs, description='Model configuration')Model configuration.
module
Pythonmodule: ModuleArgs = Field(default_factory=ModuleArgs, description='Module configuration')Module configuration.
test
Pythontest: TestArgs = Field(default_factory=TestArgs, description='Test configuration')Test configuration.
transforms
Pythontransforms: list[TransformSpec] = Field(default_factory=list, description='Transforms configuration')Transforms configuration.
memory
Pythonmemory: MemoryArgs = Field(default_factory=MemoryArgs, description='Memory configuration')Memory configuration.
platform
Pythonplatform: PlatformArgs = Field(default_factory=PlatformArgs, description='Target platform configuration')Target platform configuration.
operators
Pythonoperators: list[OperatorRuleset] = Field(default_factory=list, description='Operator attributes and optimization knob overrides')Operator attribute rules and optimization knob overrides.
documentation
Pythondocumentation: DocumentationArgs = Field(default_factory=DocumentationArgs, description='Documentation configuration')Documentation configuration.
optimization
Pythonoptimization: OptimizationArgs = Field(default_factory=OptimizationArgs, description='Optimization goal, approximation gate and knobs')Optimization goal, approximation gate and knobs.
verbose
Pythonverbose: int = Field(1, ge=0, le=3, description="Verbosity level: 0 errors only, 1 stage milestones, 2 debug details, 3 debug details with each AIR operator's tensors and options")Verbosity level, 0 to 3. The command line sets its
log level from it: 0 logs errors only, 1 stage milestones (the
default), 2 debug details, and 3 debug details with each AIR
operator’s tensors and options. AotConverter.convert() leaves
the helia_aot logger’s level and handlers as the caller set
them, and only adds the per-operator records levels 2 and 3 log. The
Results summary prints at every level; the log text is not part of
the API.
force
Pythonforce: bool = Field(False, description='Force conversion even if output exists')keep_work_dir
Pythonkeep_work_dir: bool = Field(False, description='Keep the temporary work directory and log its path')Keep the temporary work directory after the conversion instead of removing it, and log its path.
result_views
Pythonresult_views: bool = Field(False, description='Fill the operators, tensors, regions and placements views of the ConversionResult that AotConverter.convert() returns', json_schema_extra=stability(cli=False))Fill the operators, tensors, regions
and placements views of the ConversionResult that
AotConverter.convert() returns; they stay None otherwise.
The generated module is the same either way. It has no CLI flag,
since the command line returns no result.
log_file
Pythonlog_file: Path | None = Field(None, description='Optional log file path')Optional log file path.
from_yaml
PythonLoad a conversion config from a YAML file.
from_yaml(path: str | Path) -> ConvertArgsclassmethod
Load a conversion config from a YAML file.
The canonical programmatic entry point mirroring the CLI’s --path
(without the CLI’s flag-override merge):
config = ConvertArgs.from_yaml(“my-model.yaml”) AotConverter(config=config).convert()
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
path | str | Path | Required | Path to a YAML mapping of conversion options. |
Returns
| Type | Description |
|---|---|
ConvertArgs | The validated configuration. |
Raises
| Type | Description |
|---|---|
InvalidConfigError | If the file does not exist, cannot be read, is not UTF-8 or YAML, or is not a mapping, or if a key or value is invalid. Its ``exit_code`` is 2, the command line's status for the same file. For an invalid key or value the message lists every problem as the command line does, an unknown key with a did-you-mean suggestion, and pydantic's ``ValidationError`` is the ``__cause__``. Operator attributes are checked by ``AotConverter.convert()``, against its registry context. |