Struct FallbackOp
pub struct FallbackOp<R>where
R: FusionRuntime,{ /* private fields */ }Expand description
One operation of an optimization’s block, runnable on its own.
A fallback is unfused work in the middle of a fused block: an optimization that cannot serve part of what it replaced runs those operations directly instead. So it carries the operation’s IR alongside the operation, because running it has to apply the same rule the unfused path applies — an operation whose input a failure claims does not run, and its outputs take that failure. Without it the fallback would be the one place left where a claimed tensor still reaches a kernel.
Implementations§
§impl<R> FallbackOp<R>where
R: FusionRuntime,
impl<R> FallbackOp<R>where
R: FusionRuntime,
pub fn execute(
&self,
handles: &mut HandleContainer<<R as FusionRuntime>::FusionHandle>,
)
pub fn execute( &self, handles: &mut HandleContainer<<R as FusionRuntime>::FusionHandle>, )
Run it — unless a failure claims one of its inputs, in which case its outputs take that failure, one hop further down, and no kernel runs.
A panic out of the operation is left to the caller: a fallback runs
inside the optimization’s own catch_unwind, which claims the whole
block’s write set, and that is the honest report for a fused unit that
stopped part way.
A fallback that skips or reports gets there by a different road to the same place. Both return normally, so neither stops the optimization — it goes on launching the kernels around this operation, and they write their outputs from bytes it never produced. So the failure is reported back to the execution, which claims the block’s whole write set once the optimization returns. Nothing is claimed twice that matters: the claim carries this same failure, so a read below any of it names one cause.
Trait Implementations§
§impl<R> Clone for FallbackOp<R>where
R: FusionRuntime,
impl<R> Clone for FallbackOp<R>where
R: FusionRuntime,
§fn clone(&self) -> FallbackOp<R>
fn clone(&self) -> FallbackOp<R>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<R> !RefUnwindSafe for FallbackOp<R>
impl<R> !UnwindSafe for FallbackOp<R>
impl<R> Freeze for FallbackOp<R>
impl<R> Send for FallbackOp<R>
impl<R> Sync for FallbackOp<R>
impl<R> Unpin for FallbackOp<R>
impl<R> UnsafeUnpin for FallbackOp<R>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§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>
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>
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