pub struct NodeCaps {
pub rank: u32,
pub role: NodeRole,
pub devices: Vec<String>,
pub platform: String,
}Expand description
What a node tells the coordinator about itself, so placement is driven by what the hardware can actually do rather than by assumption.
Fields§
§rank: u32§role: NodeRole§devices: Vec<String>Backends live on this node, as Device::as_arg tokens (the wire stays
stable even if the Device enum gains variants).
platform: StringFree-form platform tag ("ios", "android", "linux", …) for logs and
placement heuristics.
Implementations§
Source§impl NodeCaps
impl NodeCaps
Sourcepub fn accepts(&self, spec: &StageSpec) -> Result<(), String>
pub fn accepts(&self, spec: &StageSpec) -> Result<(), String>
Whether this node can run spec at all.
Sourcepub fn can_train(&self) -> Result<(), String>
pub fn can_train(&self) -> Result<(), String>
Whether this node can join a training run.
A coordinator must ask before shipping a
TrainSpec. Shipping one to a rank that cannot
train does not fail loudly: the spec lands on a tag that rank never
reads, and then the coordinator blocks forever on the first gradient
all-reduce, because a barrier needs every rank to arrive.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeCaps
impl<'de> Deserialize<'de> for NodeCaps
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 NodeCaps
impl RefUnwindSafe for NodeCaps
impl Send for NodeCaps
impl Sync for NodeCaps
impl Unpin for NodeCaps
impl UnsafeUnpin for NodeCaps
impl UnwindSafe for NodeCaps
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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