pub struct WeightShard {
pub name: String,
pub parallel_type: LayerParallelType,
pub shard_dim: usize,
pub shard_range: (usize, usize),
}Expand description
Weight sharding specification
Fields§
§name: StringOriginal tensor name
parallel_type: LayerParallelTypeParallel type
shard_dim: usizeDimension to shard along
shard_range: (usize, usize)Local shard range (start, end)
Implementations§
Source§impl WeightShard
impl WeightShard
Sourcepub fn column_parallel(
name: impl Into<String>,
dim_size: usize,
config: &TensorParallelConfig,
) -> Self
pub fn column_parallel( name: impl Into<String>, dim_size: usize, config: &TensorParallelConfig, ) -> Self
Create column-parallel shard specification
Sourcepub fn row_parallel(
name: impl Into<String>,
dim_size: usize,
config: &TensorParallelConfig,
) -> Self
pub fn row_parallel( name: impl Into<String>, dim_size: usize, config: &TensorParallelConfig, ) -> Self
Create row-parallel shard specification
Sourcepub fn replicated(name: impl Into<String>) -> Self
pub fn replicated(name: impl Into<String>) -> Self
Create replicated weight specification
Trait Implementations§
Source§impl Clone for WeightShard
impl Clone for WeightShard
Source§fn clone(&self) -> WeightShard
fn clone(&self) -> WeightShard
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WeightShard
impl RefUnwindSafe for WeightShard
impl Send for WeightShard
impl Sync for WeightShard
impl Unpin for WeightShard
impl UnsafeUnpin for WeightShard
impl UnwindSafe for WeightShard
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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