pub struct ThreeDParallelismConfig {
pub dp_size: usize,
pub tp_size: usize,
pub pp_size: usize,
pub num_layers: usize,
pub micro_batch_size: usize,
pub memory_strategy: MemoryOptimizationStrategy,
pub comm_strategy: CommunicationStrategy,
pub enable_gradient_checkpointing: bool,
pub enable_mixed_precision: bool,
pub pipeline_schedule: PipelineSchedule,
pub max_memory_per_device: f32,
pub communication_timeout_ms: u64,
}Expand description
Configuration for 3D parallelism (Data, Tensor, Pipeline)
Fields§
§dp_size: usizeData parallel dimension size
tp_size: usizeTensor parallel dimension size
pp_size: usizePipeline parallel dimension size
num_layers: usizeTotal number of layers in the model
micro_batch_size: usizeMicro-batch size for pipeline parallelism
memory_strategy: MemoryOptimizationStrategyMemory optimization strategy
comm_strategy: CommunicationStrategyCommunication optimization strategy
enable_gradient_checkpointing: boolWhether to enable gradient checkpointing
enable_mixed_precision: boolWhether to enable mixed precision training
pipeline_schedule: PipelineSchedulePipeline schedule type
max_memory_per_device: f32Maximum memory usage per device (in GB)
communication_timeout_ms: u64Communication timeout in milliseconds
Implementations§
Source§impl ThreeDParallelismConfig
impl ThreeDParallelismConfig
Sourcepub fn validate(&self, world_size: usize) -> TorshResult<()>
pub fn validate(&self, world_size: usize) -> TorshResult<()>
Validate configuration against available world size
Sourcepub fn layers_per_stage(&self) -> usize
pub fn layers_per_stage(&self) -> usize
Get number of layers per pipeline stage
Sourcepub fn memory_requirements(&self) -> MemoryRequirements
pub fn memory_requirements(&self) -> MemoryRequirements
Calculate memory requirements per device
Trait Implementations§
Source§impl Clone for ThreeDParallelismConfig
impl Clone for ThreeDParallelismConfig
Source§fn clone(&self) -> ThreeDParallelismConfig
fn clone(&self) -> ThreeDParallelismConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ThreeDParallelismConfig
impl Debug for ThreeDParallelismConfig
Auto Trait Implementations§
impl Freeze for ThreeDParallelismConfig
impl RefUnwindSafe for ThreeDParallelismConfig
impl Send for ThreeDParallelismConfig
impl Sync for ThreeDParallelismConfig
impl Unpin for ThreeDParallelismConfig
impl UnsafeUnpin for ThreeDParallelismConfig
impl UnwindSafe for ThreeDParallelismConfig
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,
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