Struct KernelMigrator
pub struct KernelMigrator {
coordinator: Arc<MultiGpuCoordinator>,
storage: Arc<dyn CheckpointStorage>,
stats: MigrationStats,
}Expand description
Migrator that uses checkpoints for kernel state transfer between GPUs.
This integrates the checkpoint infrastructure with the multi-GPU migration system to enable live migration of persistent kernels.
§Example
ⓘ
use ringkernel_core::multi_gpu::{KernelMigrator, MultiGpuBuilder};
let coordinator = MultiGpuBuilder::new().build();
let migrator = KernelMigrator::new(coordinator);
// Migrate kernel from GPU 0 to GPU 1
migrator.migrate_with_checkpoint(&kernel, &mut request).await?;Fields§
§coordinator: Arc<MultiGpuCoordinator>§storage: Arc<dyn CheckpointStorage>§stats: MigrationStatsImplementations§
§impl KernelMigrator
impl KernelMigrator
pub fn new(coordinator: Arc<MultiGpuCoordinator>) -> KernelMigrator
pub fn new(coordinator: Arc<MultiGpuCoordinator>) -> KernelMigrator
Create a new kernel migrator with default in-memory storage.
pub fn with_storage(
coordinator: Arc<MultiGpuCoordinator>,
storage: Arc<dyn CheckpointStorage>,
) -> KernelMigrator
pub fn with_storage( coordinator: Arc<MultiGpuCoordinator>, storage: Arc<dyn CheckpointStorage>, ) -> KernelMigrator
Create a migrator with custom checkpoint storage.
pub fn migrate_with_checkpoint<K>(
&self,
kernel: &K,
request: &mut MigrationRequest,
) -> Result<MigrationResult, RingKernelError>where
K: CheckpointableKernel,
pub fn migrate_with_checkpoint<K>(
&self,
kernel: &K,
request: &mut MigrationRequest,
) -> Result<MigrationResult, RingKernelError>where
K: CheckpointableKernel,
Perform a complete migration using checkpoint-based state transfer.
Steps:
- Quiesce the source kernel (drain pending messages)
- Create checkpoint of kernel state
- Transfer checkpoint to target device
- Restore kernel on target device
- Update coordinator routing tables
pub fn coordinator(&self) -> &Arc<MultiGpuCoordinator>
pub fn coordinator(&self) -> &Arc<MultiGpuCoordinator>
Get a reference to the coordinator.
pub fn stats(&self) -> MigrationStatsSnapshot
pub fn stats(&self) -> MigrationStatsSnapshot
Get migration statistics snapshot.
Auto Trait Implementations§
impl !Freeze for KernelMigrator
impl !RefUnwindSafe for KernelMigrator
impl Send for KernelMigrator
impl Sync for KernelMigrator
impl Unpin for KernelMigrator
impl !UnwindSafe for KernelMigrator
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.