pub struct RayIntegration { /* private fields */ }Expand description
Ray compatibility integration
Implementations§
Source§impl RayIntegration
impl RayIntegration
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> TorshResult<Self>
pub fn from_file<P: AsRef<Path>>(path: P) -> TorshResult<Self>
Load configuration from JSON file
Sourcepub fn initialize(
&mut self,
rank: u32,
world_size: u32,
local_rank: u32,
local_size: u32,
) -> TorshResult<()>
pub fn initialize( &mut self, rank: u32, world_size: u32, local_rank: u32, local_size: u32, ) -> TorshResult<()>
Initialize Ray integration
Sourcepub fn to_elastic_config(&self) -> TorshResult<Option<ElasticConfig>>
pub fn to_elastic_config(&self) -> TorshResult<Option<ElasticConfig>>
Convert Ray config to ToRSh elastic config
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if Ray integration is initialized
Sourcepub fn world_size(&self) -> u32
pub fn world_size(&self) -> u32
Get world size
Sourcepub fn local_rank(&self) -> u32
pub fn local_rank(&self) -> u32
Get local rank
Sourcepub fn local_size(&self) -> u32
pub fn local_size(&self) -> u32
Get local size
Sourcepub fn is_ray_session_active(&self) -> bool
pub fn is_ray_session_active(&self) -> bool
Check if Ray session is active
Sourcepub fn run_training(
&mut self,
train_func_name: &str,
num_epochs: u32,
) -> TorshResult<()>
pub fn run_training( &mut self, train_func_name: &str, num_epochs: u32, ) -> TorshResult<()>
Simulate Ray Train run
Sourcepub fn run_tuning(&mut self, tune_config_name: &str) -> TorshResult<()>
pub fn run_tuning(&mut self, tune_config_name: &str) -> TorshResult<()>
Simulate Ray Tune run
Sourcepub fn shutdown(&mut self) -> TorshResult<()>
pub fn shutdown(&mut self) -> TorshResult<()>
Shutdown Ray integration
Sourcepub fn default_config() -> RayConfig
pub fn default_config() -> RayConfig
Create a default Ray configuration
Sourcepub fn config_with_tune(
num_samples: u32,
search_alg: RaySearchAlgorithm,
) -> RayConfig
pub fn config_with_tune( num_samples: u32, search_alg: RaySearchAlgorithm, ) -> RayConfig
Create a configuration for hyperparameter tuning
Sourcepub fn config_with_serve(num_replicas: u32) -> RayConfig
pub fn config_with_serve(num_replicas: u32) -> RayConfig
Create a configuration for model serving
Auto Trait Implementations§
impl Freeze for RayIntegration
impl RefUnwindSafe for RayIntegration
impl Send for RayIntegration
impl Sync for RayIntegration
impl Unpin for RayIntegration
impl UnsafeUnpin for RayIntegration
impl UnwindSafe for RayIntegration
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