aitune.triton
Generate Triton model repositories from artifacts and existing model files.
Subpackages
Submodules
Package Contents
Classes
Functions
Data
API
Bases: _Options
Dynamic batching with preferred sizes, priorities, and queue policies.
Require configured priority levels and defaults to agree.
Bases: _Options
ONNX Runtime execution accelerator and backend-specific string parameters.
Bases: _Options
Model instance count, device placement, profiles, and rate limiting.
Reject GPU identifiers on CPU or model-managed instances.
Bases: BaseModel
User options for the Model Analyzer config generated during publication.
Bases: _Options
Named warmup sample with protobuf-shaped input data specifications.
Each input specifies data_type, dims, and one of zero_data,
random_data, or input_data_file. Files live under the model’s warmup directory.
Bases: BaseModelConfig
Triton configuration specialized for ONNX Runtime artifacts.
Read the execution provider selected for ONNX Runtime.
Preserve ONNX Runtime TensorRT provider selection.
Bases: _Options
Request timeout and queue capacity policy; times are in microseconds.
Bases: _Options
Sequence scheduling using Triton protobuf fields for controls and state.
direct and oldest select mutually exclusive strategies. Nested mappings
use the ModelSequenceBatching schema and are checked when the model config is built.
Allow at most one sequence scheduler strategy.
Bases: BaseModelConfig
Triton configuration specialized for serialized TensorRT plans.
Read plan profile metadata and TensorRT runtime settings.
Accept a non-empty set of distinct non-negative profile indices.
Add TensorRT optimization-profile selection to the common config.
Bases: BaseModelConfig
Triton configuration specialized for AOTInductor PT2 packages.
Read the PT2 package’s call structure.
Structured PT2 calls cannot use Triton’s implicit batch dimension.
Reject batching that cannot preserve a structured PT2 call.
Bases: enum.Enum
Tensor element types supported by AITune artifacts and Triton.
Bases: BaseModel
One input or output in a Triton model configuration.
Allow concrete positive dimensions and Triton’s dynamic marker.
Allow scalar reshapes and one inferred dimension.
Serialize only settings appropriate to an input or output tensor.
Publish a tuned artifact or an existing model file to a Triton repository.
The operation never replaces an existing model. Files are written directly
into the new model directory, so a failure can leave an incomplete directory.
For artifacts, a Model Analyzer config is generated under
model_analyzer/config.yaml with input shapes derived from the artifact.
Without an explicit config, the Triton batch limit and scheduler are derived
from the artifact’s tensor bounds and runtime call structure.
Existing model files require an explicit backend-specific config and
are copied without compilation or tuning. Callers must keep generation
separate from updates to a live Triton repository.
Supported model format/runtime pairs are onnx/onnxruntime,
tensorrt_plan/tensorrt, and pt2/aotinductor. ONNX provider
selection comes from runtime.options["execution_provider"]. TensorRT uses
model.metadata["optimization_profile_count"] and the optional runtime
setting use_cuda_graphs. PT2 uses model.metadata["structured_call"].
Parameters:
DeploymentArtifact | str | os.PathLike[str] — Deployment artifact or path to an existing model file.
Triton model repository root.
New model directory name for an artifact; defaults to config.name when config is supplied.
Positive Triton model version.
ModelAnalyzerConfig | None — Optional Model Analyzer options. Omission uses the default options for artifacts.
TensorRTModelConfig | ONNXRuntimeModelConfig | TorchAOTIModelConfig | None — Complete backend-specific configuration. For an artifact, it is derived when omitted. A supplied
config must match the artifact runtime and model name; the caller owns its other values. An existing
model file requires it.
ONNX external-data paths relative to the source file’s directory.
Model-relative auxiliary destination paths mapped to local files.
Returns: Path
Path to the generated model directory.
Raises:
AITuneUserInputError: If publication arguments are invalid.AITunePublicationError: If the artifact cannot be represented or publication fails.