pub struct RoutedReplicatedTextExecution<P> { /* private fields */ }Expand description
Provider-backed routed unit execution using the shared replicated session.
Implementations§
Trait Implementations§
impl<A, B, S, R, P, Provider> ReplicatedRuntimeExecutionStrategy<A, B, S, R, P> for RoutedReplicatedTextExecution<Provider>where
B: SubmissionBackend<Executor = <<B as NeuralBackend>::Tensor as Tensor>::Context> + GroupedNeuralBackend,
S: RuntimeState<B>,
A: LayeredArchitecture<B, S> + RoutedLayeredArchitecture<B, S>,
R: LayerwisePolicy<B, A::Unit>,
P: LayerwisePolicy<B, A::Unit, Error = R::Error>,
Provider: RoutedExpertProvider<B>,
Provider::Error: Display,
A::Error: Display,
P::Error: Display,
Source§impl<A, B, S, R, P, Provider> ReplicatedTextExecutionStrategy<A, B, S, R, P> for RoutedReplicatedTextExecution<Provider>where
B: SubmissionBackend<Executor = <<B as NeuralBackend>::Tensor as Tensor>::Context> + GroupedNeuralBackend,
S: RuntimeState<B>,
A: LayeredArchitecture<B, S> + RoutedLayeredArchitecture<B, S>,
R: LayerwisePolicy<B, A::Unit>,
P: LayerwisePolicy<B, A::Unit, Error = R::Error>,
Provider: RoutedExpertProvider<B>,
Provider::Error: Display,
A::Error: Display,
P::Error: Display,
impl<A, B, S, R, P, Provider> ReplicatedTextExecutionStrategy<A, B, S, R, P> for RoutedReplicatedTextExecution<Provider>where
B: SubmissionBackend<Executor = <<B as NeuralBackend>::Tensor as Tensor>::Context> + GroupedNeuralBackend,
S: RuntimeState<B>,
A: LayeredArchitecture<B, S> + RoutedLayeredArchitecture<B, S>,
R: LayerwisePolicy<B, A::Unit>,
P: LayerwisePolicy<B, A::Unit, Error = R::Error>,
Provider: RoutedExpertProvider<B>,
Provider::Error: Display,
A::Error: Display,
P::Error: Display,
Source§type Runtime = ReplicatedTextRuntime<A, B, S, R, P>
type Runtime = ReplicatedTextRuntime<A, B, S, R, P>
Concrete execution runtime paired before the shared session lifecycle begins.
Source§fn bounded_policy(runtime: &Self::Runtime) -> Option<&P>
fn bounded_policy(runtime: &Self::Runtime) -> Option<&P>
Returns bounded residency state for the shared session report.
Source§fn execution_residency(
_runtime: &Self::Runtime,
selected: &SelectedReplicatedTextRealization,
) -> ExecutionResidency
fn execution_residency( _runtime: &Self::Runtime, selected: &SelectedReplicatedTextRealization, ) -> ExecutionResidency
Returns the execution residency actually installed on this rank.
Source§fn forward_with_observer<'a, O>(
&mut self,
runtime: &mut Self::Runtime,
input: A::Input<'a>,
state: &mut S,
pass: ExpertPass,
context: &<<B as NeuralBackend>::Tensor as Tensor>::Context,
observer: &mut O,
) -> Result<(B::Tensor, A::ForwardContext), ReplicatedTextSessionError<A::Error, R::Error, Infallible>>
fn forward_with_observer<'a, O>( &mut self, runtime: &mut Self::Runtime, input: A::Input<'a>, state: &mut S, pass: ExpertPass, context: &<<B as NeuralBackend>::Tensor as Tensor>::Context, observer: &mut O, ) -> Result<(B::Tensor, A::ForwardContext), ReplicatedTextSessionError<A::Error, R::Error, Infallible>>
Executes one complete layered pass through the selected unit strategy.
Source§fn apply_prediction_target_operation<O>(
runtime: &mut Self::Runtime,
state: &mut S,
operation: O,
context: &<B::Tensor as Tensor>::Context,
) -> Result<Option<O::Output>, ReplicatedTextSessionError<A::Error, R::Error, Infallible>>where
O: PredictionTargetOperation<A, B, S>,
fn apply_prediction_target_operation<O>(
runtime: &mut Self::Runtime,
state: &mut S,
operation: O,
context: &<B::Tensor as Tensor>::Context,
) -> Result<Option<O::Output>, ReplicatedTextSessionError<A::Error, R::Error, Infallible>>where
O: PredictionTargetOperation<A, B, S>,
Runs one typed prediction-only operation against session-owned target modules and state.
Source§const PARTITIONED_SESSION: bool = false
const PARTITIONED_SESSION: bool = false
Whether this strategy executes one rank of a partitioned session.
Source§const DISTRIBUTED_PHASE_AGREEMENT: bool = false
const DISTRIBUTED_PHASE_AGREEMENT: bool = false
Whether control phases use a selected bounded all-rank agreement.
Source§fn observe_output<O>(
_runtime: &mut Self::Runtime,
output: &B::Tensor,
observer: &mut O,
_context: &<B::Tensor as Tensor>::Context,
) -> Result<B::Tensor, ReplicatedTextSessionError<A::Error, R::Error, Infallible>>
fn observe_output<O>( _runtime: &mut Self::Runtime, output: &B::Tensor, observer: &mut O, _context: &<B::Tensor as Tensor>::Context, ) -> Result<B::Tensor, ReplicatedTextSessionError<A::Error, R::Error, Infallible>>
Applies the architecture’s final-logits observation on the rank that
owns the authoritative output. Ordinary replicated strategies observe
locally; partitioned strategies may suppress the seam on destinations.
Source§fn publish_observed_output(
_runtime: &mut Self::Runtime,
output: B::Tensor,
_context: &<B::Tensor as Tensor>::Context,
) -> Result<B::Tensor, ReplicatedTextSessionError<A::Error, R::Error, Infallible>>
fn publish_observed_output( _runtime: &mut Self::Runtime, output: B::Tensor, _context: &<B::Tensor as Tensor>::Context, ) -> Result<B::Tensor, ReplicatedTextSessionError<A::Error, R::Error, Infallible>>
Publishes an already-observed authoritative output after every rank has
agreed that final observation succeeded.
Source§fn prediction_target_capture(
_runtime: &mut Self::Runtime,
forward: &A::ForwardContext,
_context: &<B::Tensor as Tensor>::Context,
) -> Result<Option<B::Tensor>, ReplicatedTextSessionError<A::Error, R::Error, Infallible>>
fn prediction_target_capture( _runtime: &mut Self::Runtime, forward: &A::ForwardContext, _context: &<B::Tensor as Tensor>::Context, ) -> Result<Option<B::Tensor>, ReplicatedTextSessionError<A::Error, R::Error, Infallible>>
Resolves the rank-local tensor used by an additive prediction extension. Read more
Source§fn publish_prediction_target_capture(
_runtime: &mut Self::Runtime,
capture: B::Tensor,
_context: &<B::Tensor as Tensor>::Context,
) -> Result<B::Tensor, ReplicatedTextSessionError<A::Error, R::Error, Infallible>>
fn publish_prediction_target_capture( _runtime: &mut Self::Runtime, capture: B::Tensor, _context: &<B::Tensor as Tensor>::Context, ) -> Result<B::Tensor, ReplicatedTextSessionError<A::Error, R::Error, Infallible>>
Publishes the output-owner capture to every prediction participant.
Source§fn commit_after_completion(
_runtime: &mut Self::Runtime,
epoch: DistributedCommitEpoch,
_context: &<<B as NeuralBackend>::Tensor as Tensor>::Context,
) -> DistributedCommitOutcome
fn commit_after_completion( _runtime: &mut Self::Runtime, epoch: DistributedCommitEpoch, _context: &<<B as NeuralBackend>::Tensor as Tensor>::Context, ) -> DistributedCommitOutcome
Performs strategy-specific distributed commit only after output
intervention and exact mechanism completion have succeeded.
Source§fn agree_distributed_phase(
_runtime: &mut Self::Runtime,
_phase: DistributedExecutionPhase,
local_success: bool,
_context: &<<B as NeuralBackend>::Tensor as Tensor>::Context,
) -> Result<bool, ReplicatedTextSessionError<A::Error, R::Error, Infallible>>
fn agree_distributed_phase( _runtime: &mut Self::Runtime, _phase: DistributedExecutionPhase, local_success: bool, _context: &<<B as NeuralBackend>::Tensor as Tensor>::Context, ) -> Result<bool, ReplicatedTextSessionError<A::Error, R::Error, Infallible>>
Propagates one local shared-session phase result before the lifecycle
can advance. Direct and unsupported strategies retain the local result.
Auto Trait Implementations§
impl<P> Freeze for RoutedReplicatedTextExecution<P>where
P: Freeze,
impl<P> RefUnwindSafe for RoutedReplicatedTextExecution<P>where
P: RefUnwindSafe,
impl<P> Send for RoutedReplicatedTextExecution<P>where
P: Send,
impl<P> Sync for RoutedReplicatedTextExecution<P>where
P: Sync,
impl<P> Unpin for RoutedReplicatedTextExecution<P>where
P: Unpin,
impl<P> UnsafeUnpin for RoutedReplicatedTextExecution<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for RoutedReplicatedTextExecution<P>where
P: UnwindSafe,
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