pub struct ZeroConfig {
pub bf16: ZeroBf16Config,
pub scheduler: Option<ZeroSchedulerConfig>,
pub zero_optimization: Option<ZeroOptimizationConfig>,
pub gradient_clipping: Value,
pub gradient_accumulation_steps: Value,
}Expand description
Single-node compatible representation of configs/zero*.json.
Fields§
§bf16: ZeroBf16ConfigMixed-precision bfloat16 toggle.
scheduler: Option<ZeroSchedulerConfig>Scheduler configuration.
zero_optimization: Option<ZeroOptimizationConfig>ZeRO stage settings (logged for single-node Rust compatibility).
gradient_clipping: ValueOptional numeric gradient clipping threshold ("auto" ignored).
gradient_accumulation_steps: ValueOptional numeric gradient accumulation steps ("auto" ignored).
Implementations§
Source§impl ZeroConfig
impl ZeroConfig
Sourcepub fn from_file(path: &Path) -> Result<Self>
pub fn from_file(path: &Path) -> Result<Self>
Load and parse a zero*.json configuration file.
§Errors
Returns an error if the file cannot be read or fails JSON parsing.
Sourcepub fn cos_min_ratio(&self) -> f64
pub fn cos_min_ratio(&self) -> f64
Return cos_min_ratio if specified, defaulting to 0.0001.
Sourcepub fn max_grad_norm(&self) -> Option<f64>
pub fn max_grad_norm(&self) -> Option<f64>
Return numeric gradient_clipping if configured (ignoring "auto").
Sourcepub fn grad_accum_steps(&self) -> Option<usize>
pub fn grad_accum_steps(&self) -> Option<usize>
Return numeric gradient_accumulation_steps if configured (ignoring "auto").
Trait Implementations§
Source§impl Clone for ZeroConfig
impl Clone for ZeroConfig
Source§impl Debug for ZeroConfig
impl Debug for ZeroConfig
Source§impl Default for ZeroConfig
impl Default for ZeroConfig
Source§impl<'de> Deserialize<'de> for ZeroConfig
impl<'de> Deserialize<'de> for ZeroConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ZeroConfig
impl RefUnwindSafe for ZeroConfig
impl Send for ZeroConfig
impl Sync for ZeroConfig
impl Unpin for ZeroConfig
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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