pub struct DeepSpeedIntegration { /* private fields */ }Expand description
DeepSpeed integration manager
Implementations§
Source§impl DeepSpeedIntegration
impl DeepSpeedIntegration
Sourcepub fn new(config: DeepSpeedConfig) -> Self
pub fn new(config: DeepSpeedConfig) -> Self
Create a new DeepSpeed integration instance
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> TorshResult<Self>
pub fn from_file<P: AsRef<Path>>(path: P) -> TorshResult<Self>
Load DeepSpeed configuration from file
Sourcepub fn from_json(json: &str) -> TorshResult<Self>
pub fn from_json(json: &str) -> TorshResult<Self>
Load DeepSpeed configuration from JSON string
Sourcepub fn initialize(&mut self) -> TorshResult<()>
pub fn initialize(&mut self) -> TorshResult<()>
Initialize DeepSpeed integration
Sourcepub fn config(&self) -> &DeepSpeedConfig
pub fn config(&self) -> &DeepSpeedConfig
Get the current configuration
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if DeepSpeed integration is initialized
Sourcepub fn to_fsdp_config(&self) -> TorshResult<FsdpConfig>
pub fn to_fsdp_config(&self) -> TorshResult<FsdpConfig>
Convert DeepSpeed config to ToRSh FSDP config
Sourcepub fn to_gradient_compression_config(&self) -> Option<CompressionConfig>
pub fn to_gradient_compression_config(&self) -> Option<CompressionConfig>
Convert DeepSpeed config to ToRSh gradient compression config
Sourcepub fn get_stats(&self) -> DeepSpeedStats
pub fn get_stats(&self) -> DeepSpeedStats
Get performance statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeepSpeedIntegration
impl RefUnwindSafe for DeepSpeedIntegration
impl Send for DeepSpeedIntegration
impl Sync for DeepSpeedIntegration
impl Unpin for DeepSpeedIntegration
impl UnsafeUnpin for DeepSpeedIntegration
impl UnwindSafe for DeepSpeedIntegration
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> 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