pub struct ZeRoConfig {
pub stage: ZeRoStage,
pub world_size: usize,
pub rank: usize,
pub cpu_offload: bool,
pub nvme_offload: bool,
pub overlap_comm: bool,
pub bucket_size: usize,
}Expand description
ZeRO configuration
Fields§
§stage: ZeRoStageZeRO stage
world_size: usizeNumber of processes/GPUs
rank: usizeCurrent process rank
cpu_offload: boolEnable CPU offloading
nvme_offload: boolEnable NVMe offloading
overlap_comm: boolOverlap communication with computation
bucket_size: usizeBucket size for gradient accumulation
Implementations§
Source§impl ZeRoConfig
impl ZeRoConfig
Sourcepub fn stage1(world_size: usize, rank: usize) -> Self
pub fn stage1(world_size: usize, rank: usize) -> Self
Stage 1 configuration (optimizer state partitioning)
Sourcepub fn stage2(world_size: usize, rank: usize) -> Self
pub fn stage2(world_size: usize, rank: usize) -> Self
Stage 2 configuration (gradient partitioning)
Sourcepub fn stage3(world_size: usize, rank: usize) -> Self
pub fn stage3(world_size: usize, rank: usize) -> Self
Stage 3 configuration (parameter partitioning)
Sourcepub fn with_offload(self, cpu: bool, nvme: bool) -> Self
pub fn with_offload(self, cpu: bool, nvme: bool) -> Self
ZeRO-Offload configuration
Trait Implementations§
Source§impl Clone for ZeRoConfig
impl Clone for ZeRoConfig
Source§fn clone(&self) -> ZeRoConfig
fn clone(&self) -> ZeRoConfig
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 ZeRoConfig
impl Debug for ZeRoConfig
Auto Trait Implementations§
impl Freeze for ZeRoConfig
impl RefUnwindSafe for ZeRoConfig
impl Send for ZeRoConfig
impl Sync for ZeRoConfig
impl Unpin for ZeRoConfig
impl UnwindSafe for ZeRoConfig
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> 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