pub trait PartitionedGroupExecutor<A, B, S, G, R, I>where
B: CommunicationBackend,
S: RuntimeState<B>,
A: LayeredArchitecture<B, S>,
G: Borrow<B::CommunicationGroup>,
R: Borrow<B::CommunicationRoute>,
I: CommunicationTensorMetadata<B>,{
type Pass<'a>;
// Required methods
fn begin<'a>(
&mut self,
input: A::Input<'a>,
state: &mut S,
pass: ExpertPass,
context: &<B::Tensor as Tensor>::Context,
) -> Result<Self::Pass<'a>, A::Error>;
fn request_group_active(
&self,
pass: &Self::Pass<'_>,
group: usize,
) -> Result<bool, A::Error>;
fn execute_group<O: ActivationObserver<B::Tensor, A::Error> + ?Sized>(
&mut self,
pass: &mut Self::Pass<'_>,
driver: &LayeredPartitionDriver,
state: &mut S,
communication: &PartitionCommunication<B, G, R, I>,
communication_executor: &B::Executor,
context: &<B::Tensor as Tensor>::Context,
observer: &mut O,
) -> Result<(), A::Error>;
fn boundary_values(
&mut self,
pass: &mut Self::Pass<'_>,
route: &PartitionBoundaryRoute,
schema: &ResolvedBoundaryWireSchema,
source: bool,
context: &<B::Tensor as Tensor>::Context,
) -> Result<Vec<ArchitectureBoundaryValue<B::Tensor>>, A::Error>;
fn boundary_schema(
&self,
pass: &Self::Pass<'_>,
route: &PartitionBoundaryRoute,
) -> Result<ResolvedBoundaryWireSchema, A::Error>;
fn accept_boundary(
&mut self,
pass: &mut Self::Pass<'_>,
route: &PartitionBoundaryRoute,
values: Vec<B::Tensor>,
) -> Result<(), A::Error>;
fn finish(
&mut self,
pass: Self::Pass<'_>,
state: &mut S,
context: &<B::Tensor as Tensor>::Context,
) -> Result<(B::Tensor, A::ForwardContext), A::Error>;
// Provided methods
fn has_cross_stage_collective_waves(&self) -> bool { ... }
fn execute_pipeline_wave<O: ActivationObserver<B::Tensor, A::Error> + ?Sized>(
&mut self,
pass: &mut Self::Pass<'_>,
group: usize,
driver: Option<&LayeredPartitionDriver>,
active: bool,
_wave: usize,
state: &mut S,
communication: &PartitionCommunication<B, G, R, I>,
communication_executor: &B::Executor,
context: &<B::Tensor as Tensor>::Context,
observer: &mut O,
) -> Result<(), A::Error> { ... }
fn prediction_target_capture(
&mut self,
forward: &A::ForwardContext,
_context: &<B::Tensor as Tensor>::Context,
) -> Result<Option<B::Tensor>, A::Error> { ... }
fn apply_prediction_target_operation<O>(
&mut self,
_state: &mut S,
_operation: O,
_context: &<B::Tensor as Tensor>::Context,
) -> Result<Option<O::Output>, A::Error>
where O: PredictionTargetOperation<A, B, S> { ... }
}Expand description
Statically dispatched architecture/provider adapter used by the production driver.
Direct, routed-provider, and composite prepared-input implementations share this interface without erasing tensors or per-unit execution. Typed architecture boundary values are encoded and decoded inside the adapter; only their validated native tensor bundle crosses the communication seam.
Required Associated Types§
Required Methods§
Sourcefn begin<'a>(
&mut self,
input: A::Input<'a>,
state: &mut S,
pass: ExpertPass,
context: &<B::Tensor as Tensor>::Context,
) -> Result<Self::Pass<'a>, A::Error>
fn begin<'a>( &mut self, input: A::Input<'a>, state: &mut S, pass: ExpertPass, context: &<B::Tensor as Tensor>::Context, ) -> Result<Self::Pass<'a>, A::Error>
Starts one invocation without traversing unowned groups.
Sourcefn request_group_active(
&self,
pass: &Self::Pass<'_>,
group: usize,
) -> Result<bool, A::Error>
fn request_group_active( &self, pass: &Self::Pass<'_>, group: usize, ) -> Result<bool, A::Error>
Reports request activity only for architecture-declared optional roots.
Sourcefn execute_group<O: ActivationObserver<B::Tensor, A::Error> + ?Sized>(
&mut self,
pass: &mut Self::Pass<'_>,
driver: &LayeredPartitionDriver,
state: &mut S,
communication: &PartitionCommunication<B, G, R, I>,
communication_executor: &B::Executor,
context: &<B::Tensor as Tensor>::Context,
observer: &mut O,
) -> Result<(), A::Error>
fn execute_group<O: ActivationObserver<B::Tensor, A::Error> + ?Sized>( &mut self, pass: &mut Self::Pass<'_>, driver: &LayeredPartitionDriver, state: &mut S, communication: &PartitionCommunication<B, G, R, I>, communication_executor: &B::Executor, context: &<B::Tensor as Tensor>::Context, observer: &mut O, ) -> Result<(), A::Error>
Executes exactly one locally owned group through its validated partition driver.
Sourcefn boundary_values(
&mut self,
pass: &mut Self::Pass<'_>,
route: &PartitionBoundaryRoute,
schema: &ResolvedBoundaryWireSchema,
source: bool,
context: &<B::Tensor as Tensor>::Context,
) -> Result<Vec<ArchitectureBoundaryValue<B::Tensor>>, A::Error>
fn boundary_values( &mut self, pass: &mut Self::Pass<'_>, route: &PartitionBoundaryRoute, schema: &ResolvedBoundaryWireSchema, source: bool, context: &<B::Tensor as Tensor>::Context, ) -> Result<Vec<ArchitectureBoundaryValue<B::Tensor>>, A::Error>
Produces source tensors or destination placeholders for one endpoint route.
Sourcefn boundary_schema(
&self,
pass: &Self::Pass<'_>,
route: &PartitionBoundaryRoute,
) -> Result<ResolvedBoundaryWireSchema, A::Error>
fn boundary_schema( &self, pass: &Self::Pass<'_>, route: &PartitionBoundaryRoute, ) -> Result<ResolvedBoundaryWireSchema, A::Error>
Resolves the exact invocation-dependent architecture boundary schema.
Sourcefn accept_boundary(
&mut self,
pass: &mut Self::Pass<'_>,
route: &PartitionBoundaryRoute,
values: Vec<B::Tensor>,
) -> Result<(), A::Error>
fn accept_boundary( &mut self, pass: &mut Self::Pass<'_>, route: &PartitionBoundaryRoute, values: Vec<B::Tensor>, ) -> Result<(), A::Error>
Installs a validated received typed-boundary bundle before its consumer runs.
Sourcefn finish(
&mut self,
pass: Self::Pass<'_>,
state: &mut S,
context: &<B::Tensor as Tensor>::Context,
) -> Result<(B::Tensor, A::ForwardContext), A::Error>
fn finish( &mut self, pass: Self::Pass<'_>, state: &mut S, context: &<B::Tensor as Tensor>::Context, ) -> Result<(B::Tensor, A::ForwardContext), A::Error>
Returns projected output on the owner and matching destination storage elsewhere.
The value is source data only on the publication root. On other ranks it is the architecture-selected destination/placeholder tensor validated before submission.
Provided Methods§
Sourcefn has_cross_stage_collective_waves(&self) -> bool
fn has_cross_stage_collective_waves(&self) -> bool
Whether inactive ranks submit collectives during pipeline-stage waves.
A failed wave is communication-indeterminate and therefore permanently fences the selected communication authority on every rank after phase agreement. Ordinary pipeline execution leaves this disabled so a deterministic architecture failure remains retryable after rollback.
Sourcefn execute_pipeline_wave<O: ActivationObserver<B::Tensor, A::Error> + ?Sized>(
&mut self,
pass: &mut Self::Pass<'_>,
group: usize,
driver: Option<&LayeredPartitionDriver>,
active: bool,
_wave: usize,
state: &mut S,
communication: &PartitionCommunication<B, G, R, I>,
communication_executor: &B::Executor,
context: &<B::Tensor as Tensor>::Context,
observer: &mut O,
) -> Result<(), A::Error>
fn execute_pipeline_wave<O: ActivationObserver<B::Tensor, A::Error> + ?Sized>( &mut self, pass: &mut Self::Pass<'_>, group: usize, driver: Option<&LayeredPartitionDriver>, active: bool, _wave: usize, state: &mut S, communication: &PartitionCommunication<B, G, R, I>, communication_executor: &B::Executor, context: &<B::Tensor as Tensor>::Context, observer: &mut O, ) -> Result<(), A::Error>
Participates in one globally ordered pipeline-stage execution wave.
Ordinary executors perform work only on the active stage. Executors with architecture-selected cross-stage collectives may use the wave ordinal on inactive stages to submit their exact zero-work protocol. The execution plan has already proved that an active rank owns a local driver, so absence of a driver is meaningful only for inactive ranks.
Sourcefn prediction_target_capture(
&mut self,
forward: &A::ForwardContext,
_context: &<B::Tensor as Tensor>::Context,
) -> Result<Option<B::Tensor>, A::Error>
fn prediction_target_capture( &mut self, forward: &A::ForwardContext, _context: &<B::Tensor as Tensor>::Context, ) -> Result<Option<B::Tensor>, A::Error>
Resolves an output-owner target capture or a matching rank-local placeholder.
The default serves non-pipeline executors, where every participant owns the complete target result. Pipeline executors override this through their retained architecture and allocator.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".