Skip to main content

TrtMsg

Enum TrtMsg 

Source
pub enum TrtMsg {
    Build {
        source: NetworkSource,
        config: Box<IBuilderConfig>,
        reply: BuildReply,
    },
    Deserialize {
        plan: EnginePlan,
        reply: DeserializeReply,
    },
    CreateContext {
        engine: Arc<TrtEngine>,
        reply: CreateContextReply,
    },
    EnqueueOnStream {
        stream: Arc<CudaStream>,
        context: ExecutionContext,
        bindings: ExecutionBindings,
        reply: EnqueueReply,
    },
    Refit {
        engine: Arc<TrtEngine>,
        weights: Vec<RefitWeights>,
        reply: RefitReply,
    },
    Execute {
        engine: Arc<TrtEngine>,
        bindings: Vec<(String, u64)>,
        input_shapes: Vec<(String, Vec<i32>)>,
        stream: Arc<CudaStream>,
        reply: ExecuteReply,
    },
    BuildFromOnnx {
        onnx_bytes: Vec<u8>,
        config: Box<IBuilderConfig>,
        reply: BuildFromOnnxReply,
    },
}
Expand description

Public message surface for TrtActor.

The variant EnqueueOnStream accepts the Arc<CudaStream> from atomr-accel-cuda::DeviceActor so the TensorRT runtime shares the device’s stream timeline (no cross-stream synchronisation, no extra event hops).

Variants§

§

Build

Build a TensorRT engine from a network source + config. Returns the serialised plan on success.

Fields

§

Deserialize

Deserialise a plan blob into a shared engine handle.

§

CreateContext

Create a fresh IExecutionContext from an existing engine. Returns the new context (caller owns it).

Fields

§engine: Arc<TrtEngine>
§

EnqueueOnStream

Submit enqueueV3 on the supplied CUDA stream. The actor returns immediately after submission; real GPU completion is observed by atomr-accel-cuda’s completion strategy on the shared stream.

§

Refit

Refit a built engine in-place with new weights. Requires the engine to have been built with RefitPolicy::OnDemand or WeightsStreaming.

Fields

§engine: Arc<TrtEngine>
§

Execute

Phase 4.5++ — Run inference on a previously-loaded engine. bindings is (tensor_name, CUdeviceptr) for every I/O tensor on the engine; stream is the Arc<CudaStream> to enqueueV3 against (typically the device’s primary stream from DeviceMsg::SnapshotStream).

The handler creates a fresh IExecutionContext, binds every tensor address, then calls enqueueV3. Returns Ok(()) on successful submission (kernel still running on the GPU); real completion is observed by atomr-accel-cuda’s completion strategy on the shared stream.

On builds without tensorrt-link the variant compiles but the handler returns TrtError::NotLinked.

Fields

§engine: Arc<TrtEngine>
§bindings: Vec<(String, u64)>
§input_shapes: Vec<(String, Vec<i32>)>
§stream: Arc<CudaStream>
§

BuildFromOnnx

Phase 4.5++ — Parse an ONNX model and build a serialised engine plan. Gated on the upstream tensorrt-onnx feature (and transitively on tensorrt-link). Without those the handler returns TrtError::NotLinked.

Fields

§onnx_bytes: Vec<u8>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.