pub struct ClusterState {
pub gpus: Vec<GpuState>,
pub model_registry: HashMap<ModelId, ModelSpec>,
}Expand description
The complete state of the GPU cluster at a point in time. This is the input to all routing decisions.
Fields§
§gpus: Vec<GpuState>§model_registry: HashMap<ModelId, ModelSpec>Implementations§
Source§impl ClusterState
impl ClusterState
pub fn new( gpus: Vec<GpuState>, model_registry: HashMap<ModelId, ModelSpec>, ) -> Self
Sourcepub fn find_loaded_model(&self, model_id: &ModelId) -> Option<(GpuId, u16)>
pub fn find_loaded_model(&self, model_id: &ModelId) -> Option<(GpuId, u16)>
Find which GPU (if any) currently has the given model loaded.
Sourcepub fn get_model_spec(&self, model_id: &ModelId) -> Option<&ModelSpec>
pub fn get_model_spec(&self, model_id: &ModelId) -> Option<&ModelSpec>
Get the spec for a model from the registry.
Sourcepub fn healthy_gpus_by_available_memory(&self) -> Vec<&GpuState>
pub fn healthy_gpus_by_available_memory(&self) -> Vec<&GpuState>
Get all healthy GPUs, sorted by available memory (most available first).
Trait Implementations§
Source§impl Clone for ClusterState
impl Clone for ClusterState
Source§fn clone(&self) -> ClusterState
fn clone(&self) -> ClusterState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ClusterState
impl RefUnwindSafe for ClusterState
impl Send for ClusterState
impl Sync for ClusterState
impl Unpin for ClusterState
impl UnsafeUnpin for ClusterState
impl UnwindSafe for ClusterState
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