pub struct TensorParallelismConfig {
pub tensor_parallel_size: usize,
pub partitioning_strategy: TensorPartitioningStrategy,
pub column_parallel: bool,
pub row_parallel: bool,
pub communication_pattern: TensorCommunicationPattern,
pub async_communication: bool,
pub fusion_threshold_bytes: usize,
pub gradient_accumulation: bool,
pub memory_optimization: TensorMemoryOptimization,
pub mixed_precision: bool,
}Expand description
Tensor Parallelism Configuration
Tensor parallelism distributes individual tensors (weights, activations) across multiple devices, enabling the training of models where individual layers are too large to fit on a single device. This is particularly effective for large linear layers and attention mechanisms.
Fields§
§tensor_parallel_size: usizeNumber of devices for tensor parallelism
partitioning_strategy: TensorPartitioningStrategyTensor partitioning strategy
column_parallel: boolWhether to use column parallelism for linear layers
row_parallel: boolWhether to use row parallelism for linear layers
communication_pattern: TensorCommunicationPatternCommunication pattern for tensor operations
async_communication: boolWhether to use asynchronous communication
fusion_threshold_bytes: usizeCommunication fusion threshold (operations below this size are fused)
gradient_accumulation: boolWhether to use gradient accumulation across tensor chunks
memory_optimization: TensorMemoryOptimizationMemory optimization level for tensor parallelism
mixed_precision: boolWhether to use mixed precision for tensor operations
Trait Implementations§
Source§impl Clone for TensorParallelismConfig
impl Clone for TensorParallelismConfig
Source§fn clone(&self) -> TensorParallelismConfig
fn clone(&self) -> TensorParallelismConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TensorParallelismConfig
impl Debug for TensorParallelismConfig
Source§impl Default for TensorParallelismConfig
impl Default for TensorParallelismConfig
Source§impl<'de> Deserialize<'de> for TensorParallelismConfig
impl<'de> Deserialize<'de> for TensorParallelismConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TensorParallelismConfig
impl RefUnwindSafe for TensorParallelismConfig
impl Send for TensorParallelismConfig
impl Sync for TensorParallelismConfig
impl Unpin for TensorParallelismConfig
impl UnsafeUnpin for TensorParallelismConfig
impl UnwindSafe for TensorParallelismConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ConfigSerializable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
impl<T> ConfigSerializable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
Source§fn save_to_file(&self, path: &Path) -> Result<(), TrustformersError>
fn save_to_file(&self, path: &Path) -> Result<(), TrustformersError>
Source§fn load_from_file(path: &Path) -> Result<Self, TrustformersError>where
Self: Sized,
fn load_from_file(path: &Path) -> Result<Self, TrustformersError>where
Self: Sized,
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>
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>
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