pub struct DistributedMoE { /* private fields */ }Expand description
Distributed MoE layer implementation
Implementations§
Source§impl DistributedMoE
impl DistributedMoE
Sourcepub fn new(router: Box<dyn ExpertRouter>, config: MoEConfig) -> Self
pub fn new(router: Box<dyn ExpertRouter>, config: MoEConfig) -> Self
Create a new distributed MoE layer
Sourcepub fn register_expert(&mut self, expert: Box<dyn Expert>)
pub fn register_expert(&mut self, expert: Box<dyn Expert>)
Register an expert (local or remote)
Sourcepub fn register_remote_expert(&mut self, expert_id: ExpertId, peer_id: String)
pub fn register_remote_expert(&mut self, expert_id: ExpertId, peer_id: String)
Register remote expert location
Trait Implementations§
Source§impl MixtureOfExperts for DistributedMoE
impl MixtureOfExperts for DistributedMoE
Source§fn forward<'life0, 'life1, 'async_trait>(
&'life0 mut self,
input: &'life1 Tensor,
) -> Pin<Box<dyn Future<Output = DistributedResult<Tensor>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn forward<'life0, 'life1, 'async_trait>(
&'life0 mut self,
input: &'life1 Tensor,
) -> Pin<Box<dyn Future<Output = DistributedResult<Tensor>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Forward pass through MoE layer Read more
Source§fn registry(&self) -> &ExpertRegistry
fn registry(&self) -> &ExpertRegistry
Get the expert registry
Source§fn router(&self) -> &dyn ExpertRouter
fn router(&self) -> &dyn ExpertRouter
Get the router
Auto Trait Implementations§
impl !RefUnwindSafe for DistributedMoE
impl !UnwindSafe for DistributedMoE
impl Freeze for DistributedMoE
impl Send for DistributedMoE
impl Sync for DistributedMoE
impl Unpin for DistributedMoE
impl UnsafeUnpin for DistributedMoE
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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