pub struct DistConfig {
pub rank: u32,
pub world_size: u32,
pub mode: ParallelMode,
pub backend: TransportBackend,
pub peers: Vec<SocketAddr>,
}Expand description
A fully-resolved launch configuration for one process.
Fields§
§rank: u32§world_size: u32§mode: ParallelMode§backend: TransportBackend§peers: Vec<SocketAddr>Implementations§
Source§impl DistConfig
impl DistConfig
Sourcepub fn from_hostfile(
hostfile: &Hostfile,
rank: u32,
mode: ParallelMode,
) -> Result<Self>
pub fn from_hostfile( hostfile: &Hostfile, rank: u32, mode: ParallelMode, ) -> Result<Self>
Build a config from a hostfile + this process’s rank.
Sourcepub fn load(
hostfile_path: impl AsRef<Path>,
rank: Option<u32>,
mode: ParallelMode,
) -> Result<Self>
pub fn load( hostfile_path: impl AsRef<Path>, rank: Option<u32>, mode: ParallelMode, ) -> Result<Self>
Load hosts.json and build the config in one step. rank falls
back to the RLX_RANK env var when None.
Sourcepub fn connect(&self) -> Result<ProcessGroup>
pub fn connect(&self) -> Result<ProcessGroup>
Establish the network mesh and return the process group. Blocks until every peer has connected.
Trait Implementations§
Source§impl Clone for DistConfig
impl Clone for DistConfig
Auto Trait Implementations§
impl Freeze for DistConfig
impl RefUnwindSafe for DistConfig
impl Send for DistConfig
impl Sync for DistConfig
impl Unpin for DistConfig
impl UnsafeUnpin for DistConfig
impl UnwindSafe for DistConfig
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