Skip to main content

Crate atomr_accel_tensorrt

Crate atomr_accel_tensorrt 

Source
Expand description

§atomr-accel-tensorrt

TensorRT engine builder + runtime as supervised atomr actors. Wraps NVIDIA’s libnvinfer (and optionally libnvonnxparser) at runtime — the library itself is not vendored because it is proprietary; users opt in via the tensorrt-link feature and either install TensorRT system-wide or set LIBNVINFER_PATH.

§Features

  • tensorrt-link — actually link libnvinfer at build time. Off-by-default so the crate compiles on hosts without TensorRT (used by CI + unit tests).
  • tensorrt-onnx — pull in nvonnxparser for ONNX import.
  • tensorrt-pluginIPluginV3 Rust trampolines.
  • tensorrt-int8 — INT8 calibration helpers (entropy / minmax).
  • tensorrt-fp8 — FP8 PTQ helpers (Hopper-class GPUs).

§Public surface

  • actor::TrtActor / actor::TrtMsg — sibling actor to atomr_accel_cuda::DeviceActor. Shares Arc<CudaStream> with the device actor so inference rides the same execution timeline.
  • builder::IBuilderConfig — pure-Rust mirror of the TensorRT builder config, with knobs for precision, DLA, structured sparsity, tactic sources, timing cache, and engine refit.
  • engine::TrtEngine — owned, immutable engine handle that’s Send + Sync via newtype.
  • runtime::TrtRuntime / runtime::ExecutionContext — load serialised plans + drive enqueueV3 on a shared CUDA stream.
  • [onnx::OnnxParser] — gated on tensorrt-onnx.
  • [calibration] — gated on tensorrt-int8 / tensorrt-fp8.
  • [plugin] — gated on tensorrt-plugin.

Re-exports§

pub use actor::BuildFromOnnxReply;
pub use actor::BuildReply;
pub use actor::CreateContextReply;
pub use actor::DeserializeReply;
pub use actor::EnqueueReply;
pub use actor::ExecuteReply;
pub use actor::NetworkSource;
pub use actor::RefitReply;
pub use actor::RefitWeights;
pub use actor::TrtActor;
pub use actor::TrtMsg;
pub use builder::BuilderFlags;
pub use builder::DeviceType;
pub use builder::IBuilderConfig;
pub use builder::Precision;
pub use builder::RefitPolicy;
pub use builder::TacticSources;
pub use engine::EnginePlan;
pub use engine::TrtEngine;
pub use engine::TrtRefitter;
pub use error::TrtError;
pub use runtime::EnqueueRequest;
pub use runtime::ExecutionBindings;
pub use runtime::ExecutionContext;
pub use runtime::TensorShape;
pub use runtime::TrtRuntime;

Modules§

actor
TrtActor — sibling of atomr_accel_cuda::DeviceActor.
builder
Safe wrappers for nvinfer1::IBuilder and nvinfer1::IBuilderConfig.
engine
Safe wrapper around nvinfer1::ICudaEngine.
error
Error types for the TensorRT actor surface.
runtime
Safe wrapper around nvinfer1::IExecutionContext and the IRuntime deserialiser. This is the inference-time hot path.
sys
Hand-written FFI surface for libnvinfer (and libnvonnxparser when the tensorrt-onnx feature is on).

Functions§

init_logger
No-op when the tensorrt-link feature is off so callers don’t need to gate their init_logger() calls.