aitune.torch.backend.torch_inductor_aot_backend
aitune.torch.backend.torch_inductor_aot_backend
Torch Inductor AOT backend.
Module Contents
Classes
Data
API
Bases: Backend
Backend that compiles models using AOT Inductor (torch._inductor.aoti_compile_and_package).
Requires PyTorch >= 2.6.
Performs Ahead-of-Time compilation to a portable .pt2 artifact saved to disk.
Dynamic batch shapes are inferred automatically from graph_spec when a batch axis is
detected. At inference time the artifact is loaded via torch._inductor.aoti_load_package,
enabling deployment without Python-interpreter overhead.
Workflow::
backend = TorchInductorAotBackend()
build / tune as usual through ait.tune()
ait.save(model, “model.ait”)
later
ait.load(model, “model.ait”)
Load the compiled model from disk.
Export and compile the model with AOT Inductor, then load the runner.
Deactivate backend.
Deploy backend.
Run inference with the compiled AOT Inductor runner.
Parameters:
Inference arguments.
Inference keyword arguments.
Returns: Any
The result of the inference.
Returns the description of the backend.
Creates a backend from a state_dict.
Returns the key of the backend.
Returns the state_dict of the backend.
Bases: BackendConfig
Configuration for TorchInductorAotBackend.
Parameters:
Mapping of torch._inductor.config attribute names to values,
passed to torch._inductor.aoti_compile_and_package().
Call torch._inductor.list_options() to see all available keys.
Example: {"max_autotune": True, "coordinate_descent_tuning": True}
Bases: BackendBuildStep
Identifiers for discrete sub-steps of a TorchInductorAot backend build.