Skip to main content

TensorRtRunner

Struct TensorRtRunner 

Source
pub struct TensorRtRunner { /* private fields */ }
Expand description

ModelRunner that drives an immutable TensorRT engine.

Implementations§

Source§

impl TensorRtRunner

Source

pub fn new(config: TensorRtConfig) -> InferenceResult<Self>

Read the plan file and prepare the runner. The TensorRT runtime / engine are not built until the first call to execute (so a runner can be instantiated on a host without libnvinfer for testing the config layer).

Trait Implementations§

Source§

impl ModelRunner for TensorRtRunner

Source§

fn execute<'life0, 'async_trait>( &'life0 mut self, _batch: ExecuteBatch, ) -> Pin<Box<dyn Future<Output = InferenceResult<RunHandle>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Run an inference. For local runtimes, dispatches kernels; for remote runtimes, sends an HTTP request. Returns immediately; completion is observed via the returned RunHandle stream.
Source§

fn rebuild_session<'life0, 'async_trait>( &'life0 mut self, cause: SessionRebuildCause, ) -> Pin<Box<dyn Future<Output = InferenceResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Local runtimes rebuild after CUDA context poison; remote runtimes rebuild after auth failure or config change.
Source§

fn runtime_kind(&self) -> RuntimeKind

Source§

fn transport_kind(&self) -> TransportKind

Source§

fn load_weights<'life0, 'life1, 'async_trait>( &'life0 mut self, _ctx: Option<&'life1 Arc<dyn Any + Sync + Send>>, _source: WeightSource, ) -> Pin<Box<dyn Future<Output = Result<(), InferenceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Local runtimes load weights to GPU; remote runtimes default to a no-op.
Source§

fn gil_pinned(&self) -> bool

Source§

fn rate_limits(&self) -> Option<&RateLimits>

Rate-limit metadata. Returns None for local runtimes; remote runtimes return their configured limits so the RateLimiterActor can be initialized at deploy time.
Source§

fn estimate_cost_usd(&self, _batch: &ExecuteBatch) -> f64

Best-effort cost estimate for the given batch (USD). Used by TieredRouter-style actors and budget enforcement. Local runtimes default to 0 (compute cost is amortized).

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.