Errors
A failure a user can act on is raised as a HeliaAotError. Each one also inherits the standard-library exception that fits it, so code that already catches ValueError or FileNotFoundError keeps working when it calls the converter directly.
An error may carry a hint: one actionable next step, printed dim under the message when the command line reports the failure. The hint is written where the error is raised rather than on the class, so it is specific to what went wrong and is not listed here.
| Error | Also a |
|---|---|
| ConfigValueError | ValueError |
| GoldenDataKeyError | KeyError |
| HeliaAotError | Exception |
| ModelLoadError | FileNotFoundError |
| OutputExistsError | FileExistsError |
| TemplateRenderError | RuntimeError |
| UnsupportedModelError | ValueError |
ConfigValueError
Section titled “ConfigValueError”class ConfigValueError(HeliaAotError, ValueError)A configuration value is invalid for the requested conversion.
Also a ValueError so callers catching the stdlib type keep working.
GoldenDataKeyError
Section titled “GoldenDataKeyError”class GoldenDataKeyError(HeliaAotError, KeyError)A supplied golden-data archive is missing a required tensor key.
Also a KeyError so callers catching the stdlib type keep working.
HeliaAotError
Section titled “HeliaAotError”class HeliaAotError(Exception)Base class for user-facing heliaAOT failures.
Args: message: What went wrong, phrased for the user. hint: One actionable next step (rendered dim below the error). details: Supporting output (e.g. tool stderr), rendered dim.
ModelLoadError
Section titled “ModelLoadError”class ModelLoadError(HeliaAotError, FileNotFoundError)The input model could not be found or parsed.
Also a FileNotFoundError so callers catching the stdlib type keep
working.
OutputExistsError
Section titled “OutputExistsError”class OutputExistsError(HeliaAotError, FileExistsError)An output path already exists and --force was not given.
Also a FileExistsError so callers catching the stdlib type keep
working.
TemplateRenderError
Section titled “TemplateRenderError”class TemplateRenderError(HeliaAotError, RuntimeError)A codegen template referenced context its handler did not supply.
The shared Jinja environment uses StrictUndefined, so an undefined
name, a missing attribute, or an out-of-range index raises during emit
instead of rendering as the empty string. That is always a heliaAOT defect
rather than a user mistake, but it is reachable from a valid model, so the
failure is reported with the operator, template, and line that produced it
and the original UndefinedError is kept as __cause__. Also a
RuntimeError so callers catching the stdlib type keep working.
UnsupportedModelError
Section titled “UnsupportedModelError”class UnsupportedModelError(HeliaAotError, ValueError)The input model uses a structure or dtype heliaAOT cannot lower.
Raised when a graph is recognized but cannot be compiled, so the message
can name the recognized construct and the hint can state the supported
form. Also a ValueError so callers catching the stdlib type keep
working.