pub struct DeviceManager { /* private fields */ }Expand description
Device manager for multi-GPU coordination
Implementations§
Source§impl DeviceManager
impl DeviceManager
Sourcepub fn discover_devices(&self) -> Result<()>
pub fn discover_devices(&self) -> Result<()>
Discover available devices
Sourcepub fn get_devices(&self) -> Vec<DeviceInfo>
pub fn get_devices(&self) -> Vec<DeviceInfo>
Get all available devices
Sourcepub fn get_device(&self, device: &Device) -> Option<DeviceInfo>
pub fn get_device(&self, device: &Device) -> Option<DeviceInfo>
Get device info by ID
Sourcepub fn primary_device(&self) -> Device
pub fn primary_device(&self) -> Device
Get primary device
Sourcepub fn set_primary_device(&self, device: Device) -> Result<()>
pub fn set_primary_device(&self, device: Device) -> Result<()>
Set primary device
Sourcepub fn get_gpu_devices(&self) -> Vec<DeviceInfo>
pub fn get_gpu_devices(&self) -> Vec<DeviceInfo>
Get available GPU devices
Sourcepub fn total_gpu_memory(&self) -> usize
pub fn total_gpu_memory(&self) -> usize
Get total available GPU memory across all devices
Sourcepub fn update_memory_usage(&self, device: &Device, used_bytes: usize)
pub fn update_memory_usage(&self, device: &Device, used_bytes: usize)
Update memory usage for a device
Sourcepub fn find_devices_for_model(&self, model_size_bytes: usize) -> Vec<DeviceInfo>
pub fn find_devices_for_model(&self, model_size_bytes: usize) -> Vec<DeviceInfo>
Find devices that can fit a model of given size
Sourcepub fn select_devices_for_parallelism(
&self,
model_size_bytes: usize,
min_devices: usize,
max_devices: usize,
) -> Vec<DeviceInfo>
pub fn select_devices_for_parallelism( &self, model_size_bytes: usize, min_devices: usize, max_devices: usize, ) -> Vec<DeviceInfo>
Select optimal devices for parallel execution
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DeviceManager
impl !RefUnwindSafe for DeviceManager
impl Send for DeviceManager
impl Sync for DeviceManager
impl Unpin for DeviceManager
impl UnsafeUnpin for DeviceManager
impl UnwindSafe for DeviceManager
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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