Skip to main content

TensorParallelRoutedExpertProvider

Trait TensorParallelRoutedExpertProvider 

Source
pub trait TensorParallelRoutedExpertProvider<B>: RoutedExpertProvider<B>{
    // Required methods
    fn forward_grouped_tensor_parallel(
        &mut self,
        resident_bank: &mut B::GatedProductGroups,
        request: RoutedExpertRequest<'_, B::Tensor>,
        partitions: usize,
        context: &<B::Tensor as Tensor>::Context,
    ) -> Result<RoutedExpertTensorParallelOutput<B::Tensor>, Self::Error>;
    fn forward_relu2_routed_tensor_parallel(
        &mut self,
        resident_bank: &mut B::Relu2Groups,
        request: RoutedExpertRequest<'_, B::Tensor>,
        partitions: usize,
        context: &<B::Tensor as Tensor>::Context,
    ) -> Result<RoutedExpertTensorParallelOutput<B::Tensor>, Self::Error>;

    // Provided method
    fn forward_compact_grouped_tensor_parallel(
        &mut self,
        resident_bank: &mut B::GatedProductGroups,
        request: RoutedExpertRequest<'_, B::Tensor>,
        partitions: usize,
        context: &<B::Tensor as Tensor>::Context,
    ) -> Result<RoutedExpertTensorParallelOutput<B::Tensor>, Self::Error> { ... }
}
Expand description

Additive provider mechanism for tensor-parallel grouped partials.

Required Methods§

Source

fn forward_grouped_tensor_parallel( &mut self, resident_bank: &mut B::GatedProductGroups, request: RoutedExpertRequest<'_, B::Tensor>, partitions: usize, context: &<B::Tensor as Tensor>::Context, ) -> Result<RoutedExpertTensorParallelOutput<B::Tensor>, Self::Error>

Executes a rank-local gated-product contribution.

Source

fn forward_relu2_routed_tensor_parallel( &mut self, resident_bank: &mut B::Relu2Groups, request: RoutedExpertRequest<'_, B::Tensor>, partitions: usize, context: &<B::Tensor as Tensor>::Context, ) -> Result<RoutedExpertTensorParallelOutput<B::Tensor>, Self::Error>

Executes a rank-local ReLU-squared contribution.

Provided Methods§

Source

fn forward_compact_grouped_tensor_parallel( &mut self, resident_bank: &mut B::GatedProductGroups, request: RoutedExpertRequest<'_, B::Tensor>, partitions: usize, context: &<B::Tensor as Tensor>::Context, ) -> Result<RoutedExpertTensorParallelOutput<B::Tensor>, Self::Error>

Executes destination-local, one-expert-per-row contributions while preserving the backend’s TP reduction and post-bias structure.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§