pub trait AddressableExpertRouteProvider<T> {
type Error;
// Required method
fn execute_addressable_routes(
&mut self,
request: AddressableExpertRouteRequest<'_, T>,
) -> Result<T, Self::Error>;
// Provided method
fn execute_addressable_routes_tensor_parallel(
&mut self,
request: AddressableExpertRouteRequest<'_, T>,
) -> Result<RoutedExpertTensorParallelOutput<T>, Self::Error> { ... }
}Expand description
Local addressable grouped execution used by expert exchange.
The provider must consume every submitted row exactly once, select its corresponding owner-local expert, and apply its route coefficient exactly once. Acquired bank resources remain provider-owned until the returned tensor is natively complete.
Required Associated Types§
Required Methods§
Sourcefn execute_addressable_routes(
&mut self,
request: AddressableExpertRouteRequest<'_, T>,
) -> Result<T, Self::Error>
fn execute_addressable_routes( &mut self, request: AddressableExpertRouteRequest<'_, T>, ) -> Result<T, Self::Error>
Executes one owner-local grouped batch.
Provided Methods§
Sourcefn execute_addressable_routes_tensor_parallel(
&mut self,
request: AddressableExpertRouteRequest<'_, T>,
) -> Result<RoutedExpertTensorParallelOutput<T>, Self::Error>
fn execute_addressable_routes_tensor_parallel( &mut self, request: AddressableExpertRouteRequest<'_, T>, ) -> Result<RoutedExpertTensorParallelOutput<T>, Self::Error>
Executes one owner-local grouped batch while retaining tensor-parallel reduction structure.
Providers without rank-local TP work inherit complete-output behavior. A TP provider overrides this method and returns its reducible activation contribution plus the optional selection-weighted post-reduction bias. The exchange protocol returns both values to their source-token order; it must not add the bias before the caller’s tensor all-sum.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".