pub struct DeviceInfo {
pub device: String,
pub name: String,
pub mem_bytes: u64,
pub unified: bool,
pub gflops: f64,
pub available: bool,
}Expand description
A compute device present on a node, with its usable memory.
Fields§
§device: StringRLX device label (cpu, metal, cuda, ane/NPU, vulkan, …). Stored
as its canonical string so NodeCaps stays plainly (de)serializable.
name: StringHuman name (e.g. “Apple M4 Pro”, “NVIDIA RTX 3080 Ti”).
mem_bytes: u64Dedicated device memory in bytes (0 / host-RAM for unified/iGPU).
unified: boolTrue when the device shares host RAM (Apple unified, iGPU) — no separate VRAM ceiling, but it competes with the CPU stage for the same pool.
gflops: f64Measured f32 matmul throughput on THIS device (GFLOP/s), 0 when the backend is not built in or the bench did not run.
Placement needs this per device, not per node: ranking a machine by its CPU tells you nothing about the 4090 it will actually run the stage on.
available: boolTrue when the node’s own build can actually target this device.
The OS reporting a GPU and the binary being able to run on it are
different facts: a build without the metal feature still sees an M4
Pro, but every Session::new(Metal) on it panics. Recording that here
keeps the distinction visible — the alternative, leaving gflops at
0.0, reads to a planner as “present but infinitely slow” and to a human
as a benchmark failure, when the real answer is “rebuild with
--features metal”.
Implementations§
Source§impl DeviceInfo
impl DeviceInfo
Sourcepub fn parsed(&self) -> Option<Device>
pub fn parsed(&self) -> Option<Device>
Parsed device kind, or None when this coordinator does not recognise
the label.
Worth distinguishing: nodes report whatever their own rlx build calls a
device, so a cluster running mixed versions can send back a name this
binary has never heard of. Collapsing that to Cpu — as Self::kind
must, to keep its infallible signature — makes an unrecognised
accelerator invisible: the planner skips it as though it were the host
CPU and ignores its memory.
Sourcepub fn kind(&self) -> Device
pub fn kind(&self) -> Device
Parsed device kind, falling back to CPU for an unrecognised label.
Prefer Self::parsed where “unrecognised” and “CPU” mean different
things — which is most places.
Sourcepub fn is_recognized(&self) -> bool
pub fn is_recognized(&self) -> bool
True when this coordinator understands the reported device.
Trait Implementations§
Source§impl Clone for DeviceInfo
impl Clone for DeviceInfo
Source§impl Debug for DeviceInfo
impl Debug for DeviceInfo
Source§impl<'de> Deserialize<'de> for DeviceInfo
impl<'de> Deserialize<'de> for DeviceInfo
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>,
Source§impl PartialEq for DeviceInfo
impl PartialEq for DeviceInfo
Source§impl Serialize for DeviceInfo
impl Serialize for DeviceInfo
impl StructuralPartialEq for DeviceInfo
Auto Trait Implementations§
impl Freeze for DeviceInfo
impl RefUnwindSafe for DeviceInfo
impl Send for DeviceInfo
impl Sync for DeviceInfo
impl Unpin for DeviceInfo
impl UnsafeUnpin for DeviceInfo
impl UnwindSafe for DeviceInfo
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
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> ⓘ
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> ⓘ
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