aitune.torch.backend.tensorrt.tensorrt_builder
aitune.torch.backend.tensorrt.tensorrt_builder
TensorRT Builder module for building TensorRT engines from ONNX models.
Module Contents
Classes
Data
API
Class for building TensorRT engines from ONNX models.
Build the kwargs for the CreateConfig constructor.
Parameters:
Maximum workspace size
TensorRT optimization level
Hardware compatibility level
List of optimization profiles
Path to timing cache
Enable TF32 hardware acceleration
Returns:
Dictionary of kwargs for CreateConfig
Build TensorRT engine from network.
Parameters:
TensorRT network
TensorRT configuration
Returns: Any
TensorRT engine
Create TensorRT config.
Parameters:
List of TensorRT optimization profiles
Returns: Any
TensorRT configuration object
Create TensorRT network from ONNX.
Returns: Any
TensorRT network
Handle errors during engine build.
Parameters:
The exception that occurred
Path to the engine file
Save the TensorRT engine to a file.
Parameters:
TensorRT engine
Path to save the engine
Validate that the ONNX file exists.
Raises:
FileNotFoundError: If the ONNX file does not exist
Build the TensorRT engine.
Returns: Path
Path to the TensorRT engine