pub(crate) struct TrtJitGuard {
guard_seq: usize,
warmed_seq_ceiling: usize,
}Expand description
Per-request snapshot of the in-band JIT admission policy.
Cheap to construct (two usizes); the worker builds one per request from
the live warmed_seq_ceiling atomic so the decision always reflects the
latest pool-wide coverage. A None guard at the call sites disables
checking entirely (non-TRT EPs, or BGE_M3_TRT_INBAND_JIT_GUARD=0).
Fields§
§guard_seq: usize§warmed_seq_ceiling: usizeImplementations§
Source§impl TrtJitGuard
impl TrtJitGuard
Sourcepub(crate) fn new(guard_seq: usize, warmed_seq_ceiling: usize) -> Self
pub(crate) fn new(guard_seq: usize, warmed_seq_ceiling: usize) -> Self
Builds a guard from the danger threshold and the current pool-wide warmed-sequence ceiling.
Sourcepub(crate) fn admit(
&self,
batch: usize,
seq: usize,
) -> Result<(), TrtJitRejection>
pub(crate) fn admit( &self, batch: usize, seq: usize, ) -> Result<(), TrtJitRejection>
Decides whether a single chunk (batch, seq) may be dispatched to
session.run().
Refuses iff the sequence length is in the dangerous range
(seq >= guard_seq) and is not covered by the warmed profile
(seq > warmed_seq_ceiling). Everything else is admitted:
seq < guard_seq- below the dangerous tier; a cold JIT here is bounded and lets the profile grow naturally.seq <= warmed_seq_ceiling- covered by an existing engine plan; the run is a cache hit / fast disk-load, never a pathological JIT.
Trait Implementations§
Source§impl Clone for TrtJitGuard
impl Clone for TrtJitGuard
Source§fn clone(&self) -> TrtJitGuard
fn clone(&self) -> TrtJitGuard
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TrtJitGuard
impl Debug for TrtJitGuard
impl Copy for TrtJitGuard
Auto Trait Implementations§
impl Freeze for TrtJitGuard
impl RefUnwindSafe for TrtJitGuard
impl Send for TrtJitGuard
impl Sync for TrtJitGuard
impl Unpin for TrtJitGuard
impl UnsafeUnpin for TrtJitGuard
impl UnwindSafe for TrtJitGuard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more